News Harbor
Check out the project on github
Overview Link to heading
News Harbor is a news platform that detects the sentiment of News articles. check out this demo
Sentiment analysis in NLP is the process of determining the emotion or tone behind a piece of text, classifying it as positive, negative, or neutral. It’s used to gauge public opinion, feedback, or reactions. Techniques include lexicon-based methods using sentiment dictionaries and machine learning models trained on labeled data. In this project it was used to classifiy the news articles.
Usage Link to heading
How it works Link to heading
- The user enters the news_article API_key; in this case i used my api key in the
.env
file in secrets folder which was loaded to thenews_api_data.py
file. - The API is then used to fetch the news article from the news api, which returns a JSON. chcek the
news_api_data.py
file and thenews_api_data.json
file in core folder and data folder respectively. - The JSON is then converted to a pandas dataframe and then the dataframe is sent to the sentiment analysis model. check the
convert.py
file in core folder. - The sentiment analysis model returns the sentiment of the news article in a CSV file format. check the
model.ipynb
file in model folder. Note: Google Colab was used in running the sentiment analysis model. - The sentiment in CSV is sent to the frontend.
- The frontend displays the sentiment of the news article. check the
main.py
file in the frontend folder.
Tech Used Link to heading
- API: News API was used for the news feed Getting the news data for the model
- Hugging Face sentiment analysis model: Hugging Face was used for the sentiment analysis model
- Streamlit was used for the frontend of the project. Streamlit