Skip to content

stAItuned/financial-sentiment-analysis

Repository files navigation

Financial Sentiment Analysis

License Language Libraries
Licence Python Pytorch Flask Streamlit Pandas

Contents


The goal of this project is to give you the chance of looking at the dependence between the news sentiment of a company with respect to its share price. This project is one part of a main project still on its way, which aims to provide a financial analysis platform.

News data are taken through Polyglon APIs, using the stocks basic API plan account.

The project structure is based on a server side, which manages the calls to the sentiment analysis model, and a client side, that show a UI. The server provides a service API for the inference of the model and the extraction of news and stock data, while the client is developed as a platform, generated with streamlit, that allows the user to interact with the server side, searching the interested companies to be analyzed.

We developed the sentiment analysis model as a neural network model, based on fine-tuning of an existent pre-trained model. We trained and experimented different models, until we reached the best one. In order to keep our model private, we provide just a pre-trained model as a sentiment analysis model, that is the transformers model taken from hugging face


  1. Create a new virtual environment
python -m venv ./venv
source venv/bin/activate
pip install --upgrade pip
  1. Clone the repository and move to the downloaded directory
git clone https://github.com/sicilian-scientists/financial-sentiment-analysis
cd financial-sentiment-analysis
  1. Request Polyglon's API key (FREE)
  2. Write the given key in 'files/api_key_polyglon.txt'
echo API_KEY > files/api_key_polyglon.txt
  1. Install the requirements
pip install requirements.txt
  1. Run local server and dashboard
python api_server.py
streamlit run main.py
  1. You're ready to go!
  1. Fork the repository
  2. Do the desired changes
  3. Make a pull request

Linkedin Portfolio

Linkedin Portfolio

Releases

No releases published

Packages

No packages published

Languages