开始使用免费开始使用

添加自定义停用词

我们在 twitter_data 中看到了一些没有信息量的词,应该从最终的词列表中移除。在本练习中,您将把若干词添加到 custom_stop_words 数据框中。

本练习是课程的一部分

R 文本分析入门

查看课程

练习说明

  • 自定义停用词数据框的新列名应与 stop_words 一致。
  • httpwint.co 添加为自定义停用词。
  • 将自定义停用词按行绑定到 stop_words

交互式实操练习

通过完成这段示例代码来试试这个练习。

custom_stop_words <- tribble(
  # Column names should match stop_words
  ___, ___,
  # Add http, win, and t.co as custom stop words
  ___, "CUSTOM",
  ___, "CUSTOM",
  ___, "CUSTOM"
)

# Bind the custom stop words to stop_words
stop_words2 <- stop_words %>% 
  ___(___)
编辑并运行代码