如何使用Weka创建词袋?
我有一个文档语料库,我想将每个文档表示为一个向量。基本上,对于文档中存在的单词,向量的值为 1,而对于其他单词(存在于语料库中的其他文档中,而不是这个特定文档中的单词),向量的值为 0。我如何为所有单词创建这个向量Weka 中的文档?
有没有一种快速的方法可以使用 Weka 来做到这一点?我还希望 Weka 在创建这个向量之前删除停用词以及如果可能的话进行一些预处理。
谢谢 阿布舍克小号
I have a corpus of documents and I want to represent each document as a vector. Basically, the vector would have 1 for words that are present inside a document and for other words (which are present in other documents in the corpus and not in this particular document) it would have a 0. How do I create this vector for all the documents in Weka?
Is there a quick way to do this using Weka? I also want Weka to remove stopwords and so some pre-processing if possible before it creates this vector.
Thanks
Abhishek S
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要 StringToWordVector 过滤器。
它具有二进制出现和停止的选项,以及许多其他选项,例如词干、截断单词列表、丢弃不常见的术语、大小写折叠。
You want the StringToWordVector filter.
It has options for binary occurrence and stopping, amongst many others, such as stemming, truncating the word list, discarding infrequent terms, case folding.