【发布时间】:2015-04-09 14:21:42
【问题描述】:
我正在尝试使用 R 的 tm 包对我的文本数据进行矢量化。
目前我的数据语料是以下形式:
1. The sports team practiced today
2. The soccer team went took the day off
然后数据将被矢量化为:
<the, sports, team, practiced, today, soccer, went, took, off>
1. <1, 1, 1, 1, 1, 0, 0, 0, 0>
2. <1, 0, 1, 0, 0, 1, 1, 1, 1>
我更愿意为我的向量使用一组自定义短语,例如:
<sports team, soccer team, practiced today, day off>
1. <1, 0, 1, 0>
2. <0, 1, 0, 1>
R 中是否有可以执行此操作的包或函数?或者是否有任何其他具有类似功能的开源资源?谢谢。
【问题讨论】:
标签: r corpus text-analysis