首页 > 解决方案 > 将数据框转换为语料库时,如何将行标签保留在数据框中?

问题描述

我的数据框

                Column1 | Comment
Row1 is labeled    A      Some comments added
Row2 is labeled    B      Some comments added here
Row3 is labeled    C      Some comments added here as well

这是我设置语料库的时候

corpus = Corpus(VectorSource(df$Comment))

我的结果删除了“Row1 已标记”、“Row2 已标记”,而是变为 1、2、3 等等。我希望它保留我分配的行标签。

标签: rlabelrowrandom-forest

解决方案


推荐阅读