我正在尝试根据情感对文本进行分类。不幸的是,我不知道如何正确地使分类器预测任何字符串
global music
def music(layout, list, xs, ys, xp, yp):
layout.buttons=[]
for song in list:
button=Button(text=song, size_hint=(xs, ys), pos_hint={'x':xp, 'y':yp})
button.bind(on_press=play)
layout.buttons.append(button)
layout.add_widget(button)
global play
def play(button):
song = (button.text)
try:
songp.stop()
print('stop')
except:
pass
finally:
path = (str(os.getcwd()) + '/Music/' + song + '.mp3')
songp = SoundLoader.load(str(path))
songp.play()
每个预测结果都为0,与字符串无关
我得到的全部是。 Yelp数据的准确性:0.7960 亚马逊数据的准确性:0.7960 imdb数据的准确性:0.7487 [0]
我对这个:D很新