问题描述
我正在尝试使用 tm 包在术语文档矩阵中查找与特定单词相关的单词.
I am attempting to find words associated with a particular word in a term document matrix using the tm package.
我正在使用 findAssocs
来做到这一点.findAssocs
的参数是:
I am using findAssocs
to do this. Arguments for findAssocs
are:
- x:术语-文档矩阵.
- term:包含一个术语的字符.
- corlimit:相关性下限的数字.
我一直得到 numeric(0)
作为我的结果
I am consistently getting numeric(0)
as my result
示例:
findAssocs(test.dtm, "investment", 0.90)
>numeric(0)
有没有人熟悉 findAssocs
并知道我做错了什么?或者有没有人更广泛地知道 numeric(0)
结果可能意味着什么?
Does anyone have familiarity with findAssocs
and know what I am doing wrong? Or does anyone know more broadly what the numeric(0)
result could mean?
非常感谢您提供任何帮助.
Thank you very much in advance for any help.
推荐答案
我得到同样的 numeric(0)
,我想是因为我的 语料库中只有一个文档
,所以文档术语矩阵
只有一列.您可能想要测试 TermDocumentMatrix()
并查看您是否有 多列矩阵
.也就是说,我如何在一个文档中找到关联?.
I'm getting the same numeric(0)
, I think it's because there is only one document in my Corpus
, so the document term matrix
only have one column. You may want to test TermDocumentMatrix()
and see if you have a multi-column matrix
.That said, how do I find association within one document?.
这篇关于来自包 tm 的 findAssocs 出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!