license: apache-2.0
title: English Music Recommender
sdk: streamlit
emoji: 🐨
colorFrom: green
colorTo: green
English Music Recommender
About
This project aims to create a music recommendation application for non-native English speakers who intend to learn English through the lyrics of English songs. Music is one of the most entertaining and practical approaches to learning a language. People can learn new words and expressions by listening to and singing the lyrics. However, different artists vary in their songwriting choices of words and expressions, which may lead to a difference in the difficulties of comprehending the lyrics for English learners. OpenAI is one of the most useful tools when it comes to recommending people. Therefore, we are creating an application to combine OpenAI with our intention to recommend suitable songs for different levels of learners. On top of that, OpenAI will serve as an English teacher to answer users’ questions regarding the use of English words in the lyrics.
File Name (with folder name) | Description |
---|---|
data.json | The song data from spotify and genius lyrics |
app_function.py | OpenAI API implementation |
choosingdata.py | Filter the dataframe based on user's preference |
app.py | Display user interface |
README.md | The instructions for running the code |
requirement.txt | Contains a list of packages or libraries needed to work |
How To Play
- Go to
https://huggingface.co/spaces/si568project2/English_Music_Recommender
- Pick your preferences for the music on the left side
- Click the
Submit
button - The recommendation will show on the same page
- Go to the right side of the page and interact with OpenAI about the song from choosing one of the prompt or typing in your own
Used Third-Party Python Packages
BeautifulSoup
requests
OpenAI
streamlit
langchain
Data Structure
As below screenshot shows, the original data retrieved from the APIs is constructed in a DataFrame structure.
In the choosingdata.py
file, the data is filtered based on the user's preference:
- Danceability
- Valence
- Difficulty (speechiness, fres, vocabComplex, sentenceLength) - Binned into quantiles to rank the difficulty
According to the user's preference, we will be filtering out a list of songs that match their choice. After filtering the dataframe, it will generate and print a random song from the corresponding dataframe. User will then be able to ask question about the song or regenerate for another song.