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
sage maker only giving top result
#5
by gunjan0507 - opened
I want result containing all the labels , but i am getting only top result in sage maker.
When you run
predictor.predict({
'inputs': "I like you. I love you"
})
You need to pass it the parameter return_all_scores like so:
payload = {
"inputs": ["I love you",
"You should really get your act together."],
"parameters": {'return_all_scores': True}
}