Undocumented
Class |
|
A utility class for scoring chunk parsers. ChunkScore can evaluate a chunk parser's output, based on a number of statistics (precision, recall, f-measure, misssed chunks, incorrect chunks). It can also combine the scores from the parsing of multiple texts; this makes it significantly easier to evaluate a chunk parser that operates one sentence at a time. |
Function | accuracy |
Score the accuracy of the chunker against the gold standard. Strip the chunk information from the gold standard and rechunk it using the chunker, then compute the accuracy score. |
Function | conllstr2tree |
Return a chunk structure for a single sentence encoded in the given CONLL 2000 style string. This function converts a CoNLL IOB string into a tree. It uses the specified chunk types (defaults to NP, PP and VP), and creates a tree rooted at a node labeled S (by default). |
Function | conlltags2tree |
Convert the CoNLL IOB format to a tree. |
Function | demo |
Undocumented |
Function | ieerstr2tree |
Return a chunk structure containing the chunked tagged text that is encoded in the given IEER style string. Convert a string of chunked tagged text in the IEER named entity format into a chunk structure... |
Function | tagstr2tree |
Divide a string of bracketted tagged text into chunks and unchunked tokens, and produce a Tree. Chunks are marked by square brackets ([...]). Words are delimited by whitespace, and each word should have the form ... |
Function | tree2conllstr |
Return a multiline string where each line contains a word, tag and IOB tag. Convert a tree to the CoNLL IOB string format |
Function | tree2conlltags |
Return a list of 3-tuples containing (word, tag, IOB-tag). Convert a tree to the CoNLL IOB tag format. |
Function | _chunksets |
Undocumented |
Function | _ieer |
Undocumented |
Constant | _IEER |
Undocumented |
Constant | _IEER |
Undocumented |
Constant | _LINE |
Undocumented |
Score the accuracy of the chunker against the gold standard. Strip the chunk information from the gold standard and rechunk it using the chunker, then compute the accuracy score.
Parameters | |
chunker:ChunkParserI | The chunker being evaluated. |
gold:tree | The chunk structures to score the chunker on. |
Returns | |
float | Undocumented |
Return a chunk structure for a single sentence encoded in the given CONLL 2000 style string. This function converts a CoNLL IOB string into a tree. It uses the specified chunk types (defaults to NP, PP and VP), and creates a tree rooted at a node labeled S (by default).
Parameters | |
s:str | The CoNLL string to be converted. |
chunk | The chunk types to be converted. |
root | The node label to use for the root. |
Returns | |
Tree | Undocumented |
Convert the CoNLL IOB format to a tree.
Return a chunk structure containing the chunked tagged text that is encoded in the given IEER style string. Convert a string of chunked tagged text in the IEER named entity format into a chunk structure. Chunks are of several types, LOCATION, ORGANIZATION, PERSON, DURATION, DATE, CARDINAL, PERCENT, MONEY, and MEASURE.
Returns | |
Tree | Undocumented |
Divide a string of bracketted tagged text into chunks and unchunked tokens, and produce a Tree. Chunks are marked by square brackets ([...]). Words are delimited by whitespace, and each word should have the form text/tag. Words that do not contain a slash are assigned a tag of None.
Parameters | |
s:str | The string to be converted |
chunk | The label to use for chunk nodes |
root | The label to use for the root of the tree |
sep | Undocumented |
source | Undocumented |
target | Undocumented |
Returns | |
Tree | Undocumented |
Return a multiline string where each line contains a word, tag and IOB tag. Convert a tree to the CoNLL IOB string format
Parameters | |
t:Tree | The tree to be converted. |
Returns | |
str | Undocumented |
Return a list of 3-tuples containing (word, tag, IOB-tag). Convert a tree to the CoNLL IOB tag format.
Parameters | |
t:Tree | The tree to be converted. |
Returns | |
list(tuple) | Undocumented |
Undocumented
Value |
|