Course Name: Natural Language Processing in Trading, Section No: 4, Unit No: 5, Unit type: Notebook
Not able to figure out how do we calculate the "sentiment_class" and "sentiment_score". It would be great if you can provide the method to calculate the sentiment class and sentiment score.
Hi Harshvardhan,
In section 4, the sentiment_class and sentiment_score for the news headline are provided to you and, based on the daily sentiment score and trading strategy was created.
Further in the section, using the sentiment_class of the news headline, we will train the xgboost model. The trained xgboost model is used to predict the sentiment of the new news headline. This means that whenever you provide a new news headline to the xgboost model, it will predict which sentiment class the particular news headline belongs to.
Therefore, you don't need to calculate the sentiment class and sentiment score. You just need to pass the news headline.
In section 17 unit 1, you will learn to get the new news headline data.
Hope that helps.
Thanks vibhu for the prompt reply…I totally understand your point…but I guess I didn't make my point clear… Actually what I want to know is, how to calculate the 'sentiment_class' and 'sentiment _score' from the scratch.
Let's say we've been given some news headlines as a column, and along with that there are other column. How to calculate the sentiment_class and sentiment_score from those data…I know they have already provided us dataset with precalculated seniment_class and sentiment_score…but how do we calculate sentiment_class and sentiment_score by ourselves?
From your query, what I understood is that you don't want to use the trained model to predict the sentiments of the news headlines. Instead, you want to create your CSV file with sentiment class. If that's the case, you can use VADER sentiment analysis tool that can be used to calculate the sentiment of the text. You can pass the news headline to the VADER, and it will return the sentiment score. Based on the score, you can classify the news headline as positive, negative or neutral.
Hope that helps.