检查英语词典中是否存在单词 r

tes*_*ser 5 r text-mining shiny

我正在对多个简历进行一些文本分析,以生成一个wordcloudusingwordcloud包以及tm用于预处理 R 中文档语料库的包。

我面临的问题是:

  1. 检查语料库中的单词是否具有某种含义即。它属于英文词典。

  2. 如何一起挖掘/处理多个简历。

  3. 检查技术术语,如 r、java、eclipse 等。

感谢帮助。

par*_*rth 7

我以前遇到过一些问题,所以分享您的问题的解决方案:

1.有一个包qdapDictionaries是字典和单词列表的集合,用于“qdap”包。

library(qdapDictionaries)

#create custom function
is.word  <- function(x) x %in% GradyAugmented # or use any dataset from package

#use this function to filter words, df = dataframe from corpus
df <- df[which(is.word(df$terms)),]
Run Code Online (Sandbox Code Playgroud)

2.使用VCorpus(DirSource(...))创建的目录包含了所有的简历你的文集

resumeDir <- "path/all_resumes/"
myCorpus <- VCorpus(DirSource(resumeDir))
Run Code Online (Sandbox Code Playgroud)

3.创建您的自定义词典文件,如包含术语的my_dict.csvtech

#read custom dictionary
tech_dict <- read.csv("path/to/my_dict.csv", stringsAsFactors = FALSE)
#create tech function
is.tech <- function(x) x %in% tech_dict
#filter
tech_df <- df[which(is.tech(df$terms)),]
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助。