gaepago_model / utils /postprocess.py
khan123's picture
add text mapping process
327e3b5
raw
history blame
239 Bytes
import random
def text_mapping(model_output,text_label):
text_list = text_label[model_output]
text,sent = random.sample(text_list,1)[0]
return {'label' : model_output,
'text' : text,
'sentiment' : sent}