【发布时间】:2020-04-17 12:25:26
【问题描述】:
我发现有一个包可用于实现词形还原“textstem”。 但我无法安装它。 我正在共享用于安装的脚本和我得到的错误。
> install.packages("textstem")
Installing package into ‘C:/Users/nilesh.ulhas.hulyal/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘textstem’ is not available (for R version 3.2.5)
> if (!require("pacman")) install.packages("pacman")
> pacman::p_load_gh("trinker/textstem")
Error in curl::curl_fetch_memory(url, handle = handle) :
Peer certificate cannot be authenticated with given CA certificates
Warning message:
In pacman::p_load_gh("trinker/textstem") :
Failed to install/load:
trinker/textstem
> library(textstem)
Error in library(textstem) : there is no package called ‘textstem’
> docs1 <- tm_map(docs1, lemmatize_strings())
Error in match.fun(FUN) : could not find function "lemmatize_strings"
我在尝试使用 tm 包中的 Lemmatizationfunction 时分享以下代码和错误
> docs1 <- tm_map(docs1, lemmatize_strings)
Error in match.fun(FUN) : object 'lemmatize_strings' not found
还有其他方法可以用来在 R 中实现词形还原语料库吗?
【问题讨论】:
-
完美运行:
install.packages("textstem") library(textstem) x <- c("culturing", "cultured", "cultures") lemmatize_strings(x, dictionary = lexicon::hash_lemmas) -
@ChrisRuehlemann,我试过的 textstem 包,但它不支持 R 版本 3.2.5 。有没有其他方法来安装它。我也尝试从 .zip 或 tar.gz 文件安装它。但它没有安装
-
我会去 github project page 获取 textstem 并发布一个问题,看看作者是否在某个地方有一个旧版本可以与你的旧版本 R 一起使用。我也会问这个问题,如果当前包可能在 3.2.5 中工作,或者如果有特定原因需要 3.3。您可能可以对代码进行一些小的修改以使其与 3.2.5 一起使用,或者它可能按原样工作(除非安装检查),只是没有针对该版本进行测试。
标签: r nlp lemmatization