DreamScribe is an interactive AI project that captures spoken dream input, analyzes emotions using NLP, calculates surrealism scores, and visualizes data through Python Turtle and R analytics.
- Speech-to-Text: Captures your voice using SpeechRecognition
- Emotion Analysis: Extracts Happy, Sad, Angry, Fear, and Surprise scores via text2emotion
- SER (Speech Emotion Recognition): Analyzes vocal tone using librosa
- Generative Art: Visualizes your dream mood using Python Turtle
- R Analytics: Generates professional emotion trends and surrealism histograms
- Fork this repository to your own GitHub account
- Open your terminal (Git Bash or PowerShell) and clone it:
git clone https://github.com/your-username/DreamScribe.git
cd DreamScribeCreate a virtual environment to keep your dependencies clean and avoid path conflicts:
Windows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1Windows (Git Bash):
python -m venv .venv
source .venv/Scripts/activateInstall all required libraries, including the specific fixes for Python 3.13 (legacy-cgi) and text2emotion (emoji==1.7.0):
pip install -r requirements.txtRun this one-liner to download the necessary NLTK datasets for emotion analysis:
python -c "import nltk; nltk.download('punkt'); nltk.download('wordnet')"Run the main Python script. When prompted, speak clearly into your microphone for 7 seconds:
python main.py- The script will log your data to
dream_diary.csv - Your dream art will be drawn with Turtle
Once you have logged dreams, run the R script to generate your trend charts.
Using Git Bash:
/c/Program\ Files/R/R-4.4.x/bin/Rscript.exe R_analysis.R(Replace R-4.4.x with your actual version, e.g., R-4.4.2)
Using PowerShell:
& "C:\Program Files\R\R-4.4.x\bin\Rscript.exe" R_analysis.R(Replace R-4.4.x with your actual version, e.g., R-4.4.2)
Open the generated files in your project folder to see your data:
avg_emotion_plot.png- Bar chart of average emotionssurrealism_hist.png- Histogram of dream wildnessRplots.pdf- Combined analysis report
| Issue | Solution |
|---|---|
| ModuleNotFoundError: 'cgi' | This project uses legacy-cgi to remain compatible with Python 3.13 |
| AttributeError: 'UNICODE_EMOJI' | This is fixed by using emoji==1.7.0. Do not upgrade the emoji library |
| Rscript not recognized | Ensure you are using the full path to your R installation as shown in the run steps above |