Spaces:
Runtime error
Runtime error
import del dataset nel file python del modello
Browse files- MLOps_project/modello.py +9 -1
MLOps_project/modello.py
CHANGED
|
@@ -1,3 +1,11 @@
|
|
| 1 |
from transformers import pipeline
|
| 2 |
sentiment_task = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment-latest", tokenizer="cardiffnlp/twitter-roberta-base-sentiment-latest")
|
| 3 |
-
print(sentiment_task("Covid cases are increasing fast!"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
sentiment_task = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment-latest", tokenizer="cardiffnlp/twitter-roberta-base-sentiment-latest")
|
| 3 |
+
# print(sentiment_task("Covid cases are increasing fast!"))
|
| 4 |
+
|
| 5 |
+
from datasets import load_dataset
|
| 6 |
+
ds = load_dataset("SetFit/tweet_sentiment_extraction")
|
| 7 |
+
# il dataset viene splittato da load_dataset
|
| 8 |
+
# stampa il primo record del set di train
|
| 9 |
+
print(ds['train'][0])
|
| 10 |
+
# stampa il primo record del set di test
|
| 11 |
+
print(ds['test'][0])
|