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.