Format of the input dataset for Google AutoML Natural Language multi-label text classification

大憨熊 提交于 2019-12-06 04:39:31

It was very confusing at first but later I managed to find the format in the documentation, which is a CSV file like:

text1, label1, label2 text2, label2 text3, label3, label2, label1

The parser doesn't understand a table with NULL cells saved as a standard CSV file, which is like:

text1, label1, label2, text2, label2,, text3, label3, label2, label1

I had to manually remove extra commas from the CSV file generated by Pandas.

Google AutoML has updated their parser. The following format is fine:

text1, label1, label2, label3,
text1, label1, label2, ,
text1, label1, label2, , ,

At least that worked for me on 27th Jan 2019

One column per label is the way to go. If you have less than 1000 labels, you probably have a mistake in your CSV file, where the parser is getting confused and thinks some of the tokens in the text of the example are labels. Please make sure that your text is correctly escaped with quotes around.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!