Instructions to use cardiffnlp/twitter-roberta-base-sentiment with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cardiffnlp/twitter-roberta-base-sentiment with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="cardiffnlp/twitter-roberta-base-sentiment")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("cardiffnlp/twitter-roberta-base-sentiment") model = AutoModelForSequenceClassification.from_pretrained("cardiffnlp/twitter-roberta-base-sentiment") - Inference
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse filesLooks like the correct form for the tasks
README.md
CHANGED
|
@@ -43,7 +43,7 @@ def preprocess(text):
|
|
| 43 |
|
| 44 |
# Tasks:
|
| 45 |
# emoji, emotion, hate, irony, offensive, sentiment
|
| 46 |
-
# stance
|
| 47 |
|
| 48 |
task='sentiment'
|
| 49 |
MODEL = f"cardiffnlp/twitter-roberta-base-{task}"
|
|
|
|
| 43 |
|
| 44 |
# Tasks:
|
| 45 |
# emoji, emotion, hate, irony, offensive, sentiment
|
| 46 |
+
# stance-abortion, stance-atheism, stance-climate, stance-feminist, stance-hillary
|
| 47 |
|
| 48 |
task='sentiment'
|
| 49 |
MODEL = f"cardiffnlp/twitter-roberta-base-{task}"
|