首页 > 解决方案 > 是否有一个 R 函数来预处理整个 CSV 文件以进行情绪分析?

问题描述

我是 R 中情感分析的新手,我使用教科书“Text Mining with R: A Tidy Approach”作为预处理文本的主要参考,他们使用以下代码:

text <- c("Because I could not stop for Death -",
"He kindly stopped for me -",
"The Carriage held but just Ourselves -",
"and Immortality")

library(dplyr)
text_df <- data_frame(line = 1:4, text = text)

library(tidytext)
text_df %>%
unnest_tokens(word, text)

问题是,我有一个 344 行 14 列的 CSV 数据集,我想计算 6 列中包含的文本的情绪:

有没有办法(单独)预处理每个观察中包含的数据而无需应用上述代码?

提前感谢您的帮助和建议!

标签: rsentiment-analysisdata-preprocessing

解决方案


推荐阅读