I have a dataframe which looks like this:
sentences <- data.frame(sentences =
c('You can apply for or renew your Medical Assistance benefits online by using COMPASS.',
'COMPASS is the name of the website where you can apply for Medical Assistance and many other services that can help you make ends meet.',
'Medical tourism refers to people traveling to a country other than their own to obtain medical treatment. In the past this usually referred to those who traveled from less-developed countries to major medical centers in highly developed countries for treatment unavailable at home.',
'Health tourism is a wider term for travel that focus on medical treatments and the use of healthcare services. It covers a wide field of health-oriented, tourism ranging from preventive and health-conductive treatment to rehabilitational and curative forms of travel.',
'Medical tourism carries some risks that locally provided medical care either does not carry or carries to a much lesser degree.',
'Receiving medical care abroad may subject medical tourists to unfamiliar legal issues. The limited nature of litigation in various countries is a reason for accessbility of care overseas.',
'While some countries currently presenting themselves as attractive medical tourism destinations provide some form of legal remedies for medical malpractice, these legal avenues may be unappealing to the medical tourist.'))
All I want to do is to find important words in each row and create a new column that should look like this:
sentences$ImpWords <- c("apply, renew, Medical, Assistance, benefits, online, COMPASS",
"COMPASS, name, website, apply, Medical, Assistance, services, help, meet")
and so forth
I am not sure how this can be done?
I was trying bag of words, cleaning and preprocessing etc. using various packages such as tm
, tidytext etc. But unable to get the desired result.
Is there any alternative possible?