Definition- NLP (Natural Language Process) refers to AI method. It helps to interacting as well as communicating with an intelligent system using natural language such as English. In general, NLP involves machines or robots to understand and process the language that human speak.
For Example: you want an intelligent system. Suppose, robot to perform as per your instructions. And you want hear decision from a dialogue based expert system,then Process of Natural Language is required.
Components of Natural Language Process (NLP)
So, keep reading, i am going to explain major components of NLP
- NLU (Natural Language Understanding)
- NLG (Natural Language Generation)
Natural Language Understanding:-
Basically, NLU is the component of NLP . As well as it uses computer software to understand input. That is made in the form of sentences in text or speech format.
Also, you can say that, it is use to
- Mapping the input in natural language into useful representation.
- Analyzing different aspects of language.
NLU has some problems, i have explained below. Stay with me,
Natural Language Generation:-
NLG is the process of creating meaningful sentences. These sentences are in the form of natural language from some internal representation. Moreover, It includes:
- Text planning:- text planning means retrieving the relevant content from knowledge base.
- Sentence planning:- includes selecting required words, forming meaningful sentences,and set the tone of sentence.
- Text realization:- So, text realization involves mapping sentence plan into sentence structure.
Problems in NLU
NLU is very ambiguous. It has different levels are as follow
Lexical ambiguity : basically, it is the word-level ambiguity. For example, treating the word “board” as noun or verb?
Syntax level ambiguity: So, it means a sentence can be pars in different ways. For Example, “She lifted the beetle with red cap”. Did he use cap to lift the beetle or he lifted a beetle that had red cap?
Referential ambiguity: As well as, it means referring to something using pronouns. For example: Ailie went to Shiza. She said, “I am tired”. Actually who is tired?
Steps in Natural Language Process
Let me explain in detail:
Lexical analysis: involves identifying and analyzing the structure of words. Lexicon of a language indicates the collection of words and phrases in language. Moreover, Lexical analysis is dividing the whole chunk of text into paragraphs, sentences and words.
Syntactic Analysis: basically, it includes analysis of words in the sentence for grammar. And then arranging words in manner that shows the relationship among words.
it actually creates the exact meaning or the dictionary meaning from the text. It is done by mapping syntactic structures and objects in the task domain. The semantic analyzer disregards sentence such as “hot ice-cream”.
means any sentence depends upon the meaning of sentence just before it. In addition, it also brings about the meaning of immediately succeeding sentence.
means, what was said is re-interpreted on what is actually meant. Further more, it involves deriving those aspects of language which require real world knowledge.
Implementation of Syntactic Analysis
There are number of algorithms for syntactic analysis, here, we consider only simple methods, such as:
- Context-Free Grammar
- Top-Down Parser
Let me explain in detail
It consists rules with a single symbol on the left-hand side of rewrite rules.
Let me create grammar to parse the sentence “The bird pecks the grains”
Articles(DET) : a|an|the
Noun phrase(NP): Article+noun|article+adjective+noun
Verb phrase(VP): noun phrase+ verb|verb+noun phrase
The parse tree breaks down the sentence into structure parts so that the computer can easily understand and process it. In order for parsing algorithm to construct this parse tree. And a set of rewrite rules need to be construct. That rules describe what tree structures are legal to rewrite. Further more, these rules say that a certain symbol may be expand in the tree by a sequence of other symbols.
Rewrite rules for the sentence are as follow:
S -> NP VP
NP -> DET N | DET ADJ N
VP -> V NP
DET -> a|the
ADJ -> beautiful | perching
N -> bird | birds | grain | grains
V -> peck | pecks | pecking
And the creation of parse tree:
Parsing is a frequently use term both in the realm of data quality, and in computing in general. So, the parser starts with S symbol and attempts to rewrite it into a sequence of terminal symbols. Terminal symbol matches the classes of words in the input sentence until it consists entirely of terminal symbols.
Then, these are check with the input sentence to see if it match. If not, the process starts over again with different set of rules. It repeats until to reach the specific rule and describes the structure of sentence.