我正在处理非结构化数据(文本)。我想用一些关键词和关键词组合标记数据。
我无法用单词组合标记数据。我想知道“欺诈”和“误卖”发生在哪里。
我尝试使用 qdap 包我能够用 OR 条件而不是 AND 条件标记这两个词
下面是我使用的代码
library (qdap)
df<- read.csv (file.choose(),header=T)
####cleaning of text
df$Comment<- strip(df$Comment)##remove capitalization and punctuation
df$Comment<- clean (df$Comment)
df$Comment<- scrubber(df$Comment)
df$Comment<- qprep(df$Comment)
df$Comment<-replace_abbreviation(df$Comment)
terms <- list(
" fraud ",
" refund "," cheat ", " cancellation ", "missold", "delay",
combo1= qcv(fraud,missold) )
df2<-with (df, termco(df$Comment, df$Comment, terms))[["raw"]]###tagging of data with key words
df3<- merge (df, df2, by="Comment")
我正在使用保险公司的投诉数据 我拥有的变量是
- 投诉日期
- 品牌反对者抱怨
- 评论(投诉)