Professional Documents
Culture Documents
Unit 6 Applications
Sentiment Analysis; Text Entailment; Robust and Scalable Machine Translation; Question
Answering in Multilingual Setting; Cross Lingual Information Retrieval (CLIR).
Natural Language Processing (NLP) is an emerging technology that derives various forms of AI
that we see in the present times and its use for creating a seamless as well as interactive interface
between humans and machines will continue to be a top priority for today’s and tomorrow’s
increasingly cognitive applications.
Sentiment
According to the survey,80% of the world’s data is unstructured. The data needs to be analyzed
and be in a structured manner whether it is in the form of emails, texts, documents, articles, and
many more.
1. Sentiment Analysis is required as it stores data in an efficient, cost-friendly.
2. Sentiment analysis solves real-time issues and can help you solve all real-time scenarios.
Types of Sentiment Analysis
1. Fine-grained sentiment analysis: This depends on the polarity base. This category can be
designed as very positive, positive, neutral, negative, or very negative. The rating is done on
a scale of 1 to 5. If the rating is 5 then it is very positive, 2 then negative, and 3 then neutral.
2. Emotion detection: The sentiments happy, sad, angry, upset, jolly, pleasant, and so on come
under emotion detection. It is also known as a lexicon method of sentiment analysis.
3. Aspect-based sentiment analysis: It focuses on a particular aspect for instance if a person
wants to check the feature of the cell phone then it checks the aspect such as the battery,
screen, and camera quality then aspect based is used.
4. Multilingual sentiment analysis: Multilingual consists of different languages where the
classification needs to be done as positive, negative, and neutral. This is highly challenging
and comparatively difficult.
How does Sentiment Analysis work?
There are three approaches used:
1. Rule-based approach: Over here, the lexicon method, tokenization, and parsing come in
the rule-based. The approach is that counts the number of positive and negative words in the
given dataset. If the number of positive words is greater than the number of negative words
then the sentiment is positive else vice-versa.
2. Machine Learning Approach: This approach works on the machine learning technique.
Firstly, the datasets are trained and predictive analysis is done. The next process is the
extraction of words from the text is done. This text extraction can be done using different
techniques such as Naive Bayes, Support Vector machines, hidden Markov model, and
conditional random fields like this machine learning techniques are used.
3. Neural network Approach: In the last few years neural networks have evolved at a very
rate. It involves using artificial neural networks, which are inspired by the structure of the
human brain, to classify text into positive, negative, or neutral sentiments. it has Recurrent
neural networks, Long short-term memory, Gated recurrent unit, etc to process sequential
data like text.
4. Hybrid Approach: It is the combination of two or more approaches i.e. rule-based
and Machine Learning approaches. The surplus is that the accuracy is high compared to the
other two approaches.
Applications
Sentiment Analysis has a wide range of applications as:
1. Social Media: If for instance the comments on social media side as Instagram, over here all
the reviews are analyzed and categorized as positive, negative, and neutral.
2. Customer Service: In the play store, all the comments in the form of 1 to 5 are done with the
help of sentiment analysis approaches.
3. Marketing Sector: In the marketing area where a particular product needs to be reviewed as
good or bad.
4. Reviewer side: All the reviewers will have a look at the comments and will check and give
the overall review of the product.
Challenges of Sentiment Analysis
There are major challenges in the sentiment analysis approach:
1. If the data is in the form of a tone, then it becomes really difficult to detect whether the
comment is pessimist or optimistic.
2. If the data is in the form of emoji, then you need to detect whether it is good or bad.
3. Even the ironic, sarcastic, comparing comments detection is really hard.
4. Comparing a neutral statement is a big task.
Example of Sentiment Analysis
Sentiment Analysis of Hindi Text – Python
Facebook Sentiment Analysis using python
Twitter Sentiment Analysis using Python
Sentiment Analysis with Recurrent Neural Networks (RNN)
Emotion Detection using Bidirectional LSTM
Sentiment Classification Using BERT
______________________________________________________________________________
Sentiment analysis focuses on the polarity of a text (positive, negative, neutral) but it also goes
beyond polarity to detect specific feelings and emotions (angry, happy, sad, etc), urgency
(urgent, not urgent) and even intentions (interested v. not interested).
Depending on how you want to interpret customer feedback and queries, you can define and
tailor your categories to meet your sentiment analysis needs. In the meantime, here are some of
the most popular types of sentiment analysis:
If polarity precision is important to your business, you might consider expanding your polarity
categories to include different levels of positive and negative:
Very positive
Positive
Neutral
Negative
Very negative
This is usually referred to as graded or fine-grained sentiment analysis, and could be used to
interpret 5-star ratings in a review, for example:
Emotion detection
Emotion detection sentiment analysis allows you to go beyond polarity to detect emotions, like
happiness, frustration, anger, and sadness.
Many emotion detection systems use lexicons (i.e. lists of words and the emotions they convey)
or complex machine learning algorithms.
One of the downsides of using lexicons is that people express emotions in different ways. Some
words that typically express anger, like bad or kill (e.g. your product is so bad or your customer
support is killing me) might also express happiness (e.g. this is bad ass or you are killing it).
Usually, when analyzing sentiments of texts you’ll want to know which particular aspects or
features people are mentioning in a positive, neutral, or negative way.
That's where aspect-based sentiment analysis can help, for example in this product review: "The
battery life of this camera is too short", an aspect-based classifier would be able to determine
that the sentence expresses a negative opinion about the battery life of the product in question.
Multilingual sentiment analysis can be difficult. It involves a lot of preprocessing and resources.
Most of these resources are available online (e.g. sentiment lexicons), while others need to be
created (e.g. translated corpora or noise detection algorithms), but you’ll need to know how to
code to use them.
Alternatively, you could detect language in texts automatically with a language classifier, then
train a custom sentiment analysis model to classify texts in the language of your choice.
Since humans express their thoughts and feelings more openly than ever before, sentiment
analysis is fast becoming an essential tool to monitor and understand sentiment in all types of
data.
Automatically analyzing customer feedback, such as opinions in survey responses and social
media conversations, allows brands to learn what makes customers happy or frustrated, so that
they can tailor products and services to meet their customers’ needs.
For example, using sentiment analysis to automatically analyze 4,000+ open-ended responses in
your customer satisfaction surveys could help you discover why customers are happy or unhappy
at each stage of the customer journey.
Maybe you want to track brand sentiment so you can detect disgruntled customers immediately
and respond as soon as possible. Maybe you want to compare sentiment from one quarter to the
next to see if you need to take action. Then you could dig deeper into your qualitative data to see
why sentiment is falling or rising.
Can you imagine manually sorting through thousands of tweets, customer support conversations,
or surveys? There’s just too much business data to process manually. Sentiment analysis helps
businesses process huge amounts of unstructured data in an efficient and cost-effective way.
Real-Time Analysis
Sentiment analysis can identify critical issues in real-time, for example is a PR crisis on social
media escalating? Is an angry customer about to churn? Sentiment analysis models can help you
immediately identify these kinds of situations, so you can take action right away.
Consistent criteria
It’s estimated that people only agree around 60-65% of the time when determining the sentiment
of a particular text. Tagging text by sentiment is highly subjective, influenced by personal
experiences, thoughts, and beliefs.
By using a centralized sentiment analysis system, companies can apply the same criteria to all of
their data, helping them improve accuracy and gain better insights.
The applications of sentiment analysis are endless. So, to help you understand how sentiment
analysis could benefit your business, let’s take a look at some examples of texts that you could
analyze using sentiment analysis.
Then, we’ll jump into a real-world example of how Chewy, a pet supplies company, was able to
gain a much more nuanced (and useful!) understanding of their reviews through the application
of sentiment analysis.
To understand the goal and challenges of sentiment analysis, here are some examples:
• Other QA ex: “Who owns Overture?” “Yahoo acquired Overture” “Overture’s acquisition by
Yahoo”, …
In IE entailment holds between different text variants that express the same target relation:
(X kill Y X acquire Y)
• In MDS a redundant sentence or expression, to be omitted from the summary, should be
entailed from other expressions in the summary.
• In IR the concept denoted by a query expression should be entailed from relevant retrieved
documents.
• In MT evaluation a correct translation should be semantically equivalent to the gold standard
translation, and thus both translations have to entail each other.
• Thus, in a similar spirit to WSD and NER which are recognized as generic tasks, modeling
textual entailment may consolidate and promote broad research on applied semantic inference.
Information Extraction
Information Retrieval
Multi-Document Summarization
Named Entity Recognition
Temporal and Spatial Normalization
Semantic Parsing
Natural Language Generation
Textual entailment (TE), also known as Natural Language Inference (NLI), in natural language
processing is a directional relation between text fragments. The relation holds whenever the truth
of one text fragment follows from another text. In the TE framework, the entailing and entailed
texts are termed text (t) and hypothesis (h), respectively. Textual entailment is not the same as
pure logical entailment – it has a more relaxed definition: "t entails h" (t ⇒ h) if, typically, a human
reading t would infer that h is most likely true. (Alternatively: t ⇒ h if and only if, typically, a
human reading t would be justified in inferring the proposition expressed by h from the proposition
expressed by t.) The relation is directional because even if "t entails h", the reverse "h entails t" is
much less certain.
Determining whether this relationship holds is an informal task, one which sometimes overlaps
with the formal tasks of formal semantics (satisfying a strict condition will usually imply
satisfaction of a less strict conditioned); additionally, textual entailment partially subsumes word
entailment.
Examples
Textual entailment can be illustrated with examples of three different relations: [5]
An example of a positive TE (text entails hypothesis) is:
same meaning and creating a similar or shorter text that conveys almost the same information.
Textual entailment is similar but weakens the relationship to be unidirectional. Mathematical
solutions to establish textual entailment can be based on the directional property of this relation,
by making a comparison between some directional similarities of the texts involved.
Approaches
Textual entailment measures natural language understanding as it asks for a semantic
interpretation of the text, and due to its generality remains an active area of research. Many
approaches and refinements of approaches have been considered, such as word embedding, logical
models, graphical models, rule systems, contextual focusing, and machine learning .Practical or
large-scale solutions avoid these complex methods and instead use only surface syntax or lexical
relationships, but are correspondingly less accurate. However, even state-of-the-art systems are
still far from human performance; a study found humans to be in agreement on the dataset 95.25%
of the time, while algorithms from 2016 had not yet achieved 90%.
Applications
Many natural language processing applications, like question answering, information
extraction, summarization, multi-document summarization, and evaluation of machine
translation systems, need to recognize that a particular target meaning can be inferred from
different text variants. Typically entailment is used as part of a larger system, for example in a
prediction system to filter out trivial or obvious predictions.Textual entailment also has
applications in adversarial stylometry, which has the objective of removing textual style without
changing the overall meaning of communication.
Machine translation (MT), process of translating one source language or text into another
language, is one of the most important applications of NLP. We can understand the process of
machine translation with the help of the following flowchart −
The systems that use Interlingua approach translate SL to an intermediate language called
Interlingua (IL) and then translate IL to TL. The Interlingua approach can be understood with the
help of the following MT pyramid −
3. Transfer Approach
Three stages are involved with this approach.
In the first stage, source language (SL) texts are converted to abstract SL-oriented
representations.
In the second stage, SL-oriented representations are converted into equivalent target
language (TL)-oriented representations.
In the third stage, the final text is generated.
4. Empirical MT Approach
This is an emerging approach for MT. Basically, it uses large amount of raw data in the form of
parallel corpora. The raw data consists of the text and their translations. Analogy based, example-
based, memory-based machine translation techniques use empirical MTapproach.
Several multilingual QA systems have been built in the last few years, all seeking to overcome not
only the challenges of monolingual QA but also to overcome the issue of accessing and retrieving
information in multiple languages. The majority, however, are based on translating relevant
sections of the question – usually with the aid of machine translation system - which are then used
The traditional architecture of a monolingual QA system considers three basic modules: (i)
question classification, where the type of expected answer is determined, (ii) passage retrieval,
where the passages with the greatest probability to contain the answer are obtained from the target
document collection, and (iii) answer extraction, where candidate answers are ranked and the final
answer recommendation of the system is produced. In addition, a multilingual QA system must
include two other modules, one for question translation and another for information merging. The
purpose of the first module is to translate the input question to all target languages, whereas the
second module is intended to integrate the information extracted from these languages into one
single ranked list.
Figures 1 and 2 show two different architectures for multilingual QA. For the sake of simplicity,
in both cases we do not consider the module for question classification. On one hand, Figure 1
shows a multilingual QA architecture that does the information merging at passage level. The idea
of this approach is to perform in parallel the recovery of relevant passages from all collections
(i.e., from all different languages), then integrate these passages into one single ranked list, and
finally, extract the answer from the combined set of passages. On the contrary, Figure 2 illustrates
an architecture that achieves the information merging at answer level. In this case, the idea is to
perform the complete QA process independently in all languages, and after that, integrate the sets
of answers into one single ranked list.
It is important to mention that merging processes normally rely on the translation of information
to a common language. This translation is required for some merging strategies in order to be able
to compare and rank the passages and answers extracted from different languages. The two
proposed architectures have different advantages and disadvantages. For instance, doing the
information merging at passage level commonly allows obtaining better translations for named
entities (possible answers) since they are immerse in an extended context. On the other hand, doing
the merging at answer level has the advantage of a clear (unambiguous) comparison of the
multilingual information. In other words, comparing two answers (named entities) is a
straightforward step, whereas comparing two passages requires the definition of a similarity
measure and the determination of a criterion about how similar two different passages should be
in order to be considered as equal. This previous problem is not present in monolingual QA
ensembles, since in that case all individual QA systems search on the same document collection.
Given several sets of relevant passages obtained from different languages, the procedure for
passage merging considers the following two basic steps:
1. Translate all passages to one common language. This translation can be done by means of any
translation method or online translation machine. However, we suggest translating all passages
into the original question’s language in order to avoid translation errors in at least one passage set.
It is important to clarify that translation is only required by the CombSUM and CombMNZ
strategies. Nevertheless, all passages should be translated to one common language before entering
the answer extraction module.
2. Combine the sets of passages according to a selected merging strategy. In the case of using the
Round Robin or RSV approaches, the combination of passages is straightforward. In contrast,
when applying CombSUM or CombMNZ, it is necessary to determine the occurrence of a given
passage in two or more collections. Given that it is practically impossible to obtain exactly the
same passage from two different collections, it is necessary to define a criterion about how similar
two different passages should be in order to be considered as equal. In particular, we measure the
similarity of two passages by the Jaccard function (calculated as the cardinality of their vocabulary
intersection divided by the cardinality of their vocabulary union) and consider them as equal only
if their similarity is greater than a given specified threshold (empirically we set the threshold value
to 0.5). The procedure for answer merging is practically the same as that for passage merging. It
also includes one step for answer translation and another step for answer combination. However,
the combination of answers is much simpler than the combination of passages, since they are
directly comparables. In this case, the application of all merging strategies is straightforward.
******************