Artificial IntelligenceTU Board 2079
How syntactic and semantic analyses are performed in natural language processing?
Answer
Natural language processing (NLP) understands a sentence in stages: lexical analysis, syntactic analysis, semantic analysis, discourse integration and pragmatic analysis.
Syntactic analysis (parsing)
Syntactic analysis checks whether the words form a grammatically correct sentence and finds its structure.
- The sentence is split into words (tokens), and each word gets its part of speech (noun, verb, determiner and so on) from a lexicon.
- A grammar, usually a context-free grammar, describes valid sentences, for example: S → NP VP, NP → Det N, VP → V NP.
- A parser (top-down, bottom-up or chart parser) uses the grammar to build a parse tree. If no parse tree exists, the sentence is ungrammatical.
Example: "The boy eats an apple" → S [ NP (The boy) VP (eats NP (an apple)) ]. "Boy the apple an eats" fails to parse.
Semantic analysis
Semantic analysis finds the meaning of the parsed sentence and checks that it makes sense.
- Each word is mapped to its meaning using the lexicon, and word-sense ambiguity is resolved from context (for example, "bank" of a river vs a money bank).
- The meanings are combined following the parse tree (compositional semantics) into a formal representation such as first-order logic, a semantic network or frames: eats(boy, apple).
- Selectional restrictions reject meaningless sentences: "Colourless green ideas sleep furiously" is grammatical but has no sensible meaning, because ideas cannot sleep.
The output of semantic analysis is a meaning representation that the system can reason with or act on.
Discussion
Loading…
More Artificial Intelligence questions
What are the problems of depth limited search? Use the Alpha Beta pruning algorithm to prune the given game tree, assuming child nodes are visited left to…TU Board 208210How do you infer knowledge from a semantic net? Illustrate with an example. Consider the following Bayesian network with random variables A, B, C and D. If A…TU Board 208210What is model free reinforcement learning? Differentiate between active and passive reinforcement learning. Describe the different operators used in genetic…TU Board 208210How do you define rational? Can AI choose between right and wrong? Justify.TU Board 20825What do you mean by PEAS description? Give an example.TU Board 20825Apply the hill climbing search algorithm to solve the following problem. Assume the heuristic function h(n) = +1 for all blocks in the support structure if…TU Board 20825