Download presentation
Presentation is loading. Please wait.
Published byTuomas Parviainen Modified over 5 years ago
1
LING/C SC 581: Advanced Computational Linguistics
Lecture 20 March 28th
2
Administrivia Homework 8 on tregex
3
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
4
tregex Preferences
5
tregex useful command line tool: diff <file1> <file2>
6
tregex
7
tregex Help: tregex expression syntax is non-standard wrt bracketing
S < VP S < NP
8
tregex Help: tregex boolean syntax is also non-standard
9
tregex Help
10
tregex x <, y, 1st child y; x <- y, last child y;
x $+ y, x immediate left sister of y
11
tregex same node Pattern: <, $+ (/,/ $+ $+ /,/=comma))) <- =comma) Key: <, first child $+ immediate left sister <- last child
12
tregex Help
13
tregex
14
tregex Different results from:
@SBAR < /^WH.*-([0-9]+)$/#1%index << < (/^-NONE-/ < /^\*T\*-([0- 9]+)$/#1%index))
15
tregex Reason for difference Example:
WHADVP also possible (not just WHNP)
16
Treebank Guide Parsing guide 1, prsguid1.pdf (318 pages):
prsguid2.pdf: addendum for the Switchboard corpus
17
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?
18
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
19
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
20
Homework 8 Due next Wednesday night. Review next week this time.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.