Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

assignment notes of nlp, Assignments of Mathematics

assignment notes of natural language processing

Typology: Assignments

2022/2023

Uploaded on 11/29/2023

abhay-kumar-20
abhay-kumar-20 🇮🇳

1 document

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
UNIT 5
Semantic Analysis
The purpose of semantic analysis is to draw exact meaning, or you can say
dictionary meaning from the text. The work of semantic analyzer is to check the text
for meaningfulness.
We already know that lexical analysis also deals with the meaning of the words, then
how is semantic analysis different from lexical analysis? Lexical analysis is based on
smaller token but on the other side semantic analysis focuses on larger chunks. That
is why semantic analysis can be divided into the following two parts −
Studying meaning of individual word
It is the first part of the semantic analysis in which the study of the meaning of
individual words is performed. This part is called lexical semantics.
Studying the combination of individual words
In the second part, the individual words will be combined to provide meaning in
sentences.
The most important task of semantic analysis is to get the proper meaning of the
sentence. For example, analyze the sentence “Ram is great.” In this sentence, the
speaker is talking either about Lord Ram or about a person whose name is Ram.
That is why the job, to get the proper meaning of the sentence, of semantic analyzer
is important.
Elements of Semantic Analysis
Followings are some important elements of semantic analysis −
Hyponymy
It may be defined as the relationship between a generic term and instances of that
generic term. Here the generic term is called hypernym and its instances are called
hyponyms. For example, the word color is hypernym and the color blue, yellow etc.
are hyponyms.
Homonymy
It may be defined as the words having same spelling or same form but having
different and unrelated meaning. For example, the word “Bat” is a homonymy word
because bat can be an implement to hit a ball or bat is a nocturnal flying mammal
also.
Polysemy
Polysemy is a Greek word, which means “many signs”. It is a word or phrase with
different but related sense. In other words, we can say that polysemy has the same
spelling but different and related meaning. For example, the word “bank” is a
polysemy word having the following meanings −
A financial institution.
pf3
pf4
pf5

Partial preview of the text

Download assignment notes of nlp and more Assignments Mathematics in PDF only on Docsity!

UNIT 5

Semantic Analysis

The purpose of semantic analysis is to draw exact meaning, or you can say dictionary meaning from the text. The work of semantic analyzer is to check the text for meaningfulness. We already know that lexical analysis also deals with the meaning of the words, then how is semantic analysis different from lexical analysis? Lexical analysis is based on smaller token but on the other side semantic analysis focuses on larger chunks. That is why semantic analysis can be divided into the following two parts −

Studying meaning of individual word

It is the first part of the semantic analysis in which the study of the meaning of individual words is performed. This part is called lexical semantics.

Studying the combination of individual words

In the second part, the individual words will be combined to provide meaning in sentences. The most important task of semantic analysis is to get the proper meaning of the sentence. For example, analyze the sentence “Ram is great.” In this sentence, the speaker is talking either about Lord Ram or about a person whose name is Ram. That is why the job, to get the proper meaning of the sentence, of semantic analyzer is important.

Elements of Semantic Analysis

Followings are some important elements of semantic analysis −

Hyponymy

It may be defined as the relationship between a generic term and instances of that generic term. Here the generic term is called hypernym and its instances are called hyponyms. For example, the word color is hypernym and the color blue, yellow etc. are hyponyms.

Homonymy

It may be defined as the words having same spelling or same form but having different and unrelated meaning. For example, the word “Bat” is a homonymy word because bat can be an implement to hit a ball or bat is a nocturnal flying mammal also.

Polysemy

Polysemy is a Greek word, which means “many signs”. It is a word or phrase with different but related sense. In other words, we can say that polysemy has the same spelling but different and related meaning. For example, the word “bank” is a polysemy word having the following meanings − ● A financial institution.

● The building in which such an institution is located. ● A synonym for “to rely on”.

Difference between Polysemy and Homonymy

Both polysemy and homonymy words have the same syntax or spelling. The main difference between them is that in polysemy, the meanings of the words are related but in homonymy, the meanings of the words are not related. For example, if we talk about the same word “Bank”, we can write the meaning ‘a financial institution’ or ‘a river bank’. In that case it would be the example of homonym because the meanings are unrelated to each other.

Synonymy

It is the relation between two lexical items having different forms but expressing the same or a close meaning. Examples are ‘author/writer’, ‘fate/destiny’.

Antonymy

It is the relation between two lexical items having symmetry between their semantic components relative to an axis. The scope of antonymy is as follows − ● Application of property or not − Example is ‘life/death’, ‘certitude/incertitude’ ● Application of scalable property − Example is ‘rich/poor’, ‘hot/cold’ ● Application of a usage − Example is ‘father/son’, ‘moon/sun’.

Meaning Representation

Semantic analysis creates a representation of the meaning of a sentence. But before getting into the concept and approaches related to meaning representation, we need to understand the building blocks of semantic system.

Building Blocks of Semantic System

In word representation or representation of the meaning of the words, the following building blocks play an important role − ● Entities − It represents the individual such as a particular person, location etc. For example, Haryana. India, Ram all are entities. ● Concepts − It represents the general category of the individuals such as a person, city, etc. ● Relations − It represents the relationship between entities and concept. For example, Ram is a person. ● Predicates − It represents the verb structures. For example, semantic roles and case grammar are the examples of predicates. Now, we can understand that meaning representation shows how to put together the building blocks of semantic systems. In other words, it shows how to put together entities, concepts, relation and predicates to describe a situation. It also enables the reasoning about the semantic world.

Approaches to Meaning Representations

Semantic analysis uses the following approaches for the representation of meaning −

o First-order logic (like natural language) does not only assume that the world contains facts like propositional logic but also assumes the following things in the world: o Objects: A, B, people, numbers, colors, wars, theories, squares, pits, wumpus, ...... o Relations: It can be unary relation such as: red, round, is adjacent, or n-any relation such as: the sister of, brother of, has color, comes between o Function: Father of, best friend, third inning of, end of, ...... o As a natural language, first-order logic also has two main parts: a. Syntax a. Semantics Syntax of First-Order logic: The syntax of FOL determines which collection of symbols is a logical expression in first-order logic. The basic syntactic elements of first-order logic are symbols. We write statements in short-hand notation in FOL. Basic Elements of First-order logic: Following are the basic elements of FOL syntax: 48.8M 839 History of Java Constant 1, 2, A, John, Mumbai, cat,.... Variables x, y, z, a, b,.... Predicates Brother, Father, >,.... Function sqrt, LeftLegOf, .... Connectives (^) ∧, ∨, ¬, ⇒, ⇔ Equality == Quantifier (^) ∀, ∃ Atomic sentences: o Atomic sentences are the most basic sentences of first-order logic. These sentences are formed from a predicate symbol followed by a parenthesis with a sequence of terms. o We can represent atomic sentences as Predicate (term1, term2, ......, term n).

Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay). Chinky is a cat: => cat (Chinky). Complex Sentences: o Complex sentences are made by combining atomic sentences using connectives. First-order logic statements can be divided into two parts: o Subject: Subject is the main part of the statement. o Predicate: A predicate can be defined as a relation, which binds two atoms together in a statement. Consider the statement: "x is an integer." , it consists of two parts, the first part x is the subject of the statement and second part "is an integer," is known as a predicate.

CASE GRAMMER

Case Grammar Case Grammar was developed by Linguist Charles J. Fillmore in the year 1968. Case Grammar uses languages such as English to express the relationship between nouns and verbs by using the preposition. In Case Grammar, case roles can be defined to link certain kinds of verbs and objects. For example: "Neha broke the mirror with the hammer". In this example case grammar identify Neha as an agent, mirror as a theme, and hammer as an instrument. Semantic Network Representation Semantic networks are alternative of predicate logic for knowledge representation. In Semantic networks, we can represent our knowledge in the form of graphical networks. This network consists of nodes representing objects and arcs which describe the relationship between those objects. Semantic networks can categorize the object in different forms and can also link those objects. Semantic networks are easy to understand and can be easily extended.

Drawbacks in Semantic representation:

  1. Semantic networks take more computational time at runtime as we need to traverse the complete network tree to answer some questions. It might be possible in the worst case scenario that after traversing the entire tree, we find that the solution does not exist in this network.
  2. Semantic networks try to model human-like memory (Which has 1015 neurons and links) to store the information, but in practice, it is not possible to build such a vast semantic network.
  3. These types of representations are inadequate as they do not have any equivalent quantifier, e.g., for all, for some, none, etc.
  4. Semantic networks do not have any standard definition for the link names.
  5. These networks are not intelligent and depend on the creator of the system. Advantages of Semantic network:
  6. Semantic networks are a natural representation of knowledge.
  7. Semantic networks convey meaning in a transparent manner.
  8. These networks are simple and easily understandable.