2017-07-07 81 views
0

存在我的複式進行一些文本分析簡歷使用wordcloudtm包一起產生wordcloud用於預處理的文檔語料庫中R.檢查,如果單詞詞典[R

的問題我面對的是:

  1. 檢查語料庫中的單詞是否有一定的含義,即。它屬於英語字典。

  2. 如何一起挖掘/處理多個簡歷。

  3. 檢查高科技方面如R,JAVA,月食等

欣賞的幫助。

+0

你有沒有試過用custome'dictionary'並從中檢查單詞如技術術語簡歷 – parth

+0

@ParthChaudhary,custom'dictionary'對'tech'術語有好處,但對於檢查英文單詞並不富有成效 –

回答

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)),] 

2.使用VCorpus(DirSource(...))從包含所有目錄中創建您的陰莖恢復

resumeDir <- "path/all_resumes/" 
myCorpus <- VCorpus(DirSource(resumeDir)) 

創建像含tech方面my_dict.csv您的自定義詞典文件。

#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)),] 

希望這會有所幫助。

+0

如果'tech'單詞更多,'is.word'在計算上需要很多時間? –

+0

可以嘗試使用'lapply'等分組函數來提高性能。 – parth