1 / 19

Korpuslinguistik für und mit Computerlinguistik

Korpuslinguistik für und mit Computerlinguistik. Seminar SS 2003 Sitzung 2: Corpora, Abfragetools Gerold Schneider. Charakteristiken korpusbasierter computerlinguistischer Methoden. Datenerwerb: Identifikation und Erwerb der Daten und Regeln kann (teil-)automatisch erfolgen

sari
Télécharger la présentation

Korpuslinguistik für und mit Computerlinguistik

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Korpuslinguistik für und mit Computerlinguistik Seminar SS 2003 Sitzung 2: Corpora, Abfragetools Gerold Schneider

  2. Charakteristiken korpusbasierter computerlinguistischer Methoden • Datenerwerb: Identifikation und Erwerb der Daten und Regeln kann (teil-)automatisch erfolgen • Abdeckung: Alle im Trainingskorpus erscheinenden Phänomene werden abgedeckt (sofern korrekt identifiziert) • Robustheit: Adaption an verrauschte Daten • Portabilität: Prinzipiell auf jede Sprache übertragbar • Evaluation: Wissenschaftliche Hypothesen und NLP-Systeme können präzise evaluiert werden Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  3. Charakteristiken korpusbasierter computerlinguistischer Methoden II • Empirisches (beobachtungsbasiertes) wissenschaftliches Modell, prinzipiell abgekoppelt von Chomsky‘s explanatorischer Adäquatheit. Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  4. Rohtextkorpora Auch aus nicht annotierten Korpora können wertvolle Sprachgebrauchs-daten extrahiert werden, wie Wortlisten (Zipf), N-gramme, etc. Das reicht z.B. zur Sprachidentifikation. Um welche 3 Sprachen handelt es sich folgend wohl? Trigramme DER ICH EIN NDE SCH DIE TEN END CHE UND Anzahl 1025 959 939 812 812 804 662 611 607 586 Trigramme ENT LES EDE DES QUE AIT LLE SDE ION EME Anzahl 900 801 630 609 607 542 509 508 477 472 Trigramme THE AND ING ENT ION NTH TER INT OFT THA Anzahl 2069 819 607 487 428 381 367 357 355 355 Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  5. Computerlinguistische Verwendungen von Rohtextkorpora • Lexikologie • Terminologie • Rechtschreibkorrektur • Kollokationsforschung • Unsupervisierte Syntaxakquisition • Unsupervisierte Wortsinndisambiguierung • Information Retrieval • Allgemein: kontextbasierte Zugänge Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  6. Annotierte Korpora • Korpora können prinizipiell mit jeder denkbaren Information annotiert werden (phonologisch, morphologisch, syntaktisch, semantisch, pragmatisch, ...) • Wir beschäftigen uns in erster Linie mit morphosyntaktischer Wortklasseninformation (part-of-speech) und syntaktischer Strukturinformation, für Deutsch und Englisch.  Deutsch: NEGRA Korpus  Englisch: Penn Treebank Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  7. Annotierung: part-of-speech, Penn Pierre/NNP Vinken/NNP ,/, 61/CD years/NNS old/JJ ,/, will/MD join/VB the/DT board/NN as/IN a/DT nonexecutive/JJ director/NN Nov./NNP 29/CD CC Coordinating conj. CD Cardinal number DT Determiner EX Existential there FW Foreign word IN Prep. or subord. Conj. JJ Adjective JJR Adjective, comparative JJS Adjective, superlative LS List item marker MD Modal NN Noun, singular or mass NNS Noun, plural NP Proper noun, singular NPS Proper noun, plural PDT Predeterminer POS Possessive ending PP Personal pronoun PP$ Possessive pronoun RB Adverb RBR Adverb, comparative RBS Adverb, superlative RP Particle SYM Symbol TO to UH Interjection VB Verb, base form VBD Verb, past tense VBG Verb, gerund or pres. Part. VBN Verb, past participle VBP Verb, non-3rd pers. sing. Pres. VBZ Verb, 3rd person sing. Pres. WDT Wh-determiner WP Wh-pronoun WP$ Possessive wh-pronoun WRB Wh-adverb Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  8. Annotierung: CFG-Syntax, Penn ADJP Adjective phrase ADVP Adverb phrase NP Noun phrase PP Prepositional phrase S Simple declarative clause SBAR Subordinate clause SBARQ Direct question introd. by wh-element SINV Declarative sentence with subject-aux inversion SQ Yes/no questions and subconstituent of SBARQ excluding wh-element VP Verb phrase WHADVP Wh-adverb phrase WHNP Wh-noun phrase WHPP Wh-prepositional phrase X unknown or uncertain category ( (S (NP (NP (NNP Pierre) (NNP Vinken) ) (, ,) (ADJP (NP (CD 61) (NNS years) ) (JJ old) ) (, ,) ) (VP (MD will) (VP (VB join) (NP (DT the) (NN board) ) (PP (IN as) (NP (DT a) (JJ nonexecutive) (NN director) )) (NP (NNP Nov.) (CD 29) ))) (. .) )) Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  9. Annotierung: Syntaktische Rollen Text Categories -HLN headlines and datelines -LST list markers -TTL titles Grammatical Functions -CLF true clefts -NOM non NPs that function as NPs -ADV clausal and NP adverbials -LGS logical subjects in passives -PRD non VP predicates -SBJ surface subject -TPC topicalized and fronted constituents -CLR closely related - see text Semantic Roles -VOC vocatives -DIR direction & trajectory -LOC location -MNR manner -PRP purpose and reason -TMP temporal phrases ( (S (NP-SBJ (NP (NNP Pierre) (NNP Vinken) ) (, ,) (ADJP (NP (CD 61) (NNS years) ) (JJ old) ) (, ,) ) (VP (MD will) (VP (VB join) (NP (DT the) (NN board) ) (PP-CLR (IN as) (NP (DT a) (JJ nonexecutive) (NN director) )) (NP-TMP (NNP Nov.) (CD 29) ))) (. .) )) Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  10. Annotierung: NEGRA ((S (ADJD-MO Selten) (VVFIN-HD nehmen) (NP-SB (ART-NK die) (ADJA-NK großen) (NN-NK Plattenfirmen)) (NP-OA (ART-NK das) (ADJA-NK finanzielle) (NN-NK Risiko) (*T1*-OC -)) (PP-MO (APPR-AC auf) (PRF-NK sich)) ($, ,) (VP-*T1* (NP-DA (ART-NK den) (NN-NK Arbeiten)) (PP-MO (APPR-AC zu) (ART-NK einer) (NN-NK Veröffentlichung)) (VZ-HD (PTKZU-PM zu) (VVINF-HD verhelfen)))) ($. .)) Legende (Auszug): • AC adpositional case marker • DA dative • HD head • MO modifier • NK noun kernel • OA accusative obj. • OC clausal object • PD predicative • PM morphological particle • RC relative clause • SB subject • SBP passive subj. Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  11. Struktur-Abfrage Die Extraktion von Strukturen und syntaktischen Abhängigkeiten aus syntaktisch annotierten Korpora ist nicht trivial. Die folgenden Abfragetools werden näher vorgestellt: • Tgrep und Tgrep2: text-basiert, UNIX Kommandi • Tiger-Search: graphische Ausgabe, in Java, XML-basiert • Prolog-Datenbank: Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  12. Tgrep und Tgrep2 • Idee: grep for trees • Tgrep2 gibt es für alle UNIX unter http://tedlab.mit.edu/~dr/Tgrep2/ • Eine einfache Abfragesprache über Strukturbeziehungen (Auszug): A < B A immediately dominates B A < `B A immediately dominates B, only print B A <X B B is the Xth child of A A <- B the last child of A is B A << B A dominates B A <<, B B is a leftmost descendant of A A <<` B B is a rightmost descendant of A A .. B A precedes B A $ B A and B are sisters A $.. B A and B are sisters and A precedes B Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  13. Tgrep - Beispiele • Was bedeuten die folgenden Abfragen ? Funktionieren sie so wie erwartet? tgrep 'S < NP' tgrep 'VP < NP' tgrep 'VP < PP' tgrep 'NP < PP' tgrep 'PP < `IN << `/NN/' tgrep 'JJ .. NP' tgrep 'S < (NP-SBJ < PP)' tgrep '`IN . (S < VP << `/VB/)' • Tgrep-online-Abfragen über die Penn Treebank kann man stellen unter http://www.ldc.upenn.edu/ldc/online/treebank/ Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  14. Tgrep - Echtweltbeispiel Extraktion von lexikalischen Verb-Objekt – Beziehungen • tgrep 'VP < NP' liefert Gesamtkonstituenten • tgrep 'VP << `/VB/ < NP <<` `/NN/' liefert Köpfe, aber übergeneriert: (VP (VB bring) (NP (JJ new) (NN attention)) (PP-DIR (TO to) (NP (DT the) (NN problem)))) • tgrep 'VP << `/VB/ <(NP<- `/NN/)' liefert Köpfe, aber nur unkomplexe NPs  alle Schachtelungsmöglichkeiten für NPs explizit auflisten Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  15. Tgrep – Echtweltbeispiel II tgrep 'VP << `/VB/ < (/NP$/|NP-PRD <- `(/NN/|PRP|WDT|WP|CD))‚ tgrep 'VP << `/VB/ < (/NP$/|NP-PRD <1 (NP <- `(/NN/|PRP|WDT|WP|CD)))‚ tgrep 'VP << `/VB/ < (/NP$/|NP-PRD <1 (NP<1(NP <- `(/NN/|PRP|WDT|WP|CD))))' tgrep 'VP << `/VB/ < (/NP$/|NP-PRD <1 (NP<(NP<1(NP <- `(/NN/|PRP|WDT|WP|CD))))) ' tgrep 'VP << `/VB/ < (/NP$/|NP-PRD <1 (NP<(NP<(NP<1(NP <- `(/NN/|PRP|WDT|WP|CD)))))) ' tgrep 'VP << `/VB/ < (/NP$/|NP-PRD <1 (NP<(NP<(NP<(NP<1(NP <- `(/NN/|PRP|WDT|WP|CD))))))) ' • Köpfe können auch Pronomina oder Zahlen sein (PRP, WDT, WP , CD) • Zusätzliche Einschränkungen (<1) wegen Konjunktionen • Kopularverb-Komplemente (NP-PRD) werden als Objekte verstanden Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  16. Tgrep – Echtweltbeispiel III • Je nach grammatischer Auffassung gibt es noch weitere Objekte: (VP (VBN elected) (S (NP-SBJ (-NONE- *-10)) (NP-PRD (DT a) (NN director)))) (VP (VB call) (S (NP-SBJ (-NONE- *T*-1)) (NP-PRD (DT a) (`` ``) (NN game)))) Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  17. Tiger-Search • XML-basierte, graphische Abfrageumgebung für Strukturabfragen in Java > l labeled direct dominance [cat="NP"] >1 [cat="NP"] > direct dominance [cat="NP"] > [pos="NE"] > * dominance [cat="NP"] >* [pos="NE"] > n dominance, distance n [cat="NP"] >2 [pos="NE"] > m,n dominance, distance m...n [cat="NP"] >2,3 [pos="NE"] > @l left corner [cat="NP"] >@l [word="etwas"] > @r right corner [cat="NP"] >@r [word="Kohl"] $ siblings [word="etwas"] $ [cat="NP"] $.* siblings with precedence [word="etwas"] $.* [cat="NP"] Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  18. Tiger-Search: Graphische Ausgabe Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

  19. Tiger-Search: XML-Export Aufgrund der XML-Basierung bietet Tiger-Search viele Exportformate. Z.B. ein Ergebnis einer 'VP > NP' Objekts-Anfrage: • Sentences (im Treebank-Format): (S (NP-SBJ (PRP it)) (VP (VBZ does) (RB n't) (VP (VB take) (NP (NN place)) (PP (IN in) (NP (NP (DT an) (NN atmosphere)) (PP (IN of) (NP (ADJP (JJ correct) (CC and) (JJ acute)) (NN boredom)))) ... • Variables and their tokens: #intvN2: place #intvN1: take place in an atmosphere of correct and acute boredom Gerold Schneider: Korpuslinguistik für Computerlinguistik, II

More Related