Spaces:
Sleeping
Sleeping
Commit
路
edb462b
1
Parent(s):
40553d3
Update Recomendation.py
Browse files- Recomendation.py +2 -2
Recomendation.py
CHANGED
@@ -6,7 +6,7 @@ import json
|
|
6 |
import gradio as gr
|
7 |
from gradio.components import Textbox
|
8 |
from ast import literal_eval
|
9 |
-
spotify_data_processed = pd.read_csv('
|
10 |
|
11 |
def convert_string_to_array(str_vector):
|
12 |
# Si str_vector ya es un array de NumPy, devolverlo directamente
|
@@ -78,7 +78,7 @@ def recommend_song_interface(song_name, artist_name):
|
|
78 |
else:
|
79 |
random_song = spotify_data_processed.sample() # Escoge una linea la azar de todo el conjunto de datos .sample()
|
80 |
random_song_name = random_song['song'].iloc[0] # Extrae el valor de la columna song de la fila sample (Nombre)
|
81 |
-
random_artist_name = random_song['artist'].iloc[0] # Extrae el valor de la columna artist de la fila sample (
|
82 |
|
83 |
# Obtener recomendaciones para la canci贸n aleatoria
|
84 |
random_recommendations_df = recommend_song(random_song_name, random_artist_name, spotify_data_processed)
|
|
|
6 |
import gradio as gr
|
7 |
from gradio.components import Textbox
|
8 |
from ast import literal_eval
|
9 |
+
spotify_data_processed = pd.read_csv('dataset_modificado.csv')
|
10 |
|
11 |
def convert_string_to_array(str_vector):
|
12 |
# Si str_vector ya es un array de NumPy, devolverlo directamente
|
|
|
78 |
else:
|
79 |
random_song = spotify_data_processed.sample() # Escoge una linea la azar de todo el conjunto de datos .sample()
|
80 |
random_song_name = random_song['song'].iloc[0] # Extrae el valor de la columna song de la fila sample (Nombre)
|
81 |
+
random_artist_name = random_song['artist'].iloc[0] # Extrae el valor de la columna artist de la fila sample (Artista)
|
82 |
|
83 |
# Obtener recomendaciones para la canci贸n aleatoria
|
84 |
random_recommendations_df = recommend_song(random_song_name, random_artist_name, spotify_data_processed)
|