[R] Text categories based on the sentences

S Ellison S.Ellison at LGCGroup.com
Wed Nov 16 13:46:06 CET 2016


> I have data set contains one variable "*Description*"
> 
> *Description**                                                  Category*
> 
> 1. i want ice cream                                         food
> 2. i like banana very much                              fruit
> 3. tomorrow i will eat chicken                          food
> 4. yesterday i went to birthday party                festival
> 5. i lost my mobile last week                           mobile
> 
> Please remember that i have only "*Description*" Variables only.How can i
> get the categories column based on the sentences of *Description *column.

You could look at something like ReadMe (http://gking.harvard.edu/readme) to generate a classifier based on a suitable subsample of your data that then classifies the rest of your data set.

Alternatively you could do it the hard way; use a natural language parser to extract all the noun phrases (or just split oout the words),  list the unique noun phrases, manually classify all of them  using your own criteria to give a pair list (phrase->category), and then match classes back to the rows that contain each noun phrase.





*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list