dazzleun-7 commited on
Commit
4717c6e
·
verified ·
1 Parent(s): f3c103d

Update ready.py

Browse files
Files changed (1) hide show
  1. ready.py +11 -0
ready.py CHANGED
@@ -118,6 +118,17 @@ train_dataloader
118
  model = torch.load('./model_weights_softmax(model).pth')
119
  model.eval()
120
 
 
 
 
 
 
 
 
 
 
 
 
121
  #gradio
122
  !pip install --upgrade gradio
123
  import numpy as np
 
118
  model = torch.load('./model_weights_softmax(model).pth')
119
  model.eval()
120
 
121
+ # 멜론 데이터 불러오기
122
+
123
+ melon_data = pd.read_csv('./melon_data.csv')
124
+ melon_emotions = pd.read_csv('./melon_emotions_final.csv')
125
+ melon_emotions = pd.merge(melon_emotions, melon_data, left_on='Title', right_on='title', how='inner')
126
+ melon_emotions = melon_emotions[['singer', 'Title', 'genre','Emotions']]
127
+ melon_emotions = melon_emotions.drop_duplicates(subset='Title', keep='first')
128
+ melon_emotions['Emotions'] = melon_emotions['Emotions'].apply(lambda x: ast.literal_eval(x))
129
+
130
+ emotions = melon_emotions['Emotions'].to_list()
131
+
132
  #gradio
133
  !pip install --upgrade gradio
134
  import numpy as np