A Comparative Analysis of Emotion and Sentiment Analysis Method from Twitter Text

The Study of Sentiment is an area of science that specializes in the analysis of strong emotions expressed in texts. An opinion is a complete perception of a commodity, service, association, individual or some other form of entity about which a given text is conveyed. This work provides valuable knowledge of the roots of sentiment analysis and how sentiment evaluators can be configured. We demonstrated how to construct a basic classifier and use it as an example. These approaches will eventually change and there will still be the need for a more extensive assessment of emotions. Non-textual material has an important significance in analyses. Photos, photographs, animations and other visual material are also useful in performing social research. Of course, I can see that all these hyperlinks provide essential material. Some other ways of using social media are likes, retweets, reviews on posts and much more! It is hoped that common issues such as avoiding irony and sarcasm would be made less ambiguous. However, there will emerge other issues that will have to be tackled.

Usually, the input text is processed by a technique known as tokenization. This tries to identify the minimum units of information, known as tokens, by dividing sentences into individual words, punctuation marks and other elements. The tokens are treated by each of the components or levels of the architecture until finally the text provided as input is understood by the system: As indicated above, depending on the NFP system to be developed, the implementation of different analysis components will be necessary. For example, for an automatic translation system, the levels of morphological and syntactic analysis are sufficient [13]. On the other hand, a virtual assistant also needs to understand the meaning of the user's commands, so it will be necessary to have semantic and pragmatic analysis components as well.

1.4Approach and Method Followed
The analysis of Sentiments, and especially that which focuses its scope on social networks, is a field of research of recent appearance. The main source of information can be found in the research studies published by universities around the world, which can reach several hundred each year. Together with the popular articles on sentiment analysis that can be consulted on the Internet, this will be the main source of knowledge on which this PAPER will be based. Therefore, the strategy consists of compiling this type of publication using specialised

Research Article
academic search engines such as Google Scholar , Springer Link, Dialnet, BASE or the UOC's online library. Subsequently, the studies with the greatest number of citations should be detected and the most important concepts and techniques used to solve the problem of classifying texts based on Sentiment should be extracted from them. The next step will be to look for tools to build automated classification systems following the indications of the publications consulted, as well as the various examples that already exist on the Internet. In addition, special consideration will be given to the knowledge acquired in the subject of Advanced Artificial Intelligence and the practices carried out with the Python language13 and machine learning libraries such as Scikit-Learn14

Motivation
The field of Artificial Intelligence deals with computer programmes that can identify subtle correlations in data, and generate predictions and assumptions based on those connections. This data will offer countless insight into future problems faced by people and social classes on the planet. As developments unfold, the massive deployment of automatic learning technologies would make it easier to meet goals that would seem like science fiction in the future.

2.Background Analysis & Review
Sentiment level analysis is probably the one to which a greater percentage of the studies published each year on this area of research are devoted and its main objective is to classify a document based on the Sentiment it expresses. This task is also known as classification of Sentiments in documents. Documents are considered the basic units of information and these can be opinions in blogs, online shops, specialised websites or messages in social networks. The opinion generally takes a value from among three possible ones: positive, negative or neutral Sentiment, although, as we will see below, there are also other scales and these can also be numerical, continuous or discrete.Taking as a starting point the formal definition of opinion described in previous sections, the classification of sentiment at document level can be represented by the following fivefold: ( , GENERAL, s, , ) Thus, given sentiment, this level of analysis tries to determine the Sentiment s of the GENERAL aspect of the entity e. Entity e, the author of opinion h and the time when it was issued t are known or irrelevant. The value s can be one of several categories available (e.g. positive, negative or neutral) or a numerical value (e.g. a value between 1 and 5). The first case is known as classification while the second is called regression.In order to ensure that this classification process can be carried out, it is necessary to assume that the document to be classified expresses an opinion about a single entity and that this opinion belongs to a single person. Therefore, if a text expresses opinions on different entities, their assessments or Sentiments could be different from each other, which would prevent the classification of the global document in a single category. The same is true if several people express their opinion in that text. In this case, it is possible that their opinions are different so the classification process would fail for the same reason as the previous example. In any case, this type of sentiment analysis is appropriate for product and service reviews and can also be applied to social media messages. In all cases and in general, the text is written by a single person and usually deals with a single topic or entity.

Methods for the Classification of Documents
To carry out the classification of a document based on its sentiment, there are various methods and techniques that are being refined and improved as research on this subject advances and new studies and works appear on the scene. Despite the multitude of articles and publications presented each year, an issue that shows a current of research in full swing and growth, there does not seem to be a clear consensus on which techniques should be used to obtain the best results in the process of classifying texts. And it is because of this large number of publications and a field of research that is undergoing a process of strong expansion that it is not easy to establish a clear division of the methods that currently exist. Even so, several authors such as [17] or [18] establish two main groups, supervised and unsupervised methods and the latter in turn based on dictionaries or linguistic relations.

3.Proposed Work
This section will present a method for solving the problem of classifying texts by their sentiment at document level. These sentiment will be messages that have been published on the social network Twitter and the chosen method will be based on supervised learning algorithms. For this, it will be necessary to have a training corpus whose examples must have been previously labelled with the category of the Sentiment to which they belong. In this section several algorithms will be trained using different techniques and the necessary steps to create the models will be detailed. From all the possible combinations, the best one will be chosen based on a series of measures widely used to evaluate this type of system.

Sentimental Analysis on Twitter
There are two main groups of methods for solving the problem of sentiment classification: supervised methods and unsupervised methods. In this paper a supervised solution will be shown, based on automatic learning algorithms and trained through a corpus formed by thousands of tweets manually classified by a group of people. This test is divided into two parts. In the first one, the effectiveness of several algorithms trained with the messages of the corpus will be tested and on which different standardization techniques, feature extraction and

Research Article
Rajoy: "We will try to share the costs of this economic crisis fairly. The first duty of a ruler is to be fair.
(tweetId: 14647140390777152. Polarity: NEU -AGREEMENT) weighting methods will have been applied. The best combination, the baseline 21 classifier, will move to a second phase to try to improve the results of the model through new feature extraction techniques. The following sections will present the message corpus and the four self-learning algorithms selected for this practice, as well as the metrics to be used to objectively determine the best configured classifiers. We will close this section with the conclusions drawn from these experiments. On a technical level, it should be noted that the models will be written in Python22 and specific libraries will be used for this type of development, such as NLTK23, which specialises in language processing and Scikit-Learn24, which offers resources for the implementation of automatic learning systems. The messages in the corpus are classified into four and six categories of Sentiment: Very positive (P+), Positive (P), Neutral (NEU), Negative (N), Very negative (N+) and No Sentiment (NONE). From these six categories and by unifying the messages divided by their intensity into unique groups, the classification system based on four classes is obtained: Positive (P), Neutral (NEU), Negative and No Sentiment (NONE). This will be the classification on which the TFM tests will be based. Before continuing, it is necessary to explain the difference between messages without Sentiment (NONE) and neutral messages (NEU). The former are precisely that, tweets in which no positive or negative idea is expressed. For example: On the other hand, neutral messages (NEU) have a Sentiment halfway between positive and negative and this can be due to two reasons: that the words used are really neutral (AGREEMENT) or that they contain both positive and negative words in the same message (DISAGREEMENT): The messages from these three corpuses have been sorted by hand. Because they have a different format, a new global corpus will be created from the union of all of them, but with the strictly necessary information to train the supervised learning algorithms. The following table shows the number of tweets in each class and for each of the collections to which they belong: It is not difficult to see the great difference between the number of messages classified as neutral and the rest of the messages. Although the ideal in this type of test is that there is a balance between the number of samples of each class, sometimes this is not possible. This situation should be taken into account when measuring the effectiveness of classifiers.

Metrics and Methods of Performance Evaluation
In order to determine the performance of the algorithms and their configuration, a series of measures are needed to objectively evaluate their effectiveness in classifying the examples provided. In order to do so, it is important not only to take into account the correctly and incorrectly classified samples, but also those that, having been classified incorrectly, could have labeled well. To understand the four possible states of an example to be classified, let us think of a class A and an algorithm that determines whether or not the example belongs to that class: a)  FN): this group will include examples marked as not belonging to class A, but in reality they are and therefore have not been correctly classified. Taking into account the above states, we can define the following measures that will be used to evaluate our models: e) Accuracy: this is the simplest and most intuitive measure of performance and represents the ratio of correct predictions to total predictions made. In other words, it is the number of items correctly ranked among the total number of rankings performed.
It is common to think that the model that offers greater accuracy is the best model. In fact, this measure is appropriate in the case that the number of elements in each class is approximately the same and the corpus is balanced. Otherwise, it is necessary to make use of other types of measurements such as accuracy, completeness and F-value. Contrary to accuracy, these measures do not evaluate the performance of the model taking into account all the classes of the system, but they do it on individual classes. In other words, accuracy, completeness and F-value will give different values for class A and B. a) Precision: is the ratio between the number of documents correctly classified as belonging to Class A and the total number of documents that have been classified by the model as Class A.
Accuracy measures the proportion of positive identifications that are actually correct. Note that its value increases as the number of false positives decreases.

b) Completeness (from Recall): is the relationship between documents correctly classified as belonging to Class A and the sum of all Class A documents.
Coverage is the proportion of actual positive elements correctly identified. It can also be seen as the model's ability to construct classes correctly. The closer to 1, the better defined the different classes are, as their value increases as the number of false negatives decreases. c) F-value (F-score): It is common for the coverage and completeness values to be used to measure the efficiency of a rating model. For this purpose, the F-value is presented as the harmonic mean between both measures and is usually used as a reference to compare the performance between several models. The F-value formula combines the two previous measures in a weighted way through a parameter which allows giving more importance to one than to the other. d) * Precision and completeness often have the same weight in the formula, i.e. with a value equal to 1. This setting is known as F1-value or F1-score. In the case of a system with more than two classes, such as ours, each of the above metrics must be calculated for each class and combined between them to obtain an overall measurement. e) Macro-averaging: in this case the measurements of each class are calculated and then the arithmetic mean is calculated:

4.Experimental Result
In this section we analysis the resultusing different algorithum to check the performance.  There is no doubt that the winning algorithm is the support vector machine and, the one with the worst results in general terms, random Forest. However, in one of the experiments it manages to obtain a higher yield than the decision trees, thus coming in third position. This bar chart shows the best values for the four tested algorithms:

Conclusion
This work provides valuable knowledge of the roots of sentiment analysis and how sentiment evaluators can be configured. We demonstrated how to construct a basic classifier and use it as an example. These approaches will eventually change and there will still be the need for a more extensive assessment of emotions. Non-textual material has an important significance in analyses. Photos, photographs, animations and other visual material are also useful in performing social research. Of course I can see that all these hyperlinks provide essential material. Some other ways of using social media are likes, retweets, reviews on posts and much more! It is hoped that common issues such as avoiding irony and sarcasm would be made less ambiguous. However, there will emerge other issues that will have to be tackled.