2

我正在尝试复制以下链接中给出的示例

https://cran.r-project.org/web/packages/text2vec/vignettes/glove.html

我已经手动解压缩了文件。

我在这个阶段收到以下错误

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

任何帮助都会很棒。

4

0 回答 0