File size: 436 Bytes
4a584a3
 
 
 
203db02
4a584a3
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from gensim.models import Word2Vec
import pandas as pd


spotify_data= pd.read_csv('spotify_data_processed.csv')




# Asumiendo que spotify_data['cleaned_text'] contiene listas de palabras (tokens)
spotify_data['cleaned_text'] = spotify_data['cleaned_text'].apply(eval)

model = Word2Vec(sentences=spotify_data['cleaned_text'], vector_size=100, window=10, min_count=1, workers=5)
# Guardar el modelo
model.save("word2vec_model.model")