Views
No views yet
bert-base-uncased pre-trained model for Sequence Classification. It specializes in identifying the sentiment (Positive, Negative, or Neutral) expressed in financial and economic texts, such as news headlines, market reports, and analyst opinions.bert-base-uncased.0: Negative, 1: Neutral, 2: Positive.pipeline feature for quick inference:1from transformers import pipeline
2
3# Load the model and tokenizer
4sentiment_pipeline = pipeline("sentiment-analysis", model="[YOUR_HF_USERNAME]/FinancialSentimentAnalyzer")
5
6# Test cases
7result1 = sentiment_pipeline("Tesla's revenue beat expectations, leading to a surge in stock price.")
8result2 = sentiment_pipeline("The company announced a neutral guidance for the upcoming quarter.")
9result3 = sentiment_pipeline("Massive product recall due to safety issues caused the stock to plummet.")
10
11print(result1)
12# [{'label': 'Positive', 'score': 0.998}]
13print(result2)
14# [{'label': 'Neutral', 'score': 0.985}]
15print(result3)
16# [{'label': 'Negative', 'score': 0.999}]