我有一个二元组的列表,如下所示:
test_test_bigram
1: I would
2: would like
3: like to
4: to thank
5: thank the
---
4792: design features
4793: features .
4794: . Return
4795: Return to
4796: to text
我已经将其转换为数据表,我想为每个ngram (每行)的频率创建一个列。有没有人能建议
另外,您能介绍一下如何在R中进行情感分析吗?在Ngram的情况下,我使用sentimentr进行行式情感分析,并使用sentimentr进行“词袋”方法(单字)的情感分析。
发布于 2020-02-13 19:50:25
你可以使用tidyverse:
library tidyverse
test_test_bigram %>% distinct() %>% add_count()
如果二元语法数据集已具有唯一值,则可以跳过distinct()
https://stackoverflow.com/questions/60206409
复制相似问题