paulagarciaserrano
commited on
Commit
•
01557a5
1
Parent(s):
a6dcbea
Update README.md
Browse files
README.md
CHANGED
@@ -13,19 +13,8 @@ You can use this model directly with a pipeline for text classification:
|
|
13 |
```python
|
14 |
>>> from transformers import pipeline
|
15 |
>>> classifier = pipeline("text-classification", model="paulagarciaserrano/roberta-depression-detection")
|
16 |
-
>>>
|
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
|
|
|
13 |
```python
|
14 |
>>> from transformers import pipeline
|
15 |
>>> classifier = pipeline("text-classification", model="paulagarciaserrano/roberta-depression-detection")
|
16 |
+
>>> your_text = "I am very sad."
|
17 |
+
>>> classifier (your_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
```
|
19 |
|
20 |
# Training and evaluation data
|