Created
September 14, 2022 19:29
-
-
Save yavuzKomecoglu/a1fa9e4fb5253d0a592959ef749f8a7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline | |
# load model | |
model = AutoModelForSequenceClassification.from_pretrained("cardiffnlp/twitter-roberta-base-sentiment") | |
tokenizer = AutoTokenizer.from_pretrained("cardiffnlp/twitter-roberta-base-sentiment") | |
# create pipeline | |
sa = pipeline("sentiment-analysis", tokenizer=tokenizer, model=model) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment