如何使用Weka创建词袋?

发布于 2024-12-09 03:30:05 字数 218 浏览 3 评论 0原文

我有一个文档语料库,我想将每个文档表示为一个向量。基本上,对于文档中存在的单词,向量的值为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南笙 2024-12-16 03:30:05

您需要 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文