A versatile Python application that creates beautiful word cloud visualizations from text data. This tool offers multiple input methods and advanced phrase analysis capabilities, making it perfect for text analysis, content visualization, and data exploration.
- 📝 Text Input Mode: Generate word clouds directly from text entered via command line
- 📁 File Upload Mode: Process text files to create visualizations
- 🔤 N-gram Analysis: Create word clouds from multi-word phrases (bigrams, trigrams, etc.)
- 🎨 Interactive GUI: User-friendly interface with themed styling for phrase selection
- 🧹 Smart Text Processing: Automatic removal of stopwords and punctuation
- 💾 Export Capability: Save generated word clouds as PNG images
- Python 3.7 or higher
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/anupam9919/Word-Cloud-Generator.git cd Word-Cloud-Generator -
Install required dependencies:
pip install -r requirements.txt
-
Download NLTK stopwords (required for text processing):
python -c "import nltk; nltk.download('stopwords')"
The project includes three different scripts for different use cases:
Generate a word cloud from direct text input:
python input_as_text.py- Enter your text when prompted
- The script will clean the text, remove stopwords, and display the word cloud
- Text is automatically saved to
input.txt
Create a word cloud from a text file:
python input_as_file_upload.py- A file dialog will open for you to select a
.txtfile - The word cloud will be generated and displayed automatically
Generate word clouds with n-gram analysis:
python input_phrase_select.py- Select a text file when prompted
- Choose phrase length from the dropdown:
- Bigram (2): Pairs of consecutive words
- Trigram (3): Three consecutive words
- Four-gram (4): Four consecutive words
- Five-gram (5): Five consecutive words
- Click "Generate Word Cloud" to create the visualization
- Input Acquisition: Text from user input, file, or file dialog
- Cleaning: Removal of punctuation and special characters
- Normalization: Conversion to lowercase
- Filtering: Removal of English stopwords using NLTK
- Frequency Analysis: Word/phrase counting
- Visualization: Word cloud generation using matplotlib
- wordcloud: Core word cloud generation
- matplotlib: Visualization and display
- nltk: Natural language processing and stopwords
- tkinter: GUI components (included with Python)
- ttkthemes: Enhanced GUI styling
See requirements.txt for complete dependency list.
word_cloud/
├── input_as_text.py # CLI text input mode
├── input_as_file_upload.py # File upload mode
├── input_phrase_select.py # N-gram analysis with GUI
├── requirements.txt # Python dependencies
├── sample.txt # Sample text file for testing
├── input.txt # Auto-generated from text input
├── README.md # This file
└── LICENSE # MIT License
- Content Analysis: Visualize key themes in documents, articles, or reports
- Social Media Analytics: Analyze trending topics from text data
- Academic Research: Identify frequent terms in research papers or surveys
- Creative Projects: Generate artistic word-based visualizations
- SEO & Marketing: Analyze keyword frequency in content
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with wordcloud library
- Uses NLTK for natural language processing
- Themed GUI powered by ttkthemes
For questions or feedback, please open an issue on GitHub.
Made with ❤️ for text visualization enthusiasts