🔎 Sentiment analysis from web pages or text using VADER + Portuguese lexical adaptation
This project performs sentiment analysis on textual content extracted from web pages or raw text. The system accepts a URL or text input, retrieves the content, processes it, and returns a sentiment classification.
It combines:
- Original VADER rule-based sentiment engine (optimized for social media text)
- Portuguese lexical adaptation for improved analysis in PT-BR
- Web scraping module for content extraction
- Analyze sentiment from a URL
- Analyze pasted text
- Portuguese + English support
- Rule-based NLP (fast + explainable)
- Modular architecture
- Ready for integration into pipelines or APIs
- Receives a URL or text
- Extracts textual content
- Normalizes text
- Applies lexicon rules
- Computes sentiment score
- Returns classification
Output example:
Sentiment: Positive
Score: 0.78
project/
│
├── projeto.py → main execution script
├── data_access.py → web content extraction
├── text_paste.py → manual text input
├── center.py → processing core
├── credit.py → credits module
├── lexicons/ → sentiment lexicons
├── requirements.txt
└── README.md
git clone https://github.com/eduardo-data/VADER_text_sentiment
cd VADER_text_sentiment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtpython projeto.py --url "https://example.com/article"python projeto.py --text "This news is amazing!"This project uses a lexicon + rule-based approach, not machine learning.
Advantages:
- deterministic
- explainable scores
- fast execution
- no training required
Hutto, C.J. & Gilbert, E.E. (2014). VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text. Proceedings of the 8th International AAAI Conference on Weblogs and Social Media (ICWSM-14).
Almeida, Rafael J. A. (2018). LeIA — Léxico para Inferência Adaptada
MIT License — free for academic and commercial use.
Luiz Eduardo Data & NLP Projects
Github - https://github.com/eduardo-data
Linkedin - https://www.linkedin.com/in/luizeduardodatascientist/
Pull requests are welcome. For major changes, open an issue first to discuss what you would like to change.
- API version
- Web interface
- Batch analysis
- Topic modeling integration
- Visualization dashboard
If this project helped you, consider giving it a ⭐