Extract keywords from a description column

I am new to R Studio, and have been thrown into the ocean for a beginner like me....

Scenario:
I have a description column, from this column i need to extract keywords. create a new column next to the description column and save this key phrases related to the description.
this is an example of how the extraction must happen.

image

my code is not doing much though, see snippet below:

library(tidyverse)
my_data = read.delim("TEST_CSV_.csv")
head(my_data)

install.packages("tm")
install.packages("tidytext")
library(tm)
library(tidytext)

my_data <- my_data %>%
mutate(description = tolower(description), # Convert text to lowercase
description = removePunctuation(description), # Remove punctuation
description = removeNumbers(description), # Remove numbers
# description = stripWhitespace(description),
) # Remove extra whitespaces

Any help, or advice I will really appreciate that

This seems rather odd, look at the values in the second column for "Postage + Courier from cpt". In column 2 there are two different "key phrases" with the same input, which cannot be the case if you look for a programmatical solution.

You should provide a clear reproducible example with some data (see here for more details on a reprex). Maybe this way somebody can help you with your request. :slight_smile:

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.