Skip to content

A project that predicts ESG indices from stock prices and news sentiment and conversely forecasts stock prices using ESG ratings and sentiment signals.

Notifications You must be signed in to change notification settings

popchanovska/PredictionFinancialPerformance

Repository files navigation

ESG and Stock Price Prediction Using News Sentiment

Project Summary

This project focuses on predicting companies' ESG (Environmental, Social, Governance) indices using stock prices and news sentiment, and conversely predicting stock prices based on ESG ratings and news sentiment. The goal is to explore how financial performance and public perception interact through machine learning.


Data Collection

News Articles

News data is collected using a Google News scraper built with Node.js and Puppeteer. Articles are gathered for multiple companies based on search queries and stored in JSON format.

ESG Ratings

Environmental, Social, Governance and total ESG scores are extracted from Yahoo Finance using custom scripts.

Stock Prices

Historical stock prices for each company are downloaded from Yahoo Finance and consolidated into a unified dataset.


News Processing and Sentiment Analysis

The news pipeline consists of several stages:

  • News Reader – Converts raw article JSON files into structured DataFrames
  • Title Classification – Classifies news headlines into four categories: government, social, environment and neutral
  • Sentiment Analysis – Applies multiple models to label headlines as positive or negative

These outputs are stored and reused in later stages.


Final Dataset Creation

Multiple datasets are merged to form a comprehensive final dataset:

  • News metadata, topic classification and sentiment scores
  • Daily stock prices per company
  • Individual E, S, G ratings and total ESG scores

The result is a per-news, per-company dataset containing sentiment features, financial data and ESG indicators, which serves as input for modeling.


XGBoost Models

Several XGBoost models are developed for different prediction tasks.

ESG Prediction

Models predict Environmental, Social, Governance and total ESG scores using:

  • Stock prices
  • Percentages of positive and negative news across government, environment and social categories

Stock Price Prediction

Two approaches are explored:

  1. Predicting stock price using previous-day stock values, ESG ratings and news sentiment
  2. A second model excluding previous-day stock prices to reduce potential overfitting, relying only on ESG and news-based features

Conclusion

This project demonstrates an end-to-end pipeline combining web scraping, NLP-based news analysis, feature engineering and XGBoost modeling to study the relationship between ESG ratings, news sentiment and stock performance. It provides a framework for analyzing how sustainability indicators and public narratives can influence financial markets.

About

A project that predicts ESG indices from stock prices and news sentiment and conversely forecasts stock prices using ESG ratings and sentiment signals.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •