public:t-malv-15-3:7
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
public:t-malv-15-3:7 [2015/10/01 00:41] – created orvark | public:t-malv-15-3:7 [2024/04/29 13:33] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
**Answer questions or report results in comments in your code.** | **Answer questions or report results in comments in your code.** | ||
+ | |||
+ | [[http:// | ||
===== 1. Training a tagger to Chunk NPs ===== | ===== 1. Training a tagger to Chunk NPs ===== | ||
Line 42: | Line 44: | ||
<code python> | <code python> | ||
- | chunker = UnigramChunker(train_sents) # | + | chunker = UnigramChunker(train_sents) |
print(chunker.evaluate(test_sents)) | print(chunker.evaluate(test_sents)) | ||
Line 66: | Line 68: | ||
==== 1.3 Get a feel for NP chunking ==== | ==== 1.3 Get a feel for NP chunking ==== | ||
- | **TODO: | + | **TODO: |
Line 79: | Line 81: | ||
re_chunker = nltk.RegexpParser(pattern) # create a re chunk parser | re_chunker = nltk.RegexpParser(pattern) # create a re chunk parser | ||
- | result = re_chunker.parse(sentence) | + | print(re_chunker.parse(sentence)) |
- | print(result) | + | |
</ | </ | ||
Line 89: | Line 90: | ||
</ | </ | ||
- | ==== 2.1 Improve the RE Chunker ==== | + | ==== 2.1 Improve the Regexp |
- | **TODO: Improve upon the re patterns. You could use the tag patterns you discovered in 1.3 to guide you.** | + | **TODO: Improve upon the Regular Expressions NP chunking |
<code python> | <code python> | ||
pattern = ''' | pattern = ''' | ||
- | NP: {[...]} #first NP rule | + | NP: {[...]} #first NP chunk rule |
- | {[...]} #second NP rule | + | {[...]} #second NP chunk rule |
{[...]} #and so on ... | {[...]} #and so on ... | ||
''' | ''' | ||
</ | </ | ||
- | === Special | + | Note the special |
< | < | ||
- | Examples: | + | Example: Matches: |
| | ||
Line 115: | Line 116: | ||
- | **NOTE: You should be able to get the IOB Accuracy above 66%. Report you results.** | + | **NOTE: You should |
/var/www/cadia.ru.is/wiki/data/attic/public/t-malv-15-3/7.1443660081.txt.gz · Last modified: 2024/04/29 13:32 (external edit)