documents <- c("This is document number one", "document two is the second element of the vector")
我试图创建数据框是: idealdf <- c("this", "is", "document", "number", "one", "document", "two", "is", "the", "
我试图找到同时出现在多个文档中的单词。 让我们举一个例子。 doc1: "this is a document about milkyway"
doc2: "milky way is huge"
正如你可以看到上述2个文件,字“银河”是发生在两个文档但在第二文档术语“银河”是由一个空间和在第一DOC中分离它不是。 我做以下,以获得文档词矩阵R. library(tm)
tmp.text <
我正在尝试为文本挖掘目的处理xml文件的语料库。有没有办法将多个文件导入一个xml对象/数据库,以后可以使用XPath? 这是一个聪明的事情吗?我发现了一个类似的报告,即将XML文件导入到其他数据格式(如数据框或tm语料库对象Parsing multiple xml files to a Single Dateframe in R)中,但将它们保留为XML格式应使它们保持整洁,保持对上下文的访问,
NLTK提供打印Brown(或Gutenberg)语料库中所有单词的功能。但是等效函数在Wordnet上似乎不起作用。 有没有办法通过NLTK来做到这一点?如果没有,那么会怎么做呢? 这工作: from nltk.corpus import brown as b
print b.words()
这将导致一个AttributeError: from nltk.corpus import wor