train, test = data.TabularDataset.splits(path="./data/", train="train.csv",test="test.csv",format="csv",fields=[("Tweet",TEXT), ("Affect Dimension",LABEL)])
我有这个代码,并希望评估,如果加载的数据是正确的,或者如果它使用的实际文本字段等错误的列
如果我的文件中有“Tweet”列作为文本,而“Affect Dimension”列作为类名,那么将它们放在fields部分是否正确?你知道吗
编辑:tablerdataset包含一个示例对象,可以在其中读取数据。读取csv文件时,仅接受“,”作为分隔符。其他一切都会导致数据损坏。你知道吗
您可以输入任何字段名,而不管您的文件有什么。另外,我建议不要在字段名中使用空格。你知道吗
所以,把
Affect Dimension
重命名为Affect_Dimension
或者任何对你方便的东西。你知道吗然后您可以像下面这样遍历不同的字段来检查读取的数据。你知道吗
相关问题 更多 >
编程相关推荐