<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Mae:</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Naive Features for Sentiment Analysis on Mexican Touristic Opinions Texts</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Gabriela Carmona-Sanchez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Angel Carmona</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Miguel A. Alv</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Benemerita Universidad Autonoma de Puebla (BUAP)</institution>
          ,
          <addr-line>72000, Puebla</addr-line>
          ,
          <country country="MX">Mexico</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Centro de Investigacion Cient ca y de Educacion Superior de Ensenada, Unidad de Transferencia Tecnologica Tepic (CICESE-UT3)</institution>
          ,
          <addr-line>63173, Nayarit</addr-line>
          ,
          <country country="MX">Mexico</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Consejo Nacional de Ciencia y Tecnolog a (Conacyt)</institution>
          ,
          <addr-line>03940, CDMX</addr-line>
          ,
          <country country="MX">Mexico</country>
        </aff>
      </contrib-group>
      <volume>0</volume>
      <issue>76</issue>
      <abstract>
        <p>This paper presents a simple approach to extract naive features to represent and classify tourists' opinions in Mexican places to participate in the Rest-Mex 2021 evaluation forum. The proposed approach consists of extracting 15 simple features. Then, various classi cation algorithms were used to evaluate the quality of these features, such as SVM, KNN, Decision Tree, Random Forest, and Naive Bayes. A weighting scheme was also proposed to obtain the best combination between algorithms and features, where it turned out that the best algorithm for this set of features was KNN with seven neighbors. Of these features, the best turned out to be what had to do with the length of words and characters and the number of stop words. With this approach, 0.76 of MAE was obtained, obtaining 10th place out of 15 teams, which considering the simplicity of this solution, makes it an acceptable result.</p>
      </abstract>
      <kwd-group>
        <kwd>Naive features</kwd>
        <kwd>Sentiment analysis</kwd>
        <kwd>Mexican tourist texts</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>In recent years, tourist texts have taken on great importance in arti cial
intelligence investigations. This is due to the advantages that can be obtained from
analyzing this type of text. One of them is to analyze the sentiment of tourists
who leave, writing through digital platforms such as TripAdvisor. In this way, it
is possible to automatically determine the user's experience, determine if their
comment is positive or negative and through this information, nd possible
improvements that can be made to improve the experience of other tourists over
time.</p>
      <p>This task falls in the area of natural language processing, speci cally within
sentiment analysis. This task determines if the author of a text expresses himself
positively or negatively about a product or service received. There are variations
in the task where it is also about determining if the opinion is neutral; it can
even go further and determine a numerical scale between 0 and N where 0 would
be the most negative and N the most positive [8].</p>
      <p>In this way, the sentiment analysis task can be seen as an automatic
classication task where the instances are texts, and the class is the text polarity.</p>
      <p>Typically, various textual representations are used for this task, such as
ngrams, dictionaries, and embeddings, among others, used to feed classi ers, train
them, and test them to observe their performance. However, there are scenarios
where it is more critical than few computational resources are used both in
time and memory due to limitations of speci c tasks, for example, implementing
solutions for IoT devices [5].</p>
      <p>In this work, we propose to study the scope and e ectiveness of features
based on describing the text to be analyzed. For their simplicity, we will call
these features Naive Features.</p>
      <p>
        To test these types of features, the database that was released for the
RestMex 2021 evaluation forum will be used [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. For this edition, a corpus of texts
from tourists who visited Guanajuato in Mexico and its attractions was released.
In this way, the e ectiveness of these features can be tested in texts in Spanish
since one of their advantages is that they are independent of the language.
      </p>
      <p>The rest of the document is organized as follows; In section 2, the
methodology followed in this work is described. In section 3, the results and their analysis
are presented. Finally, section 4 presents the conclusions of this work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Methodology</title>
      <p>This section presents the database with which it experimented and the proposed
methodology to represent the tourist texts.
2.1</p>
      <sec id="sec-2-1">
        <title>Data set</title>
        <p>
          The analysis of sentiments task in tourism texts, which this year proposed within
the Rest-Mex 2021 evaluation forum, predicts a class for each review provided in
the evaluation set. The available classes are integers in the range [
          <xref ref-type="bibr" rid="ref1">1, 5</xref>
          ]. Reviews
were taken from the TripAdvisor website and were written by a tourist who
evaluated some of the emblematic places in Guanajuato, Mexico. It is essential
to mention that the whole set was in Spanish, being the rst data set with these
available features for evaluation.
        </p>
        <p>
          The forum organizers released two di erent data sets ; one for training and
one for evaluation. The training set consists of 5197 opinions with 9 pieces of
information described below:
{ Index: the index of each opinion.
{ Title: The title that the tourist himself gave to his opinion.
{ Opinion: The opinion expressed by the tourist.
{ Place: The tourist place that the tourist visited and to which the opinion is
directed.
{ Gender: the gender of the tourist.
{ Age: The age of the tourist at the time of issuing the opinion.
{ Country: The country of origin of the tourist.
{ Date: the date the opinion was issued.
{ Label: The label representing the polarity of the opinion: [
          <xref ref-type="bibr" rid="ref1 ref2 ref3">1, 2, 3, 4, 5</xref>
          ].
        </p>
        <p>The training set classes are unbalanced. as Table 1 shows.</p>
        <p>Finally, the test data set contained 2216 rows and the same information as
the training set, except the class information.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Proposed Approaches</title>
        <p>To attack the sentiments analysis task in tourist data, it is proposed to use simple
features that can capture important information to determine the polarity of an
opinion in such a way that it is quick to calculate and represent. Especially
to o er an option for restricted applications in time or memory (such as IoT
solutions) and that cannot use approaches that, although they have outstanding
e ectiveness results, can be slow or use much computational power, in addition
to having the advantage of being language-independent features.</p>
        <p>Given a text in the data set, its representation will be given by the following
features proposed:
{ F1: Number of capital letters in the opinion
{ F2: The length of the longest word in the opinion
{ F3: The average words length in the opinion
{ F4: Number of words in the opinion
{ F5: Number of characters in the opinion
{ F6: The ratio between the number of di erent words and total words in the
opinion
{ F7: The number of digits in the opinion
{ F8: The ratio of the number of stop words and total words in the opinion
{ F9: Number of punctuation marks in the opinion
{ F10: Number of stop words in the opinion
{ F11: Number of characters in the opinion without stop words
{ F12: The ratio between the number of di erent words and total words in the
opinion without stop words</p>
        <p>The information available for each opinion will also be added as:
{ F13: The gender of the person who gave the opinion
{ F14: The age of the person who gave the opinion
{ F15: The country of the person who gave the opinion</p>
        <p>For feature F13 that refers to the opinion author's gender, the value will be 0
if it is a man, 1 if it is a woman, and 2 if the gender of the person is not known.
For feature F15, the country will be coded as 0 if the person is from Mexico or
1 if not.</p>
        <p>Each option is transformed into a vector representation of dimension 15,
which is easy and fast to calculate and independent of the language, which
means that data sets in di erent languages can be evaluated.</p>
        <p>
          The 10 fold cross-validation approach was used to classify the data set [9].
For each partition, the following classi ers were applied:
{ Support Vector Machines (SVM) [6]
{ k-Nearest Neighbor (KNN) with k 2 f1; 3; 5; 7g [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]
{ Decision Tree (DT) [4]
{ Random Forest (RF) [7]
{ Naive Bayes (NB) [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]
        </p>
        <p>Accuracy, F-measure, and MAE were used as evaluation measures since it is
the measure that the organizers take as o cial.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Results</title>
      <p>In this Section, the results obtained for the training partition are presented.
Afterward, the chosen model is presented to be evaluated in the training partition
together with its obtained result.
3.1</p>
      <sec id="sec-3-1">
        <title>Training data set results</title>
        <p>NB, class 3 with KNN-3, and class 4 with DT. The best result of mae is obtained
with RF; however, this algorithm cannot capture any instance of class 1.</p>
        <p>Table 3 shows the best features under the information gain measure. Only
the features that obtained a value greater than 0,1 appear in this table. These
results give evidence that the best feature to solve this task is the number of
words in the opinion, the second is the number of stop words, while the number
of digits, the average of the length of the words, the di erent words not counting
stop words and the length of the longest word complement the list.</p>
        <p>Figure 1 shows the decision tree when only the word count feature is used.
Ten opinions from class 1 (Bad label) and ten from class 5 (Good label) were
used to build this decision tree. These opinions were chosen randomly. For this
sample, it is possible to see that negatively valued opinions tend to have more
words, which gives evidence that when the tourist is not satis ed, he uses more
words to exorcise it, and could be the reason why this feature is important in
this task.</p>
        <p>It is clear to see that although a good mae result can be considered for all
the algorithms, the F-measure results are shallow, which is a consequence of the
data imbalance. This makes choosing a classi cation model not easy.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Test data set results</title>
        <p>To choose the best model from those presented in Table 2 it is proposed to
implement a weighting scheme to determine which of all the algorithms presents
Fig. 1. Decision tree for the number of words feature on 20 random opinions
Algorithm SVM KNN-1 KNN-3 KNN-5 KNN-7 DT RF NB</p>
        <p>Q 14,63 19,63 15,20 30,74 36,73 17,11 34,22 26,17
the best balance between the di erent results (accuracy, F-measure of each class,
and mae).</p>
        <p>It is proposed to generate a linear combination to measure the quality of each
of the results obtained as presented in the equation 1.</p>
        <p>Q = C1 Acc+C2 F +C3 F1 +C4 F2 +C5 F3 +C6 F4 +C7 F5 +C8 M AE (1)</p>
        <p>Where Ci represents the importance of each variable in the equation. Fj
represents the F-measure results for the class j. Acc, F, and MAE represent the
valor of accuracy, macro F-measure and mae, respectively.</p>
        <p>To choose the value of each constant Ci, the following weights are proposed:
{ C1: Since accuracy is not an important measure because the collection is
unbalanced, it will only be given a weight of 1.
{ C2: It seeks to obtain a high F-measure macro result so that it will be given
a weight of 10.
{ Cf3;4;5;6;7g: The higher the number of opinions in a class, the easier it is to
classify, which means that classes with little data are more complicated. In
this way, it is sought to reward the well-classi ed elements of minority classes
by putting as a weight 100 D(i) where D(i) is the percentage of the class
i.
{ C8. Since MAE is the measure taken into account to order the results by
the organizers, it will be given the greatest weight, which must be negative
since the ideal is to get as close to zero in this measure. Thus the value of
this constant will be -100.</p>
        <p>Table 4 shows the results of the equation 1. It is possible to see that the
algorithm that presents the best value of Q is KNN-7, which did not present a
high individual value of some measure; however, it is the one that obtains the
best balance. On the other hand, SVM that obtained good results for accuracy,
F-measure for class 5, and mae is the one that obtains the worst value of Q.</p>
        <p>For this reason, in order to be evaluated in the Rest-Mex 2021 evaluation
forum, it was decided to send the model generated by KNN-7 to the organizers.
3.3</p>
        <p>O</p>
        <p>cial results
{ Accuracy: 45,71
{ Macro F-measure: 0,17
For the o cial results, the model proposed obtained the following results:</p>
        <p>With these results, the approach proposed obtained 10th place of 15 teams.
Also, it is obtained better F-measure results than the baseline, and it was capable
of classifying instances in three of the ve classes.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>In this work, a study was presented to measure the performance of naive features
to attack the sentiment analysis problem for Mexican tourist texts.</p>
      <p>This solution consisted of representing each tourist opinion in 15 simple
features that can be extracted very quickly. This simplicity makes this solution
ideal for some applications with an extreme limit of space and memory, for
example, in IoT devices, and thus they can use some of these features to obtain
an acceptable performance in a shorter response time.</p>
      <p>When evaluating this solution in the Rest-Mex 2021 corpus, 0,76 of MAE
was obtained, where the best result obtained in the competition was 0,47.
Considering that the maximum possible error is 4 (when the result can be 5, and the
prediction is 1, for example), 0,29 represents 7,25 % of the possible error, which
is an acceptable loss considering the simplicity solution.</p>
      <p>Evidence is given that the number of words in the opinion gives much
information about polarity. Also, the length of the words is an essential source that
a classi er can use. Other important features for this task are those that have to
do with the stop words. Finally, for this task and in this database, demographic
features such as gender, age, and place of origin of the author of the opinion do
not seem to provide relevant information for the classi cation.</p>
      <p>As work in the future, it is proposed to apply this solution to a multilingual
collection and to be able to exploit its best feature, which is that it is a
languageindependent solution.
4. Charbuty, B., Abdulazeez, A.: Classi cation based on decision tree algorithm for
machine learning. Journal of Applied Science and Technology Trends 2(01), 20{28
(2021)
5. Dinculeana, D., Cheng, X.: Vulnerabilities and limitations of mqtt protocol used
between iot devices. Applied Sciences 9(5), 848 (2019)
6. Huang, Y., Zhao, L.: Review on landslide susceptibility mapping using support
vector machines. Catena 165, 520{529 (2018)
7. Mishra, S., Tadesse, Y., Dash, A., Jena, L., Ranjan, P.: Thyroid disorder analysis
using random forest classi er. In: Intelligent and cloud computing, pp. 385{390.</p>
      <p>Springer (2021)
8. Mukherjee, S.: Sentiment analysis. In: ML. NET Revealed, pp. 113{127. Springer
(2021)
9. Rohani, A., Taki, M., Abdollahpour, M.: A novel soft computing model (gaussian
process regression with k-fold cross validation) for daily and monthly solar radiation
forecasting (part: I). Renewable Energy 115, 411{422 (2018)</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Ahmed</surname>
            ,
            <given-names>H.M.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Javed</given-names>
            <surname>Awan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Khan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.S.</given-names>
            ,
            <surname>Yasin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Faisal</surname>
          </string-name>
          <string-name>
            <surname>Shehzad</surname>
          </string-name>
          ,
          <string-name>
            <surname>H.M.</surname>
          </string-name>
          :
          <article-title>Sentiment analysis of online food reviews using big data analytics</article-title>
          .
          <source>Ha z Muhammad Ahmed</source>
          , Mazhar Javed Awan, Nabeel Sabir Khan, Awais Yasin,
          <article-title>Ha z Muhammad Faisal Shehzad (</article-title>
          <year>2021</year>
          )
          <article-title>Sentiment Analysis of Online Food Reviews using Big Data Analytics</article-title>
          .
          <source>Elementary Education Online</source>
          <volume>20</volume>
          (
          <issue>2</issue>
          ),
          <volume>827</volume>
          {
          <fpage>836</fpage>
          (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Alvarez-Carmona</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aranda</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Arce-Cardenas</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fajardo-Delgado</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guerrero-Rodr</surname>
            <given-names>guez</given-names>
          </string-name>
          , R.,
          <string-name>
            <surname>Lopez-Monroy</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mart</surname>
            nez-Miranda,
            <given-names>J.</given-names>
          </string-name>
          , PerezEspinosa, H.,
          <string-name>
            <surname>Rodr</surname>
            guez-Gonzalez,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Overview of rest-mex at iberlef 2021: Recommendation system for text mexican tourism</article-title>
          .
          <source>Procesamiento del Lenguaje Natural</source>
          <volume>67</volume>
          (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Arslan</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Arslan</surname>
          </string-name>
          , H.:
          <article-title>A new covid-19 detection method from human genome sequences using cpg island features and knn classi er</article-title>
          .
          <source>Engineering Science and Technology, an International Journal</source>
          <volume>24</volume>
          (
          <issue>4</issue>
          ),
          <volume>839</volume>
          {
          <fpage>847</fpage>
          (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>