Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lets build an application that searches for our favorite musical artis and suggests songs in a certain order. Download the Spotify dataset https://goo.gl/KAYTuf

Let’s build an application that searches for our favorite musical artis and suggests songs in a certain order.
• Download the Spotify dataset https://goo.gl/KAYTuf
• Write a program that contain two parts:
o Part A: The first part of program should do the following
▪ Step 1: Load in the data. In your code, you can assume the filename is “spotify.csv.” The following are some of the data in this file and their meaning1
• Acousticness: A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic. The higher the value the more acoustic the song is.
• Danceability - Describes how suitable a track is for dancing based on a
combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable. The higher the value, the easier it is to dance to this song.
• Duration - The length of the song.
• Energy - Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy - the higher the value, the more energetic.
• Instrumentalness: Predicts whether a track contains no vocals. “Ooh” and “aah” sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly “vocal.” The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental tracks, but confidence is higher as the value approaches 1.0.
• Liveness: Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live.
• Loudness - The higher the value, the louder the song.
• Speechiness: Speechiness detects the presence of spoken words in a track.
The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like tracks.
• Tempo: The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration.
• Valence - A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry). The higher the value, the more positive mood for the song.
▪ Step 2: Ask the user the artist they want to select
▪ Step 3: Display all the songs by this artist and report the records. Each record in your list should be a list or tuple, containing the values for artist, song name,
danceability, energy, and valence.
▪ Step 4: Summarize the work by this artist by calculating the mean, maximum and minimum value for danceability, energy, tempo, and valence in all the songs by this artist. Do not use built-in function to perform this task, write your own algorithm.
o Part B: The second part of the program
▪ This part of the exercise will let you mix your chatbots skills with your new-found
sorting knowledge. Your bot should find the user a great song, e.g. starts with the same letter as their name, a slow jam, a happy song, workout tracks. Behind the scenes, your bot should sort the data in the spotify.csv file using a value of your choice (danceability, tempo, valence (positivity), artist name, etc.) and implement a search algorithm to suggest a song or playlist that makes sense.
• In the main program, you should
o include examples that show the operation of the function.
o use the time module to output the time it takes to run your program (in seconds, to 3 decimal places using the string format function).

Step by Step Solution

3.58 Rating (166 Votes )

There are 3 Steps involved in it

Step: 1

Building a ContentBased Recommender System from spotipyoauth2 import SpotifyClientCredentials from collections import defaultdict sp spotipySpotifyauthmanagerSpotifyClientCredentialsclientidosenvironS... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming the World Wide Web

Authors: Robert W. Sebesta

8th edition

133775984, 9780133776096 , 978-0133775983

More Books

Students also viewed these Programming questions

Question

Evaluate the integral, if it exists. Jo y(y + 1) dy

Answered: 1 week ago

Question

What attribute is required in all anchor tags?

Answered: 1 week ago