# Improving RE-SWOT Analysis with Sentiment Classification: A Case Study of Travel Agencies
## 3 The Proposed Method  
Figure 3 shows the process used in the proposed method, which can be broken down into four phases. We discuss these in detail. 1. Data collection  
At this stage, English text messages related to KKday and Klook were extracted from the TripAdvisor forum, and the web crawler was written in Python. The extracted text messages had to go through data cleaning before being used in the next stage. As the data collection and transfer process may cause data format errors, data loss, or other problems, it was necessary to preprocess the data prior to analysis [29]. Data cleaning is the process of detecting and deleting inaccurate or useless records, such as spelling errors and non-target languages, leaving only valuable and relevant data. In this study, messages with a short length or those repeatedly posted by a single user were deleted. Because repeated messages may cause statistical bias, we only kept one of the repeated messages to preserve the authenticity and accuracy of the data sample [28]. 2. Feature extraction  
Referring to [PERSON] and [PERSON]'s study, we identified features of the user reviews derived from the previous stage through the following procedures:  
1. Tokenization  
Tokenization is the act of splitting a string of text into list of tokens, from which certain characters, such as punctuation, may be thrown away. We provide the following message as an example:  
\"I buy ticket in KKdays, and they will send me QR code through email. Use QR code to go in, very convenience, easy, and save time.\"  
The message can be broken into two sentences: \"I buy ticket in KKdays, and they will send me QR code through email.\" and \"Use QR code to go in, very convenience, easy, and save time.\" The two sentences can be further tokenized into \"I\", \"buy\", \"ticket\", \"in\", \"KKdays\", \"and\", \"they\", \"will\", \"sent\", \"me\", \"QR\", \"code\", \"through\", \"email\", \"Use\", \"QR\", \"code\", \"to\", \"go\", \"in\", \"very\", \"convenience\", \"easy\", \"and\", \"save\", and \"time\". 2. Lowercase transformation  
The purpose of converting uppercase to lowercase is to prevent words from being recognized as different words due to the difference in capitalization. Take the tokens \"I\", \"KKdays\", and \"QR\" in the previous step as examples. These tokens would be converted to lowercase: \"i\", \"kkdays\", and \"qr\". 3. Removal of stop words  
Some words have little lexical meaning or can only express grammatical meaning within sentences, such as a, the, and he. Some words appear very frequently, such as 'want', but it is difficult for search engines to narrow the search scope and provide truly relevant search results. Such words are called stop words and can be ignored without losing the meaning of the sentence. In this study, we used the python NLTK library to remove stop words. Taking the above sentences as an example, after removing stop words, we were left with \"buy\", \"ticket\", \"kkdays\", \"sent\", \"qr\", \"code\", \"email\", \"qr\", \"code\", \"go\", \"convenience\", \"easy\", \"save\", and \"time\". 4. POS (part-of-speech) tagging  
Features are usually described by nouns, verbs, and adjectives. Therefore, we used the part-of-speech tagging method in the python NLTK library to assign a label to each token to indicate its part of speech (POS). Table 1 lists some POS tags. Taking the tokens without stop words as an example, after tagging, we were left with \"buy, VB\", \"ticket, NN\", \"kkdays, NNS\", \"sent, VB\", \"qr, NN\", \"code, NN\", \"email, NN\", \"qr, NN\", \"code, NN\", \"go, VB\", \"convenience, NN\", \"easy, JJ\", \"save, VB\", and \"time, NN\". * Lemmatization Tokens may be recognized as different keywords due to differences in the part of speech, which results in the extraction of repeated features. This study used the Lemmatizer method in python NLTK library to remove inflectional endings and return tokens to the base form. For example, \"kkdays\" was returned to \"kkday\" and then tagged as \"NN\".