stackofsugar
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -29,10 +29,25 @@ pipeline_tag: text-classification
|
|
29 |
|
30 |
This model is fine-tuned from the checkpoint of [AIMH/mental-longformer-base-4096](https://huggingface.co/AIMH/mental-longformer-base-4096) using [drmuskangarg/CAMS](https://github.com/drmuskangarg/CAMS/) dataset. For more information about the base Longformer model, please visit their [model page](https://huggingface.co/allenai/longformer-base-4096). We used the same configuration as `AIMH/mental-longformer-base-4096` including their tokenizer.
|
31 |
|
32 |
-
# Usage
|
33 |
|
34 |
-
|
35 |
|
36 |
-
|
|
|
37 |
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
This model is fine-tuned from the checkpoint of [AIMH/mental-longformer-base-4096](https://huggingface.co/AIMH/mental-longformer-base-4096) using [drmuskangarg/CAMS](https://github.com/drmuskangarg/CAMS/) dataset. For more information about the base Longformer model, please visit their [model page](https://huggingface.co/allenai/longformer-base-4096). We used the same configuration as `AIMH/mental-longformer-base-4096` including their tokenizer.
|
31 |
|
32 |
+
# Usage
|
33 |
|
34 |
+
If you wish to use my model to infer your dataset or maybe pre-train it further, you can import my model in a Python script/notebook.
|
35 |
|
36 |
+
```py
|
37 |
+
from transformers import LongformerTokenizer, LongformerForSequenceClassification
|
38 |
|
39 |
+
tokenizer = LongformerTokenizer.from_pretrained("aimh/mental-longformer-base-4096")
|
40 |
+
model = LongformerForSequenceClassification.from_pretrained("stackofsugar/mentallongformer-cams-finetuned")
|
41 |
+
```
|
42 |
+
|
43 |
+
If you prefer to use the high-level HuggingFace pipeline to make predictions, you can also do it in a Python script/notebook.
|
44 |
+
|
45 |
+
```py
|
46 |
+
from transformers import pipeline
|
47 |
+
|
48 |
+
pipe = pipeline("text-classification", model="stackofsugar/mentallongformer-cams-finetuned", tokenizer="aimh/mental-longformer-base-4096")
|
49 |
+
```
|
50 |
+
|
51 |
+
# More Information
|
52 |
+
|
53 |
+
For more information, visit my [GitHub Repo](https://github.com/stackofsugar/depression-causal-analysis).
|