A comprehensive web application for exploring Natural Language Processing concepts through interactive demos and real-time text analysis.
- Direct text input with analysis button
- File upload support (TXT, PDF, DOCX)
- Real-time text preview and statistics
- Interactive word tokenization with color-coded highlighting
- Lemmatization visualization with original vs. lemmatized forms
- Token statistics and analysis
- Entity highlighting with different colors for each type
- Support for PERSON, ORG, GPE, DATE, TIME, MONEY, and more
- Interactive entity distribution charts
- Detailed entity explanations
- Complete POS tagging with descriptions
- Color-coded text highlighting by grammatical role
- POS distribution visualization
- Interactive tooltips with explanations
- Dependency relations analysis
- Visual representation of grammatical dependencies
- Detailed dependency type explanations
- Real-time sentiment scoring with interactive gauges
- Polarity and subjectivity measurements
- Sentence-by-sentence sentiment breakdown
- Sentiment trend visualization across text
- Top word frequency charts
- Word cloud data tables
- Statistical text analysis
- Python 3.7 or higher
- pip package manager
-
Clone the repository
git clone https://github.com/saifDoesCode/NLP-Playground.git cd nlp-playground -
Install required packages
pip install streamlit spacy textblob nltk pandas plotly python-docx PyPDF2
-
Download spaCy English model
python -m spacy download en_core_web_sm
-
Download NLTK data (optional - handled automatically)
python -c " import nltk nltk.download('punkt_tab') nltk.download('punkt') nltk.download('wordnet') nltk.download('averaged_perceptron_tagger') nltk.download('stopwords') nltk.download('omw-1.4') "
streamlit run app.pyThe application will open in your browser at http://localhost:8501
- Input Text: Enter text directly or upload a file (TXT, PDF, DOCX)
- Click Analyze: Press the "π Analyze Text" button to process
- Explore Results: Scroll through different analysis sections:
- Text Statistics
- Tokenization & Lemmatization
- Named Entity Recognition
- POS Tagging
- Dependency Parsing
- Sentiment Analysis
- Word Frequency Analysis
streamlit>=1.28.0
spacy>=3.4.0
textblob>=0.17.0
nltk>=3.7
pandas>=1.5.0
plotly>=5.0.0
python-docx>=0.8.11
PyPDF2>=3.0.0
nlp-playground/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ assets/ # Screenshots and demo files
βββ demo.png
The application automatically handles:
- NLTK data downloads with fallback mechanisms
- spaCy model loading with error handling
- File processing for multiple formats
- Robust error handling for missing dependencies
- Tokenization: Color-coded word and sentence breakdown
- NER: Entity highlighting with type classifications
- POS Tagging: Grammatical role visualization
- Sentiment: Real-time emotion analysis with gauges
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone https://github.com/saifDoesCode/NLP-Playground.git
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install development dependencies
pip install black flake8 pytestThis tool is perfect for:
- Students learning NLP concepts
- Educators demonstrating text processing techniques
- Researchers exploring text analysis methods
- Developers prototyping NLP features
spaCy model not found:
python -m spacy download en_core_web_smNLTK data missing: The app automatically downloads required NLTK data, but you can manually install:
python -c "import nltk; nltk.download('all')"File upload errors:
- Ensure files are in supported formats (TXT, PDF, DOCX)
- Check file size limits (Streamlit default: 200MB)
This project is licensed under the MIT License - see the LICENSE file for details.
- spaCy - Industrial-strength NLP library
- NLTK - Natural Language Toolkit
- TextBlob - Simplified text processing
- Streamlit - Web app framework
- Plotly - Interactive visualizations
β If you find this project helpful, please give it a star!
Built with β€οΈ using Python, Streamlit, and modern NLP libraries.
