Downloads · 30 days
2
3% of all-time downloads
YC9Z/tesla_news_title_sentiment_analysis
tesla_news_title_sentiment_analysis is a text classification model from YC9Z. Use it when you need a label for a piece of text. It is set up for transformers.
tunedbertmodel = BertForSequenceClassification.frompretrained('YC9Z/teslanewstitlesentimentanalysis', id2label={0: 'Neutral', 1: 'Positive', 2: 'Negative'})
Downloads · 30 days
2
3% of all-time downloads
All-time downloads
66
Public
Repo size
876 MB
Likes
0
Public
Click a slice to open those files.
.bin438 MB · 100%
From the Hugging Face model README
tuned_bert_model = BertForSequenceClassification.from_pretrained('YC9Z/tesla_news_title_sentiment_analysis', id2label={0: 'Neutral', 1: 'Positive', 2: 'Negative'})
senti_tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
inputs = senti_tokenizer("I like you. I love you", padding=True, truncation=True, max_length=512, return_tensors='pt')
outputs = tuned_bert_model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
predictions