【发布时间】:2017-04-12 04:43:40
【问题描述】:
我有一个包含两列的 CSV 文件,'sentence' 是句子的字符串,emoID 是 1-7 整数,如下所示:
sentence emoID
During the period of falling in love. 1
When I was involved in a traffic accident. 2
..... ...
我需要将每个句子分类到其对应的 emoID。我看到了一个分类两个类的例子,如下所示:
# Generate labels
positive_labels = [[0, 1] for _ in positive_examples]
negative_labels = [[1, 0] for _ in negative_examples]
现在我有 7 个类而不是两个,如何为每个类生成 7 个标签?我是python的初学者,非常感谢您的帮助!
【问题讨论】:
标签: python python-3.x conv-neural-network text-classification