Constraint Based Hindi Parser LTRC IIIT Hyderabad Introduction
Constraint Based Hindi Parser LTRC, IIIT Hyderabad
Introduction l Broad coverage parser l l Very crucial IL-IL MT systems, IE, co-reference resolution, etc.
Why Dependency ? l Phrase Structures l l Intrinsically presumes order Context Free Grammar (CFG) not well-suited for free-word order languages (Shieber, 1985) Particularly ill suited to Indian Languages Dependency Structures l l l Gives flexibility Common structures With appropriate labels, closer to Semantics
Computational Paninian Grammar (CPG) l l l Based on Panini’s Grammar (500 BC) Inspired by Inflectionally rich language (Sanskrit) A dependency based analysis
Computational Paninian Grammar (The Basic Framework) l Treats a sentence as a set of modifiermodified relations l l Sentence has a primary modified or the root (which is generally a verb) Gives us the framework to identify these relations l l l Relations between noun constituent and verb called ‘karaka’ karakas are syntactico-semantic in nature Syntactic cues help us in identifying the karakas
karta – karma karaka l The boy opened the lock l l l karta, karma usually correspond to agent, theme l l k 1 – karta k 2 – karma But not always karakas are direct participants in the activity denoted by the verb open k 1 boy k 2 lock
Basic karaka relations l l l l karta – agent/doer/force l Relation label – k 1 karma – object/patient l Relation label – k 2 karana – instrument l Relation label – k 3 sampradaan – beneficiary l Relation label – k 4 apaadaan – source l Relation label – k 5 adhikarana – location in place/time/other l Relation label – k 7 p/k 7 t/k 7 For complete list of dependency relations: (Begum et al. , 2008)
Basic karaka relations raama phala khaataa hai ‘Ram eats fruit’
Basic karaka relations raama chaaku se saiv kaatataa hai ‘Ram cuts the apple with knife’
Basic karaka relations raama ne mohana ko pustaka dii ‘Ram gave a book to Mohan’
Why Paninian Labels l Other choices for labels could be l Grammatical relations l l l Thematic roles l l Subject, Object, etc. Behavioral tests (Mohanan, 1994) Agent, patient, etc. No concrete cues Difficult to extract them automatically Karakas can be computationally exploited l l Syntactically grounded, Semantically loaded Gives a level of interface
Levels of Language Analysis l l l Morphological analysis (Morph Info. ) Analysis in local context (POS tagging) Sentence analysis (Chunking, Parsing) Semantic analysis (Word sense disambiguation, etc. ) Discourse processing (Anaphora resolution, Informational Structure, etc. )
Example l r. Ama ne mohana ko puswaka x. I |
Example – Parsed Output x. I ‘give’ k 1 r. Ama k 4 k 2 mohana puswaka ‘book’
Parser l Two stage strategy l l Stage I (Intra-clausal relations) l l l Appropriate constraints formed Dependency relations marked Relations such as k 1, k 2, k 3, etc. for each verb Stage II (Inter-clausal relations & conjunct relations) l Conjuncts, relative clauses, kriya mula, etc
Demand Frame for Verb l l l A demand frame or karaka frame for a verb indicates the demands the verb makes It depends on the verb and its tense, aspect and modality (TAM) label. A mapping is specified between karaka relations and vibhaktis (post-positions, suffix).
Karaka Frame l l It specifies what karakas are mandatory or optional for the verb and what vibhaktis (postpositions) they take respectively Each verb belongs to a specific verb class l l Each class has a basic karaka frame Each TAM specifies a transformation rule
Example l r. Ama mohana ko puswaka xew. A h. E | xew. A h. E ‘give is’ k 1 r. Ama k 4 k 2 mohana puswaka ‘book’ Parsed Dependency Tree
Transformations l Based on the TAM of the verb l l l r. Ama ne mohana ko Kil. On. A xiy. A | r. Ama ko mohana ko Kil. On. A xen. A pad. ZA | Appropriate transformation applied
Example l r. Ama ne mohana ko puswaka x. I |
Karaka Frame – xe (give)
Transformation Rule – y. A (TAM)
Karaka Frame y. A TAM r. Ama ne mohana ko Kil. On. A xiy. A | Transformed frame for xe after applying the y. A trasformation --------------------------------------------arc-label necessity vibhakti lextype src-pos arc-dir --------------------------------------------k 1 m ne n l c k 2 m 0|ko n l c k 3 d se n l c k 4 d ko n l c --------------------------------------------0 ne
Parsed Output x. I ‘give’ k 1 r. Ama k 4 k 2 mohana puswaka ‘book’
Other frames l Adjectives
Steps in Parsing SENTENCE Morph, POS tagging, Chunking Identify Demand Groups Load Frames & Transform Find Candidates Apply Constraints & Solve Final Parse
Example: l r. Ama ne mohana ko Kil. On. A xiy. A |
Identify the demand group, Load and Transform DF l xiy. A l l Only verb Transformed frame l Use ‘y. A’ TAM info. --------------------------------------------arc-label necessity vibhakti lextype src-pos arc-dir --------------------------------------------k 1 m ne n l c k 2 m 0|ko n l c k 3 d se n l c k 4 d ko n l c --------------------------------------------
Candidates k 1 main l r. Ama ne mohana ko Kil. On. A k 2 k 4 k 2 xiy. A _ROOT_ |
Constraints l C 1: For each of the mandatory demands in a demand frame for each demand group, there should be exactly one outgoing edge labeled by the demand from the demand group. l C 2: For each of the optional demands in a demand frame for each demand group, there should be at most one outgoing edge labeled by the demand from the demand group. l C 3: There should be exactly one incoming arc into each source group.
Constraints l l l A parse of a sentence is obtained by satisfying all the above constraints Ambiguous sentences have multiple parses Ill formed sentences have no parse.
Parse - I k 1 main l r. Ama ne mohana ko Kil. On. A k 2 k 4 xiy. A _ROOT_ |
Parse - I _ROOT_ main xiy. A k 1 r. Ama k 4 k 2 mohana Kil. On. A
Integer Programming Constraints l l l Xijk represents a possible arc from word group i to j with karaka label k It takes a value 1 if the solution has that arc and 0 otherwise. It cannot take any other values. The constraint rules are formulated into constraint equations.
Constraint Equations C 1: For each demand group i, for each of its mandatory demands k, the following equalities must hold: Mik : Sj xikj = 1 C 2: For each demand group i, for each of its optional or desirable demands k, the following inequalities must hold: Oik : Sj xikj <= 1 C 3: For each of the source groups j, the following equalities must hold: Sj : Sik xikj = 1
Multiple Frames l If more than one karaka frame for a verb l l Call Integer Programming package for each frame If more than one demand groups (e. g. , multiple verbs) in the sentence with multiple demand frames l Call Integer Programming package for each combination of such frames
Other frames l Common karaka frame l l l Attached to each karaka frame Preference given to main frame if there are clashes Fallback karaka frame l l required karaka frame is missing Graceful degradation
Stage I: Types being handled l l Simple Verbs Non-finite verbs l l l l w. A_hu. A w. A_h. I n. A kara 0_rahe, etc. Copula Genitive
Example (Complex Sentence) l r. Ama ne phala khaakara mohana ko Ram ‘ERG’ fruit ‘having eaten’ Mohan ‘DAT’ Kil. On. A xiy. A toy gave ‘Having eaten the fruit Ram gave the toy to Mohan’
Candidates X 4: k 2 l X 1: k 1 X 8: main X 7: vmod r. Ama ne phala khaakara mohana ko Kil. On. A X 6: k 2 X 3: k 2 X 5: k 4 X 2: k 2 xiy. A _ROOT_ |
Constraint Equations l Verb ‘xe’ l Mandatory Demands (C 1) l l l Optional Demands (C 2) l l k 4 x 5 <= 1 Verb ‘khaa’ l Mandatory Demands (C 1) l l l k 1 x 1 = 1 k 2 x 2 + x 3 + x 4 = 1 k 2 x 6 = 1 vmod x 7 = 1 _ROOT_ l C 1 l Main x 8 = 1
Constraint Equations (contd. ) l Incoming Arcs into Source (C 3) l l l r. Ama l x 1 = 1 phala l x 4 + x 6 = 1 khaa l x 7 = 1 mohana l x 3 + x 5 = 1 Kil. On. A l x 2 = 1 xe l x 8 = 1
Solution Graph _ROOT_ main xiy. A k 1 r. Ama vmod k 4 khaakara k 2 phala k 2 mohana Kil. On. A
References l Akshar Bharati and Rajeev Sangal. 1993. Parsing free word order languages in Paninian Framework. ACL: 93, Proc. of Annual Meeting of Association of Computational Linguistics, New Jersey. USA. l Akshar Bharati, Rajeev Sangal, T Papi Reddy. 2002. A Constraint Based Parser Using Integer Programming In Proc. of ICON-2002: International Conference on Natural Language Processing. l Rafiya Begum, Samar Husain, Arun Dhwaj, Dipti Misra Sharma, Lakshmi Bai and Rajeev Sangal. 2008. Dependency Annotation Scheme for Indian Languages. In Proceedings of The Third International Joint Conference on Natural Language Processing (IJCNLP). Hyderabad, India. l S. M. Shieber. 1985. Evidence against the context-freeness of natural language. In Linguistics and Philosophy, p. 8, 334– 343. l Tara Mohanan, 1994. Arguments in Hindi. CSLI Publications.
THANKS!!
- Slides: 45