## 4 Application: Case Study
### Pre-Processing  
In the pre-processing stage, we used the Natural Language Toolkit (NLTK) in Python 3.7. NLTK is an industrial-strength platform that has a wide range of natural language processing libraries. This method was used, and the stages described in Section 2.2 were carried out: (1) case conversion, (2) tokenization, (3) stop-word filtering, (4) terms correction, and (5) terms filtering or non-significant words. These stages were followed to prepare for all the comments. Table 2 shows a TripAdvisor review that exemplifies pre-processing.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Dataset** & **Data Collection Period** & **Languages** & **Extraction Mode** & **Reviews** & **\%** \\ \hline Tripadvisor & 2017–February 2022 & Spanish, English, Italian, German, French & API & 155 & 23 \\ Facebook & 2017–February 2022 & Spanish & API & 269 & 39 \\ Customer Survey & 2019–January 2022 & Spanish, English & Manual (Tablet) & 261 & 38 \\ \hline \hline \end{tabular}
\begin{tabular}{c c c c} \hline \hline  & Total & 685 & 100 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Case study databases.  
Figure 2: Automatic integration of sentiment analysis and strategic planning.  
Figure 3 shows the percentage reduction after each pre-processing task.  
The token reduction was approximately 40%. The resulting tokens were grouped into a frequent itemset matrix, as shown in Table 3. The rows indicate each of the 685 instances of the opinion, the columns represent the 2620 valid tokens in the model, and the cells represent the frequencies of the terms. The cells assume values directly proportional to the number of tokens counted, which are represented as \(\{Tk_{i},\;Tk_{2},Tk_{3},\dots,\;Tk_{n}\}\) for each of the textual instances, which are represented as \(\{Ti_{1},\;Ti_{2},Ti_{3},\dots,\;Ti_{n}\}\). If this was not satisfied, the value was automatically set to 0.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Original Opinion** & **English Translation** \\ \hline \begin{tabular}{c} **Case conversion** \\ **very tasty,** \\ **service, clean place, and nice facilities.** \\ **highly recommended.** \\ **we will return** \\ \end{tabular} & \begin{tabular}{c} **Very tasty, we loved it good flavor, excellent** \\ **service, clean place, and nice facilities.** \\ **highly recommended.** \\ **We will return** \\ \end{tabular} & \begin{tabular}{c} **Very tasty, we loved it good flavor, excellent** \\ **service, clean place, and nice facilities.** \\ **highly recommended.** \\ **We will return** \\ \end{tabular} \\ \hline \
\begin{tabular}{c} **Stop-word filtering** \\ **[‘tasty’,** _’good’,** _’flavor’, _’excellent’, _’service’,_ \\ **’clean’,** _’place’, _’nice’, _’facilities’,** \\ **’recommended’]** \\ \end{tabular} &
\begin{tabular}{c} **Tokenization** \\ **[’very’,** _’tasty’,** _’we’, _’loved’, _’it’, _’good’,** _’flavor’, _’excellent’, _’service’, _’clean’, _’place’, _’and’, _’nice’, _’facilities’, _’highly’, _’recommended’, _’we’, _’will’, _’return’_]_ \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table}
Table 2: Pre-processing steps of a real opinion.  
Figure 3: Valid tokens proportion after pre-processing.