LING/C SC 581: Advanced Computational Linguistics Lecture 20 March 28th
Administrivia Homework 8 on tregex
tregex The best introduction to Tregex is the brief powerpoint tutorial for Tregex by Galen Andrew. Google: wonderful world of tregex The_Wonderful_World_of_Tregex.ppt
tregex Preferences
tregex useful command line tool: diff <file1> <file2>
tregex
tregex Help: tregex expression syntax is non-standard wrt bracketing S < VP S < NP
tregex Help: tregex boolean syntax is also non-standard
tregex Help
tregex x <, y, 1st child y; x <- y, last child y; x $+ y, x immediate left sister of y
tregex same node Pattern: (@NP <, (@NP $+ (/,/ $+ (@NP $+ /,/=comma))) <- =comma) Key: <, first child $+ immediate left sister <- last child
tregex Help
tregex
tregex Different results from: @SBAR < /^WH.*-([0-9]+)$/#1%index << (@NP < (/^-NONE-/ < /^\*T\*-([0- 9]+)$/#1%index))
tregex Reason for difference Example: WHADVP also possible (not just WHNP)
Treebank Guide Parsing guide 1, prsguid1.pdf (318 pages): prsguid2.pdf: addendum for the Switchboard corpus
Homework 8 Read about *PPA* in prsguid1.pdf (section 5.2). Q1: Write a tregex expression to search for Prepositional Phrase (PP) PPAs. How many of them are there?
Homework 8 Q2: Write a tregex expression to search for non-PP PPAs. I.e. what other basic categories of PPAs besides Prepositional Phrase (PP) PPAs are there? List them. Note: by basic we mean @
Homework 8 Q3: Find the section on Topicalization in prsguid1.pdf. How are topicalized elements marked? How many examples of topicalized elements are there in the WSJ? Using Save Matched Sentences and any necessary Python code, how many types of topicalized elements are there? How many types occur more than once? (You may want to use nltk.FreqDist().) Note: by type we mean by grammatical category
Homework 8 Due next Wednesday night. Review next week this time.