The Sentiment-based Playlist Suggester is a Python application that analyzes the sentiment of a user-provided text or diary entry and suggests a playlist of songs based on the detected mood. It utilizes the Natural Language Toolkit (nltk) library's VADER sentiment analysis tool to determine whether the sentiment is positive, negative, or neutral.
- Enter any text or diary entry for sentiment analysis.
- Get a random selection of 5 songs based on the detected sentiment:
- Positive songs for happy moods.
- Negative songs for sad or gloomy moods.
- Neutral songs for mixed or neutral sentiments.
To run this application, you need the following:
- Python 3.x
- NLTK library (Natural Language Toolkit)
- Tkinter (for GUI)
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install required libraries: You may need to install the necessary Python libraries using pip:
pip install nltk
-
Download the VADER lexicon: The application automatically downloads the VADER lexicon on the first run using the following command:
nltk.download('vader_lexicon')
-
Run the application:
python <filename>.py
(Replace
<filename>with the name of your Python file.) -
In the GUI window, enter your text or diary entry in the provided text box.
-
Click the "Analyze and Suggest Playlist" button.
-
The application will display the detected mood and suggest a playlist of songs based on the analysis.
