Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Python Natural Language Processing

You're reading from   Python Natural Language Processing Advanced machine learning and deep learning techniques for natural language processing

Arrow left icon
Product type Paperback
Published in Jul 2017
Publisher Packt
ISBN-13 9781787121423
Length 486 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Jalaj Thanaki Jalaj Thanaki
Author Profile Icon Jalaj Thanaki
Jalaj Thanaki
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Introduction FREE CHAPTER 2. Practical Understanding of a Corpus and Dataset 3. Understanding the Structure of a Sentences 4. Preprocessing 5. Feature Engineering and NLP Algorithms 6. Advanced Feature Engineering and NLP Algorithms 7. Rule-Based System for NLP 8. Machine Learning for NLP Problems 9. Deep Learning for NLU and NLG Problems 10. Advanced Tools 11. How to Improve Your NLP Skills 12. Installation Guide

Semantic analysis

Semantic analysis is basically focused on the meaning of the NL. Its definition, various elements of it, and its application are explored in this section.

Now let's begin our semantic journey, which is quite interesting if you want to do some cool research in this branch.

What is semantic analysis?

Semantic analysis is generating representation for meaning of the NL. You might think, if lexical analysis also focuses on the meaning of the words given in stream of text, then what is the difference between semantic analysis and lexical analysis? The answer is that lexical analysis is based on smaller tokens; its focus is on meaning of the words, but semantic analysis focuses on larger chunks. Semantic analysis can be performed at the phrase level, sentence level, paragraph level, and sometimes at the document level as well. Semantic analysis can be divided into two parts, as follows:

  • The study of the meaning of the individual word is called lexical semantics
  • The study of how individual words combine to provide meaning in sentences or paragraphs in the context of dealing with a larger unit of NL

I want to give an example. If you have a sentence such as the white house is great, this can mean the statement is in context of the White House in the USA, whereas it is also possible the statement is literally talking about a house nearby, whose color is white is great. So, getting the proper meaning of the sentence is the task of semantic analysis.

Lexical semantics

Lexical semantics includes words, sub-words, or sub-units such as affixes, and even compound words, and phrases. Here words, sub-words and so on called lexical items.

The study of lexical semantics includes the following points:

  • Classification of lexical items
  • Decomposition of lexical items
  • Differences and similarities between various lexical semantic structures
  • Lexical semantics is the relationship among lexical items, meaning of the sentences and syntax of the sentence

Let's see the various elements that are part of semantic analysis.

Hyponymy and hyponyms

Hyponymy describes the relationship between a generic term and instances of the specified generic term. Here, a generic term is called a hypernym, and instances of the generic term are called hyponyms.

So, color is a hypernym; red, green, yellow, and so on are hyponyms.

Homonymy

Homonyms are words that have a same syntax or same spelling or same form but their meaning are different and unrelated to each other.

The word bank is a classic example. It can mean a financial institution or a river bank, among other things.

Polysemy

In order to understand polysemy, we are focused on words of the sentences. Polysemy is a word or phrase which have different, but related senses. These kinds of words are also referred as lexically ambiguous words.

Take the word bank. There are several senses or meaning you can consider.

  • Bank is financial institution
  • Bank can be interpreted as river bank

What is the difference between polysemy and homonymy?

A word is called polysemous if it is used to express different meanings. The difference between the meanings of the word can be obvious.

Two or more words are called homonyms if they either have the same sound or have the same spelling but do not have related meanings.

Application of semantic analysis

Semantic analysis is one of the open research area so its basic concepts can be used by following applications:

  • Word sense disambiguation is one of the major tasks in NLP where semantic analysis has been heavily used, and it's still an open research area for Indian languages
  • We will see word sense disambiguation (WSD) usage in Chapter 7, Rule-Based System for NLP
  • The word2vec concept has emerged to handle semantic similarity. We will see this in Chapter 6, Advance Feature Engineering and NLP Algorithms
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime