Views
No views yet
financial_phrasebank dataset. Specifically, it was trained on sentences from the Sentences_50Agree.txt file that contained keywords for major tech companies (Google, Apple, Microsoft, Amazon, Nvidia, etc.).pipeline function from the transformers library.1from transformers import pipeline
2
3sentiment_analyzer = pipeline(
4 "text-classification",
5 model="esix117/FinBERT-Tech-Sentiment"
6)
7
8# Example 1
9result = sentiment_analyzer("Nvidia reported record earnings, beating all estimates.")
10print(result)
11# >> [{'label': 'positive', 'score': 0.8...}]
12
13# Example 2
14result = sentiment_analyzer("Apple shares fell after the new product announcement.")
15print(result)
16# >> [{'label': 'negative', 'score': 0.9...}]