public:t-malv-15-3:6
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
public:t-malv-15-3:6 [2015/09/23 22:43] – created orvark | public:t-malv-15-3:6 [2024/04/29 13:33] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 39: | Line 39: | ||
==== 1.2 Add Personal Pronouns ==== | ==== 1.2 Add Personal Pronouns ==== | ||
- | Add the [[https:// | + | Add some [[https:// |
Examples: 'I saw a bear', 'he frightened me' | Examples: 'I saw a bear', 'he frightened me' | ||
Line 47: | Line 47: | ||
Add some verbs and alter the grammar to make it differentiate between [[https:// | Add some verbs and alter the grammar to make it differentiate between [[https:// | ||
- | Examples: 'the bear died', 'Joe saw the bear die', ' | + | Examples: 'the bear died', 'Joe saw the bear was dead', ' |
==== 1.4 Add Number Agreement ==== | ==== 1.4 Add Number Agreement ==== | ||
- | Alter the grammar to add [[https:// | + | Alter the grammar to add [[https:// |
Examples: 'a fish dies', 'the bears frightened a little squirrel' | Examples: 'a fish dies', 'the bears frightened a little squirrel' | ||
- | **What to hand in: A CFG grammar with all the modifications. Code to print out a couple of sentence parses for each subsection here above.** | + | **What to hand in: Your CFG grammar with all the modifications. Code to print out a couple of sentence parses for each subsection here above.** |
===== 2. Parse PCFG ===== | ===== 2. Parse PCFG ===== | ||
Line 66: | Line 66: | ||
... | ... | ||
""" | """ | ||
+ | |||
+ | viterbi_parser = nltk.ViterbiParser(pgrammar) | ||
+ | for tree in viterbi_parser.parse([' | ||
+ | print(tree) | ||
</ | </ | ||
Line 71: | Line 75: | ||
**What to hand in: A PCFG grammar. Code to print out a couple of sentence parses.** | **What to hand in: A PCFG grammar. Code to print out a couple of sentence parses.** | ||
- | |||
/var/www/cadia.ru.is/wiki/data/attic/public/t-malv-15-3/6.1443048194.txt.gz · Last modified: 2024/04/29 13:32 (external edit)