R 错误:尝试在text2vec中应用非函数
我试图复制下面链接中给出的示例 我已经手动解压缩了文件 我在这个阶段遇到了以下错误R 错误:尝试在text2vec中应用非函数,r,text2vec,R,Text2vec,我试图复制下面链接中给出的示例 我已经手动解压缩了文件 我在这个阶段遇到了以下错误 library(text2vec) wiki = readLines("~text8", n = 1, warn = FALSE) tokens <- space_tokenizer(wiki) it = itoken(tokens, progressbar = FALSE) vocab <- create_vocabulary(it) vocab <- prune_vocabulary(vo
library(text2vec)
wiki = readLines("~text8", n = 1, warn = FALSE)
tokens <- space_tokenizer(wiki)
it = itoken(tokens, progressbar = FALSE)
vocab <- create_vocabulary(it)
vocab <- prune_vocabulary(vocab, term_count_min = 5L)
vectorizer <- vocab_vectorizer(vocab)
# use window of 5 for context words
tcm <- create_tcm(it, vectorizer, skip_grams_window = 5L)
glove = GlobalVectors$new(word_vectors_size = 50, vocabulary = vocab, x_max = 10)
glove$fit(tcm, n_iter = 20)
Error: attempt to apply non-function
库(text2vec)
wiki=readLines(“~text8”,n=1,warn=FALSE)
看起来像globe$fit
的代币不再存在-没有fit
方法可用,只有fit\u变换和transform
。不确定原因,但您可以运行globe$fit\u transform(tcm,n\u iter=20)
并按预期显示输出。可能值得与软件包所有者联系。最新的vignette/guide可在上找到。对于手套,只有一种fit_transform
方法,请参见方法部分中的?手套
,至少在当前的CRAN版本中,即0.5.1。