对于一个项目,我使用R包wordVectors和函数
see an example here
我的第一个问题:
此函数需要一个train_文件,它是一个.txt文件(在您的计算机上)。现在,您必须将此文件存储在计算机的特定目录中。但是我的R环境中也有这个文件(在data.frame中,在名为:text(df$text)的列中)。
我想避免读取.txt文件,而是对文本使用R data.frame。有解决办法吗?
我的第二个问题:
代码:
library(devtools)
install_github("mukul13/rword2vec")
library(rword2vec)
model=word2vec(train_file = "text8",output_file = "vec.bin",binary=1)
# Instead of "text8" I want to insert a data.frame column (containing text).
# Instead of "vec.bin" I want to have something Like "foo <- vec.bin" in R. So that the output stays within R and not on my PC.