Text Mining on German yelp Reviews

Niko Karajannis
22nd November 2015

Rationale

Customers express their consumer experience via language, that is words. The customers' experience impacts on their rating behaviour. Thus, we assume, that the words used in the reviews should be able to explain and forecast consumers' rating behaviour. The assumed logic can be depicted as follows:

Experience -> Reviews -> Rating

Text Mining

A corpus was made, processed and turned into a DTM

library(tm)
options(stringsasFactors = FALSE)
corpus = Corpus(VectorSource(review_Deutsch_text$Text))
corpus <- tm_map(corpus, removePunctuation, preserve_intra_word_dashes=TRUE)
corpus <- tm_map(corpus, removeNumbers)
corpus <- tm_map(corpus, content_transformer(tolower))
corpus <- tm_map(corpus, function(x) removeWords(x, germanStopwords))
corpus <- tm_map(corpus, function(x) stemDocument(x, language="german"))
corpus <- tm_map(corpus, stripWhitespace)
DTM <- DocumentTermMatrix(corpus)

Assessing the RF model

Looking at the indicators assessing the model, we see that the results of the model are alright. Due to the nature of language, indicators from Text Mining often do not exhibit the results as good as seen in models deriving from numerical data.

#Accuracy:
0.7883871
#Precision:
0.7821138
#Recall(Sensitivity):
0.9412916
#F1(harmonic mean of precision and recall):
0.8543517

Most important words in the model

Looking at the most important words in the model, we can see that most words are not interesting for practical purposes. However, words as 'unfreund'(unfriendly), 'leck'(lecker), 'lieblos'(carelessly), 'freundlich'(friendly') give an idea, of which aspects drive customers the most when rating their consumer experience.

Discussion

The results of the analysis are far from exhaustive. Some of the questions arising are the following:
1: How do different kinds of businesses (restaurants, shops, galleries) differ as to which aspects are considered most salient by customers?
2: How do different nationalities differ in that regard?
3: How do analyses differ depending on the size of words within the Document Term Matrix?
4: If we had enough ratings and were able to select only a subset of good ratings so as to have equal sizes of bad and good ratings: how would this impact on the results?
As one can see, there are questions to be answered abound!