0% found this document useful (0 votes)
61 views5 pages

SoundSphere PDF

The Music Recommendation System utilizes machine learning and data from Spotify to provide personalized song suggestions to users. It allows users to input songs they like and receives recommendations. The interface would typically include sections for users to provide input and view recommendations, explore recommended content, and provide feedback to improve recommendations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views5 pages

SoundSphere PDF

The Music Recommendation System utilizes machine learning and data from Spotify to provide personalized song suggestions to users. It allows users to input songs they like and receives recommendations. The interface would typically include sections for users to provide input and view recommendations, explore recommended content, and provide feedback to improve recommendations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

NAAN MUDHALVAN

NEURAL NETWORK AND DEEP


LEARNING

SOUNDSPHERE - SONG
RECOMMENDATION SYSTEM

TEAM MEMBERS:

Anusha Narayani R

Nithyasri P

Sandhiya M

Sneha M
SOUNDSPHERE – A SONG RECOMMENDATION SYSTEM

Overview

The Python-based Music Recommendation System utilizes data analysis and machine learning
techniques, leveraging Spotify's API for data collection. It gathers track details, audio features, and
user interactions to build a recommendation model. This model employs content-based and
collaborative filtering methods for personalized suggestions based on user behavior and song
characteristics. Streamlit is used for creating an interactive web app interface, allowing users to
input their favorite songs and receive tailored recommendations. The system continuously refines
recommendations through user feedback, integrates with external APIs for extensive music data,
and ensures scalability and performance optimization for a seamless experience.

Source code

import pickle

import streamlit as st

import spotipy

from spotipy.oauth2 import SpotifyClientCredentials

CLIENT_ID = "70a9fb89662f4dac8d07321b259eaad7"

CLIENT_SECRET = "4d6710460d764fbbb8d8753dc094d131"

# Initialize the Spotify client

client_credentials_manager = SpotifyClientCredentials(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET)

sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)

def get_song_info(song_name, artist_name):

search_query = f"track:{song_name} artist:{artist_name}"

results = sp.search(q=search_query, type="track")

if results and results["tracks"]["items"]:

track = results["tracks"]["items"][0]

song_url = track["external_urls"]["spotify"]

album_cover_url = track["album"]["images"][0]["url"]

return song_url, album_cover_url

else:

return None, "https://i.postimg.cc/0QNxYz4V/social.png"


def recommend(song):

index = music[music['song'] == song].index[0]

distances = sorted(list(enumerate(similarity[index])), reverse=True, key=lambda x: x[1])

recommended_music_info = []

for i in distances[1:6]:

artist = music.iloc[i[0]].artist

song_name = music.iloc[i[0]].song

song_url, album_cover_url = get_song_info(song_name, artist)

recommended_music_info.append((song_name, song_url, album_cover_url))

return recommended_music_info

st.header('Sound Sphere')

music = pickle.load(open('df.pkl','rb'))

similarity = pickle.load(open('similarity.pkl','rb'))

music_list = music['song'].values

selected_song = st.selectbox(

"Type or select a song from the dropdown",

music_list

if st.button('Show Recommendation'):

recommended_music_info = recommend(selected_song)

num_cols = 4

num_rows = -(-len(recommended_music_info) // num_cols) # Ceiling division to calculate the


number of rows

for i in range(num_rows):

row_data = recommended_music_info[i * num_cols: (i + 1) * num_cols]

cols = st.columns(num_cols)

for col, (song_name, song_url, album_cover_url) in zip(cols, row_data):

with col:
st.text(song_name)

st.image(album_cover_url)

st.write(f"[Listen on Spotify]({song_url})")

Output

The following results were obtained


Interface

The interface of the Music Recommendation System built with Streamlit library would typically
include several key components:

1. Input Section : This section allows users to input their preferences, such as their favorite songs,
artists, genres, or moods. Users can also upload playlists or select from a list of popular tracks.

2. Recommendation Display : After inputting their preferences, users receive personalized


recommendations displayed in this section. These recommendations can include related songs,
artists, albums, playlists, or curated music based on the user's input.

3. Explore and Discover : Users can explore recommended content further, such as clicking on
recommended songs to listen to previews or full tracks, viewing artist profiles, exploring similar
genres or moods, and discovering new music based on their tastes.

4. Feedback and Ratings : The interface includes options for users to provide feedback, ratings,
likes, dislikes, and comments on recommended content. This feedback loop is crucial for improving
the recommendation model and enhancing future recommendations.

5. Settings and Customization : Users may have options to customize their recommendations
further, such as adjusting preferences, setting filters, saving favorite content, creating playlists, or
syncing with external music platforms like Spotify.

6. User Profile and History : For registered users, the interface may include a user profile section
displaying their listening history, saved preferences, previously liked or disliked content, and
recommendations tailored to their historical interactions.

7. Visualizations and Insights : Depending on the design, the interface may incorporate
visualizations and insights, such as charts or graphs showing music trends, popular genres,
user demographics, or the impact of user feedback on recommendations.

8. Help and Support : A help or support section provides resources, FAQs, and contact options for
users who need assistance or have questions about using the recommendation system.

Conclusion

In conclusion, the Music Recommendation System, with its intuitive interface powered by Streamlit
library, offers users a personalized and engaging music discovery experience. By leveraging data
analysis, machine learning techniques, and Spotify's API, it provides tailored recommendations
based on user preferences and behavior. The continuous feedback loop and integration with
external APIs ensure the system's accuracy, relevance, and scalability over time. Overall, the system
enhances music exploration, encourages user interaction, and promotes a seamless and enjoyable
journey in discovering new music.

You might also like