AdvancedAI & Machine LearningPython
Run this module
Sentiment Analysis on News Utility (NO API)¶
This utility does NOT use any external APIs. All sentiment analysis is done locally using a simple rule-based approach for learning and experimentation.
This tool lets you analyze the sentiment of news headlines or short texts using a basic positive/negative word list. You can enter headlines, see the sentiment score, and view a summary of results.
Features¶
- Analyze sentiment of news headlines or short texts
- Uses a simple rule-based approach (positive/negative word lists)
- View sentiment score and summary (positive, negative, neutral)
- CLI interface (Python script)
- Beginner-friendly: All code is commented for learning
Requirements¶
- Python 3.7+
- No external libraries required (uses only Python standard library)
Setup¶
- Copy
sentiment_analysis.pyto your desired folder. - Open a terminal in that folder.
Usage Workflow (Step-by-Step)¶
- Run the script:
- Follow the menu prompts:
- Enter news headlines or short texts
- View sentiment score and summary
- Analyze multiple headlines in a session
- Exit when done.
No real market data or ML models are used. This is for learning only!
Example Session¶
Welcome to the Sentiment Analysis on News Utility!
1. Analyze headline
2. View session summary
3. Exit
Enter your choice: 1
Enter headline: Apple stock surges after strong earnings
Sentiment: Positive (Score: 2)
Learning Notes¶
- No API: All analysis is managed in Python, so you can see and modify the logic yourself.
- How does it work? The code uses simple word lists to score sentiment, with comments explaining each step.
- How can you extend it? Try adding more words, or using a more advanced ML model!
License¶
MIT
Continue in AI & Machine Learning¶
-
Command-line chatbots for Google's Gemini API, implemented in both Python and Node.js. This module demonstrates how to integrate a hosted large language model into a simple interactive application.
-
An all-in-one learning hub that delivers progressive Python lessons through both a guided CLI and a hostable Flask web interface. Lessons combine narrative walkthroughs, executable code examples, mini quizzes, and follow-up practice ideas geared toward aspiring quantitative developers.
-
Machine Learning - Feature Engineering
The dirty secret of quant machine learning: the model is rarely the bottleneck.
-
Machine Learning - Gradient Descent
Gradient descent is the engine inside almost every model that learns. The idea
-
Machine Learning - K-Means Clustering
Given a few hundred stocks and their return characteristics, which ones behave
-
Machine Learning - Logistic Regression
Linear regression predicts a number. Logistic regression predicts a