halme commited on
Commit
c7d17bd
·
verified ·
1 Parent(s): 1a61582

Update DataLoader.py

Browse files
Files changed (1) hide show
  1. DataLoader.py +3 -3
DataLoader.py CHANGED
@@ -7,7 +7,7 @@ import matplotlib.pyplot as plt
7
  import yfinance as yf
8
  from datetime import datetime
9
  from pygooglenews import GoogleNews
10
- from transformers import TFAutoTokenizer, TFAutoModelForSequenceClassification
11
  from transformers import pipeline
12
  class DataLoader:
13
  def __init__(self, ticker, time_period_news, time_period_stock, news_decay_rate = 0):
@@ -45,8 +45,8 @@ class DataLoader:
45
  return news_data
46
 
47
  def get_sentiment(self, news_data):
48
- tokenizer = TFAutoTokenizer.from_pretrained("ProsusAI/finbert")
49
- model = TFAutoModelForSequenceClassification.from_pretrained("ProsusAI/finbert")
50
  classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
51
 
52
  news_sentiment = []
 
7
  import yfinance as yf
8
  from datetime import datetime
9
  from pygooglenews import GoogleNews
10
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
11
  from transformers import pipeline
12
  class DataLoader:
13
  def __init__(self, ticker, time_period_news, time_period_stock, news_decay_rate = 0):
 
45
  return news_data
46
 
47
  def get_sentiment(self, news_data):
48
+ tokenizer = AutoTokenizer.from_pretrained("ProsusAI/finbert")
49
+ model = AutoModelForSequenceClassification.from_pretrained("ProsusAI/finbert")
50
  classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
51
 
52
  news_sentiment = []