How to convert a string variable containing comments to a variable with integers to be used in neural networks?
I am working with data contains comment variable like imdb data.
imdb - dataset_imdb(num_words = 500)
c(c(train_x, train_y), c(test_x, test_y)) %-% imdb
train_x[[3]]
These are reviews on movies so they contained actual English texts. However, train_x[[3]] gives a vector of integers. I don't have enough experience with strings in R and would like to convert a vector of comments data to a vector of integers based on the overall frequency in that vector. I cannot share a sample of my data for privacy purposes but I would be happy to explain it if needed.
The code above is from Dr. Bharatendra Rai tutorial on YouTube.
Topic lstm text text-mining r
Category Data Science