- Published on
Parsing
- Authors
- Name
- Lucas Xu
- @xianminx
Context-free Grammar
Word categories
- noun
- pronoun
- verb
- adjective
- adverb
- conjunction
- preposition
- interjection
- word
- constituent phrases
CFG = Context-Free Grammar = Phrase Structure Grammar = BNF = Backus-Naur Form
Context-free grammar
G = <T,N, S,R> • T is set of terminals (lexicon)
• N is set of non-terminals For NLP, we usually distinguish out a set P ⊆ N of preterminals which always rewrite as terminals.
• S is start symbol (one of the nonterminals)
• R is rules/productions of the form X → α, where X is a nonterminal and α is a sequence of terminals and nonterminals (may be empty).
• A grammar G generates a language L.