Update README.md
Browse files
README.md
CHANGED
|
@@ -90,7 +90,24 @@ Ideal for:
|
|
| 90 |
|
| 91 |
## How to Use
|
| 92 |
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
```python
|
| 96 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
|
|
| 90 |
|
| 91 |
## How to Use
|
| 92 |
|
| 93 |
+
Using pipelines, it takes only 4 lines:
|
| 94 |
+
|
| 95 |
+
```pyython
|
| 96 |
+
from transformers import pipeline
|
| 97 |
+
|
| 98 |
+
# Load the classification pipeline with the specified model
|
| 99 |
+
pipe = pipeline("text-classification", model="tabularisai/multilingual-sentiment-analysis")
|
| 100 |
+
|
| 101 |
+
# Classify a new sentence
|
| 102 |
+
sentence = "I love this product! It's amazing and works perfectly."
|
| 103 |
+
result = pipe(sentence)
|
| 104 |
+
|
| 105 |
+
# Print the result
|
| 106 |
+
print(result)
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
Below is a Python example on how to use the multilingual sentiment model without pipelines:
|
| 110 |
+
|
| 111 |
|
| 112 |
```python
|
| 113 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|