thai-bilstm-sentiment / utils /postprocess.py
Dusit-P's picture
Upload 11 files
284ba3b verified
raw
history blame contribute delete
160 Bytes
import torch
def get_label_from_output(output_tensor):
pred = torch.argmax(output_tensor, dim=1).item()
return "บวก" if pred == 1 else "ลบ"