Skip to content

laura-ideajunkies/MachineLearningSentimentAnalysis

Repository files navigation

Media Coverage Sentiment Analysis

An experimental sentiment analysis project designed to provide enhanced granularity and accuracy compared to existing libraries like VADER and TextBlob.

Overview

This project develops advanced machine learning algorithms for sentiment analysis with a focus on better capturing emotions and sentiments in text data. The system combines numerical features with text data to achieve more accurate sentiment classification than traditional approaches.

Features

  • Enhanced Granularity: More nuanced sentiment detection beyond basic positive/negative/neutral classification
  • Advanced ML Techniques: Utilizes modern machine learning algorithms for improved accuracy
  • Comprehensive Dataset Processing: Handles extensive datasets for training and evaluation
  • Hybrid Feature Engineering: Combines numerical and textual features for robust sentiment classification
  • Hyperparameter Optimization: Optional integration with Optuna for model tuning
  • Data Visualization: Built-in clustering and exploratory data analysis capabilities

Requirements

  • Python: 3.11 or higher
  • Dependencies: See pyproject.toml for complete list

Core Dependencies

  • pandas - Data manipulation and analysis
  • numpy - Numerical computing
  • scikit-learn - Machine learning algorithms
  • matplotlib - Data visualization
  • seaborn - Statistical data visualization
  • scipy - Scientific computing
  • optuna - Hyperparameter optimization (optional)

Installation

  1. Ensure you have Python 3.11+ installed
  2. Clone this repository
  3. Install dependencies using your preferred method:
# Using pip with pyproject.toml
pip install -e .

# Or install dependencies manually
pip install pandas numpy scikit-learn matplotlib seaborn scipy optuna

Project Configuration

The project uses a pyproject.toml file for dependency management:

[project]
name = "Media Coverage Sentiment Analysis"
version = "0.1.0"
description = "Sentiment analysis with enhanced granularity for media coverage analysis"
authors = ["Your Name <you@example.com>"]
requires-python = ">=3.11"
dependencies = [
    "matplotlib>=3.10.0",
    "numpy>=2.2.1",
    "optuna>=4.1.0",
    "pandas>=2.2.3",
    "scikit-learn>=1.6.0",
    "scipy>=1.14.1",
    "seaborn>=0.13.2",
]

Usage

Basic Usage

  1. Prepare your dataset: Place your CSV dataset in the project root directory
  2. Configure data loading: Update the data loading section in main.py to reference your dataset
  3. Adjust parameters: Modify analysis parameters as needed for your specific use case
  4. Run analysis: Execute the main script
python main.py

Data Exploration

Explore and understand your dataset using the included analysis tools:

python data_exploration_clustering.py

This script provides:

  • Clustering analysis
  • Feature visualization
  • Data distribution insights
  • Correlation analysis

Expected Output

The sentiment analysis will generate:

  • Console output with analysis results
  • Confusion matrices for model evaluation
  • Classification reports with precision, recall, and F1-scores
  • Visualization plots for data insights

Project Structure

Media_Coverage_Sentiment_Analysis/
├── main.py                           # Main analysis script
├── data_exploration_clustering.py    # Data exploration utilities
├── pyproject.toml                    # Project configuration
├── README.md                         # Project documentation
└── [your_dataset].csv               # Input data files

Contributing

This is an experimental project and contributions are welcome! Areas for improvement include:

  • Algorithm enhancement and optimization
  • Additional feature engineering techniques
  • Performance benchmarking against other sentiment analysis tools
  • Documentation and code quality improvements

License

This project is licensed under the MIT License - see below for details.

MIT License

MIT License

Copyright (c) 2025 Idea Junkies LTD

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Disclaimer

This is an experimental project under active development. Results and methodologies may change as the project evolves. Use in production environments is not recommended without thorough testing and validation.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors