如何在weka中表示用于分类的文本?
您能告诉我如何在 weka 中表示文本分类的属性或类吗?我可以使用什么属性进行分类?词频还是仅词? ARFF 格式的可能结构是什么?你能给我几行该结构的例子吗?
预先非常感谢您。
Can you please let me know how to represent attribute or class for text classification in weka. By using what attribute can I do classification? word frequency or just word? What would be possible structure of ARFF format? Can you give me several lines of example of that structure?
Thank you very much in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的替代方案之一是从 ARFF 文件开始解决两类问题,例如:
文本表示为 String 类型,类是具有两个值的标称。
然后,您可以应用两个过滤器:
您可以在此 Weka wiki 页面中找到更多信息和其他转换数据的方法:
http://weka.wikispaces.com/Text+categorization+with+WEKA
One of the easiest alternatives is to start with an ARFF file for a two class problem like:
The text is represented as a String type and the class is a nominal with two values.
Then you could apply two filters:
You may find more info and other approaches to transform your data in this Weka wiki page:
http://weka.wikispaces.com/Text+categorization+with+WEKA
在weka中,你可以选择自己的属性。在此示例中,我们只有 2 个类,所有唯一单词都用作属性。如果您选择词频作为属性,则如果该词在文本中出现两次,则分配“2”;如果没有出现,则分配“0”;如果该词只出现一次,则分配“1”。
以下是 .arff 格式示例。
In weka, you can choose your own attribute. In this example, we only have 2 classes and all of the unique words are used as attributes. If you choose word frequency as your attribute, then you assign '2' if that word occurs twice in your text, and '0' if not, or '1' if that word occurs only once.
Here is the example .arff format.