paulagarciaserrano
commited on
Commit
•
a6dcbea
1
Parent(s):
2846d5b
Update README.md
Browse files
README.md
CHANGED
@@ -6,6 +6,28 @@ The obtained macro f1-score is 0.54, on the development set of the competition.
|
|
6 |
This model is trained to classify the given text into one of the following classes: *moderate*, *severe*, or *not depressed*.
|
7 |
It corresponds to a **multiclass classification** task.
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Training and evaluation data
|
10 |
The **train** dataset characteristics are:
|
11 |
|
|
|
6 |
This model is trained to classify the given text into one of the following classes: *moderate*, *severe*, or *not depressed*.
|
7 |
It corresponds to a **multiclass classification** task.
|
8 |
|
9 |
+
# How to use
|
10 |
+
|
11 |
+
You can use this model directly with a pipeline for text classification:
|
12 |
+
|
13 |
+
```python
|
14 |
+
>>> from transformers import pipeline
|
15 |
+
>>> classifier = pipeline("text-classification", model="paulagarciaserrano/roberta-depression-detection")
|
16 |
+
>>> classifier ("I am very sad.")
|
17 |
+
```
|
18 |
+
|
19 |
+
Here is how to use this model with PyTorch:
|
20 |
+
|
21 |
+
```python
|
22 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
23 |
+
model_checkpoint = "paulagarciaserrano/roberta-depression-detection"
|
24 |
+
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
25 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_checkpoint, num_labels=3)
|
26 |
+
text = "I am very sad."
|
27 |
+
encoded_input = tokenizer(text, return_tensors='pt')
|
28 |
+
output = model(**encoded_input)
|
29 |
+
```
|
30 |
+
|
31 |
# Training and evaluation data
|
32 |
The **train** dataset characteristics are:
|
33 |
|