利用R中的文本预测连续变量



我有一项任务,需要根据客户面临的问题的文本字段预测连续变量、里程表读数。此字段不是下拉菜单,而是使用客户的逐字逐句进行更新。因此,我需要根据客户面临的问题的文本字段来预测里程表读数。例如:

**Text**                     **Odometer Reading**
Clutch problem               20,000 
Axle Issue                   150,000

编辑:

我正在使用unigram构建一个线性模型。但当我执行数据预处理时,我会收到以下警告:

> corp <- Corpus(VectorSource(ISSUES$CUSTOMER_VOICE))
> 
> corp <- tm_map(corp,tolower)
Warning message:
In tm_map.SimpleCorpus(corp, tolower) : transformation drops documents
> corp <- tm_map(corp,removePunctuation)
Warning message:
In tm_map.SimpleCorpus(corp, removePunctuation) :
transformation drops documents
> corp <- tm_map(corp,removeWords,stopwords('english'))
Warning message:
In tm_map.SimpleCorpus(corp, removeWords, stopwords("english")) :
transformation drops documents
> corp <- tm_map(corp,stemDocument)
Warning message:
In tm_map.SimpleCorpus(corp, stemDocument) : transformation drops documents

有人能告诉我如何修复这个警告吗。

这只是一种方法,但这可能不是最佳解决方案对于Text列,执行textminig以获得unigram和bigram,然后将它们转换为DTM矩阵,然后使用任何线性模型来预测Odometer Reading

我希望这可以解决你的问题

最新更新