Defining context-free grammar
Now let's focus on NLU, and to understand it, first we need to understand context-free grammar (CFG) and how it is used in NLU.
Context-free grammar is defined by its four main components. Those four components are shown in this symbolic representation of CFG:
- A set of non-terminal symbols, N
- A set of terminal symbols, T
- A start symbol, S, which is a non-terminal symbol
- A set of rules called productionrules P, for generating sentences
Let's take an example to get better understanding of the context-free grammar terminology:
X ->
Here, X->

ε {N or T} means

belongs to either terminal symbols or non-terminal symbols. X can be rewritten in the form of

. The rule tells you which element can be rewritten to generate a sentence, and what the order of the elements will be as well.
Now I will take a real NLP example. I'm going to generate a sentence using CFG rules...