This project is a Python port of a MATLAB script designed to analyze dream journals. It performs text preprocessing, generates word clouds, calculates word frequencies, and performs sentiment analysis.
- Text Preprocessing: Tokenization, lemmatization, stop word removal, and filtering.
- Word Cloud: Visual representation of the most frequent words.
- Frequency Analysis: Bar chart of the top 20 words.
- Sentiment Analysis: Uses VADER to determine the emotional tone of the text.
- Python 3.x
-
Clone the repository or download the files.
-
Install the required Python packages:
pip install -r requirements.txt
Note: The script will automatically download necessary NLTK data (stopwords, wordnet, etc.) on the first run.
-
Run the script:
python dreams_analysis.py
-
The application window will open.
-
Click "Load Dream File" and select your text file (e.g.,
dreams_sample.txtor your owndreams.txt). -
Explore the tabs:
- Word Cloud: Visual representation of the most frequent words.
- Word Frequency: Bar chart of the top 20 words.
- Statistics & Sentiment: Detailed word counts and sentiment analysis scores.
dreams_analysis.py: The main Python script.requirements.txt: List of dependencies.dreams.txt: Input file containing your dream text (you need to create this).