extract nouns and verbs from a text dataframe and save it in two different dataframes in R

883 views Asked by At

I have a text dataframe with only text columns. One of the columns is

hw motorola scanner model rssn missing issue damaged power connectionif serial provide extended part numberrs fsr = short cable attached wrist build type rpcolleague colin patterson contact number ensure main depot id selected ensure selected correct model position id save log

I have removed numbers, stopwords and punctuations from the text. I want to separate the nouns and verbs and put them in different dataframes.

1

There are 1 answers

0
cr1msonB1ade On

That is not strictly a trivial task. You could load a library with the parts of speech for each word (e.g. OpenNLP -> Maxent_POS_Tag_Annotator), but some of them may be either one part of speech or another depending upon context, so that makes this a much harder task programmatically to get perfect. Hope the OpenNPL package helps though.