An experimental sentiment analysis project designed to provide enhanced granularity and accuracy compared to existing libraries like VADER and TextBlob.
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.
- 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
- Python: 3.11 or higher
- Dependencies: See
pyproject.tomlfor complete list
pandas- Data manipulation and analysisnumpy- Numerical computingscikit-learn- Machine learning algorithmsmatplotlib- Data visualizationseaborn- Statistical data visualizationscipy- Scientific computingoptuna- Hyperparameter optimization (optional)
- Ensure you have Python 3.11+ installed
- Clone this repository
- 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 optunaThe 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",
]- Prepare your dataset: Place your CSV dataset in the project root directory
- Configure data loading: Update the data loading section in
main.pyto reference your dataset - Adjust parameters: Modify analysis parameters as needed for your specific use case
- Run analysis: Execute the main script
python main.pyExplore and understand your dataset using the included analysis tools:
python data_exploration_clustering.pyThis script provides:
- Clustering analysis
- Feature visualization
- Data distribution insights
- Correlation analysis
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
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
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
This project is licensed under the MIT License - see below for details.
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.
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.