NLP Introduction to NLP Natural Language Generation Using

  • Slides: 20
Download presentation
NLP

NLP

Introduction to NLP Natural Language Generation Using Features and Unification

Introduction to NLP Natural Language Generation Using Features and Unification

Example ( : process save-1 : actor system-1 : goal document-1 : speechact assertion

Example ( : process save-1 : actor system-1 : goal document-1 : speechact assertion : tense future ) Input is underspecified

The Functional Unification Formalism • • Aka FUF Based on Kay’s (83) formalism Partial

The Functional Unification Formalism • • Aka FUF Based on Kay’s (83) formalism Partial information, declarative, uniform, compact Same framework used for all stages: syntactic realization, lexicalization, and text planning

Functional Analysis • • Functional vs. structured analysis “John eats an apple” Actor (John),

Functional Analysis • • Functional vs. structured analysis “John eats an apple” Actor (John), affected (apple), process (eat) Suitable for generation

Partial vs. Complete Specification • • Voice: An apple is eaten by John Tense:

Partial vs. Complete Specification • • Voice: An apple is eaten by John Tense: John ate an apple Mode: Did John eat an apple? Modality: John must eat an apple action = actor = object = eat John apple

Unification • • • Target sentence Input FD Grammar Unification process Linearization process

Unification • • • Target sentence Input FD Grammar Unification process Linearization process

Path notation • View an FD as a tree • To specify features, use

Path notation • View an FD as a tree • To specify features, use a path – {feature … feature} value – e. g. {prot number} • Also use relative paths – {^ number} value = the feature number for the current node – {^ ^ number} value = the feature number for the node above the current node

Sample input ((cat s) (prot ((n ((lex john))))) (verb ((v ((lex like))))) (goal ((n

Sample input ((cat s) (prot ((n ((lex john))))) (verb ((v ((lex like))))) (goal ((n ((lex mary))))))

Sample Grammar ((alt top (((cat s) (prot ((cat np))) (goal ((cat np))) (verb ((cat

Sample Grammar ((alt top (((cat s) (prot ((cat np))) (goal ((cat np))) (verb ((cat vp) (number {prot number}))) (pattern (prot verb goal))) ((cat np) (n ((cat noun) (number {^ ^ number}))) (alt (((proper yes) (pattern (n))) ((proper no) (pattern (det n)) (det ((cat article) (lex “the”))))))) ((cat vp) (pattern (v)) (v ((cat verb)))) ((cat noun)) ((cat verb)) ((cat article)))))

Sample Output ((cat s) (goal ((cat np) (n ((cat noun) (lex mary) (number {goal

Sample Output ((cat s) (goal ((cat np) (n ((cat noun) (lex mary) (number {goal number}))) (pattern (n)) (proper yes))) (pattern (prot verb goal)) (prot ((cat np) (n ((cat noun) (lex john) (number {verb number}))) (number {verb number}) (pattern (n)) (proper yes))) (verb ((cat vp) (pattern (v)) (v ((cat verb) (lex like))))))

Unification Example

Unification Example

Unify Prot

Unify Prot

Unify Goal

Unify Goal

Unify VP

Unify VP

Unify Verb

Unify Verb

Finish

Finish

The SURGE grammar (Elhadad) • Syntactic realization front-end • Variable level of abstraction •

The SURGE grammar (Elhadad) • Syntactic realization front-end • Variable level of abstraction • 5, 600 branches and 1, 600 alts Lexical chooser Lexicalized FD SURGE Syntactic FD Linearizer Morphology Text

Links • Simple. NLG (Gatt and Reiter) – https: //github. com/simplenlg • FUF in

Links • Simple. NLG (Gatt and Reiter) – https: //github. com/simplenlg • FUF in NLTK – https: //github. com/nltk_contrib/tree/master/nltk_contrib/fuf

NLP

NLP