Pragmatics in NLP

Learn via video courses
Topics Covered

Overview

The study of pragmatics examines how context influences meaning, including how statements are perceived in various contexts. The pragmatic analysis deals with word knowledge outside of texts and queries, which is comprehension. The many components of language that require real-world knowledge are derived from the pragmatic analysis that focuses on what was described and is reinterpreted by what it truly meant.

Pre-requisites

  • A basic understanding of discourse in NLP.
  • Familiarity with terms such as semantics, linguistics, context and utterance.

Introduction

Let's take this sentence - The kids have eaten already, and surprisingly, they are hungry. Had this sentence been - "They are hungry" would we have gained any context? This context helps us to interpret the second sentence better, depending on what the first sentence says. The situational context aids in the interpretation of the second clause because it is well-known that people do not typically feel hungry after eating.

The study of pragmatics examines how context influences meaning, including how statements are perceived in various contexts (or the interpretation of linguistic meaning in context). Situational context is world information, whereas linguistic context is a language that comes before a statement to be understood. Now that YOU have gained some context, let's formally define and discuss pragmatics in nlp in detail.

What is Pragmatics in NLP?

Here are two definitions that were given for the term Pragmatics in nlp:

  • In 1962, Austin = Pragmatics is the study of "how to do things with words".
  • In 2003, Leech & Weisser = Pragmatics is the branch of linguistics that seeks to explain the meaning of linguistics messages in terms of their context of use".

Pragmatic analysis deals with word knowledge outside of texts and queries, which is comprehension. The many components of language that require real-world knowledge are derived from the pragmatic analysis that focuses on what was described and is reinterpreted by what it truly meant. It discusses the entire communicative and social content and how interpretation is impacted by it. It entails removing the context from which language is meaningfully used. In this approach, what was stated is constantly the major focus and what was meant is constantly the secondary focus. Using a set of guidelines that characterize cooperative dialogues, aids users in discovering the intended outcome. For instance, "shut the window?" should be taken as a request rather than an order.

Formally defining pragmatics in nlp, we can say that it is the study of practical aspects of human action and thought or the study of the use of linguistic signs, words, and sentences in actual situations.

What Would Happen if Pragmatics Didn't Exist?

All linguistic contact and exchanges are based on pragmatics. It is an essential component of language comprehension and the responses that result from it. Therefore, there would be little knowledge of intention and meaning without the function of pragmatics.

We want to show you what life would be like without pragmatics to illustrate this.

'Can you pass the salt?'

Literal Meaning: Are you physically capable of doing this task? Literal Answer: "Yes"

(Pragmatic Intention: Could you pass the salt my way? Pragmatic Reaction: Hand the speaker the salt.)

'What time do you call this?'

Literal Meaning: What time is it, literally? Literal Reaction: A time (for example, "twenty to one").

(Pragmatic Meaning: a different question entirely, e.g. Why are you so late? Pragmatic Response: Explain the reason for being so late.)

Difference Between Pragmatics and Semantics

Now semantics is a term that sounds similar to pragmatics. Semantics is the study of meaning and helps get a sense of meaning in context to speakers, writers, readers, or even learners. So how is it different from pragmatics in nlp?

Semantics is one area of linguistics, whereas pragmatics is another. Pragmatics focuses on concerns of usage, whereas Semantics is all about questions of meaning. It addresses the part of the meaning that depends on context. Semantics examines the mystery of what signs mean. Pragmatics, on the other hand, examines how signs relate to their users and interpreters.

CriteriaSemanticsPragmatics
DefinitionThe word semantics comes from the Greek word seme, which means to sigh. Another significant area connected to theoretical linguistics is semantics. It all comes down to understanding how language terms are meant.Pragmatics understands the language's meaning but keeps the context in mind.
FocusMeaningUse of Language
ScopeSince it deals with only the meaning, narrow.Since pragmatics deals with aspects beyond text, the scope is broad.
Meaning of an utteranceContext independentContext Dependent
Governed byGeneral RulesPrinciples
ExampleThe conditions under which the proposition stated by a sentence is true are the subject of semantics. The term "truth conditions" refers to these. If and only if the red cup is actually on the table, the statement "The red cup is on the table" is True.The speaker's statement that "It is quite cold" means that the temperature is low (semantic approach), among other things. The speaker may have included the phrase "it is quite cold" as a linked sentence because they wanted to turn on the blower. A pragmatic could also like to consider this.

Pragmatics and NLP: Discourse Processing

While talking about Pragmatics in NLP, we've been going on about context and its importance in actually processing text. There are 3 main types of context - discourse context, physical context, and social context.

  • Discourse context: Discourse context is where an utterance sits about a document, conversation, speech, etc.
  • Physical context: Provides information about the physical aspect
  • Social context: Social context is all about answering questions such as - who is speaking, who are they speaking to, and, what are they trying to achieve.

To understand this better, let's take two pairs of sentences.

"Anshul hid my car keys. He was drunk."

And,

"Anshul hid my car keys. He likes Lychees."

The coherent structure of language above the level of sentences or clauses is known as discourse. A discourse is a logically organized collection of sentences. What factors into a passage's coherence? It has meaningful connections between its utterances that are significant, to put it simply. In the above example, we have two pairs of statements. The first pair are related. It explains why the keys were hidden. However, the second pair of statements are not related or do not have any meaningful connection.

Now that we have understood that discourse or discourse analysis is all about context, we have spotted the link between pragmatics and discourse processing.

In the field of discourse processing, we have what we call reference processing which is essentially the extraction of the meaning or interpretation of the sentences of discourse. And to extract this interpretation, to determine the entities that are being referred to by the linguistic expressions, we have certain aspects.

Anaphora Resolution

To understand anaphora resolution, we must first understand the terms anaphora, anaphoric and antecedent. The referring expression is termed anaphoric. Anaphora & Anaphoric can be said as the term or reference used for an entity that has previously been introduced in the same sentence. The term that has been licensed to use another term is termed antecedent. For example, in the pair of sentences "Anshul hid my car keys. He was drunk.", 'Anshul' is the antecedent of the reference 'He'.

Now, Anaphora Resolution is the task of identifying the antecedent of the anaphora. Anaphora resolution is required in various NLP applications such as information extraction, summarization, and Machine translation.

Natural Language Generation

The act of producing narratives or descriptions in natural language from structured data is known as natural language generation (NLG).

A branch of natural language processing is called natural language generation (NLG). Another NLP sub-discipline called Natural Language Understanding (NLU) frequently collaborates closely with NLG. NLU assists in creating a structured representation from unstructured text input that NLG can use. Our brain uses more energy to create language than to understand it. Similarly, computers can perceive NLG to be more challenging than NLU. NLG must include in its response information that's most relevant to the user in the current context.

pragmatics-in-nlp

Now, in natural language generation, we have 3 main aspects to take into account. They are -

  • Discourse planning. Discourse planning includes templates (pre-defined text frames) and certain algorithms that are based on discourse theories such as the Rhetorical Structure Theory.
  • Sentence Planning. Sentence planning includes generating text with sentence aggregation, generation of referring expressions, and lexical selection.
  • Surface Realization. This aspect includes word order & agreement control along with graphic realization etc.

When it comes to natural language generation, there are two main issues - cohesion and coherence which are out of scope for this article.

Information Extraction & Text Summarization

In the two use cases information extraction and text summarization, pragmatics or the understanding of context is very important.

pragmatics-in-nlp3

When it comes to information extraction with the help of concepts of pragmatics, we can generate more precise answers to certain questions to extract information. Although there is not a lot of research work done in the field, the paper titled "Question Answering System of Confucian Analects based on Pragmatics Information and Categories" by Ye Yang, Song Liu, Shingo K, and Fuji Ren explains pragmatic information extraction based on paragraph acts.

When it comes to text summarization, there are different kinds of summaries.

Concerning the content:

  • Indicative Indicative summaries provide an idea about the text
  • Informative: Informative summaries are essentially shortened versions of the text.

Concerning the way of creating the summary:

  • Extractive: Extractive summaries use phrases directly from the input text.
  • Abstractive: Abstractive summaries re-generative text that reflects the important content in the input text (Information Extraction and Natural Language Generation).
  • Compressed Texts: These summaries compress parse trees to get short versions of input text.
  • Dialogue Summarization: This summarization technique selects successful dialogue transactions to add into the summary.

Machine Translation

Machine translation is the process of translating text from one language into another while utilizing computational models that are capable of precisely comprehending the semantic grouping of items. Traditional translation language models were cumbersome and prone to errors since they required access to online dictionaries, text transmission channels, and terminology data storage. The best machine translation program must account for certain variables because human language is incredibly flexible, contains peculiarities, and is inherently ambiguous.

Computer-Assisted Language Learning

Levy provides a succinct definition of computer-assisted language learning (CALL) as "the search for and study of applications of the computer in language teaching and learning." CALL includes a variety of applications and methods for teaching and studying foreign languages using information and communications technology.

NLP has been used in CALL in a variety of ways, such as to align bilingual texts so that a learner who comes across an unfamiliar word in French can see how it was translated; to provide lemmatized access to corpora for advanced learners seeking nuances unavailable in grammars and dictionaries; to provide morphological analysis and subsequent dictionary access for words unknown to readers; to parse user input and diagnose morphological anagrams; and to parse user input and diagnose morphological and syntactic errors.99*

pragmatics-in-nlp4

Conclusion

  • Pragmatics is the study of practical aspects of human action and thought or the study of the use of linguistic signs, words, and sentences in actual situations.
  • Semantics comes down to understanding how language terms are meant. While pragmatics understands the language's meaning but keeps the context in mind.
  • There are three main types of context - discourse, physical and social.
  • Reference processing is the extraction of the meaning or interpretation of the sentences of discourse. The main components of reference processing are -
    • Anaphora resolution - the task of identifying the antecedent of the anaphora.
    • Natural Language Generation - the act of producing narratives or descriptions in natural language from structured data.
    • Information Extraction & Text Summarization.
    • Machine Translation - the process of translating text from one language into another while utilizing computational models that are capable of precisely comprehending the semantic grouping of items.
    • CALL - Computer-Assisted Language Learning.