Stock News Sentimental Analysys
## Project Overview
This project centers around analyzing sentiment from financial news articles related to specific stock tickers retrieved from Finviz. Leveraging Python libraries such as Beautiful Soup for web scraping, NLTK for sentiment analysis, Pandas for data manipulation, and Matplotlib for visualization, this project aims to extract news headlines, perform sentiment analysis, and visualize sentiment trends for chosen stock tickers.
## Data Collection
The code uses web scraping techniques to extract news headlines from Finviz's website for selected stock tickers (in this case: AMD, AMZN, NVDA). It retrieves the headlines, their publication dates, and times, storing this information in a structured format using Pandas DataFrames.
## Sentiment Analysis
The NLTK library's Vader Sentiment Intensity Analyzer is employed to assess the sentiment of each news headline. The sentiment scores (negative, neutral, positive, compound) are computed and appended to the DataFrame. For instance, a compound score of -0.5423 suggests a moderately negative sentiment in a headline.
## Data Visualization
The sentiment analysis results are visualized using Matplotlib. A bar chart is generated to display the mean compound sentiment scores for each ticker over time. This visualization offers an intuitive view of sentiment trends associated with the selected stocks based on the news headlines.
## Conclusion
This project demonstrates the utilization of web scraping techniques to gather real-time financial news data and sentiment analysis tools to gauge market sentiment around specific stocks. The ability to analyze sentiment from textual data can provide insights into market perception, potentially aiding investors in making informed decisions.
---
Source Code:
Finviz: https://finviz.com/
I recommend running this on Goole Colab or Jupyter to see the graphics.
Thanks for reading!
Gerard Puche