【发布时间】:2022-01-03 05:19:41
【问题描述】:
Dialog_act 是我的标签
我需要分配 int 值,例如 (inform_pricerange=1, inform_area=2, request_food=3, inform_food=4...) 目标是如下所示:
1,2
1,2,3
4
5,2,4
6
CSV(5 行):
"transcript_id who transcript dialog_act
0 USR I need to find an expensive restauant that's in the south section of the city. inform_pricerange; inform_area;
1 SYS There are several restaurants in the south part of town that serve expensive food. Do you have a cuisine preference? inform_pricerange; inform_area; request_food;
2 USR No I don't care about the type of cuisine. inform_food;
3 SYS Chiquito Restaurant Bar is a Mexican restaurant located in the south part of town. inform_name; inform_area; inform_food;
4 USR What is their address? request_address;
5 SYS There address is 2G Cambridge Leisure Park Cherry Hinton Road Cherry Hinton, it there anything else I can help you with? inform_address;"
我该怎么做?
感谢您的建议
【问题讨论】:
-
你能贴出重现数据框的代码吗,as opposed to an image of text?
-
数据帧来自一个csv文件,就像那样
-
请将您的图片替换为纯文本数据。
-
但它只是“df_full = pd.read_csv(csvFile)”
-
复制/粘贴文件内容(前五行)