The goal of this project is to determine whether a news has a positive or a negative sentiment towards the keyword or ticker symbol (Stock). However, to make things simple, I use a prebuilt model.
import feedparser
from transformers import pipeline
pipe = pipeline(task="text-classification", model="ProsusAI/finbert")
Strategy
The goal for this project is to determine the overall score. The ML model would return a score in range from 0 to 1, and if it's above 0.5, it will regarded the news as positive and negative when the score is below 0.5.
So, the strategy that I'm using is to add all the positive score and subtracting the negative score and then deviding that number by the sum of the articles. This will give me a range of -1 and 1. So, we could adjust the standard deviation. For example, if it's below -0.34 is a negative and above 0.34 is a postive and if it's in between it will be a neutral.
As expected the model works, however there is I couldn't justify whether the overall goal achieved successfully or not.