Undocumented
Function | corpus |
Undocumented |
Function | demo |
Run a demo with defaults. See source comments for details, or docstrings of any of the more specific demo_* functions. |
Function | demo |
Writes a file with context for each erroneous word after tagging testing data |
Function | demo |
Template.expand and Feature.expand are class methods facilitating generating large amounts of templates. See their documentation for details. |
Function | demo |
Discard rules with low accuracy. This may hurt performance a bit, but will often produce rules which are more interesting read to a human. |
Function | demo |
Plot a learning curve -- the contribution on tagging accuracy of the individual rules. Note: requires matplotlib |
Function | demo |
Templates can have more than a single feature. |
Function | demo |
The feature/s of a template takes a list of positions relative to the current word where the feature should be looked for, conceptually joined by logical OR. For instance, Pos([-1, 1]), given a value V, will hold whenever V is found one step to the left and/or one step to the right. |
Function | demo |
Exemplify repr(Rule) (see also str(Rule) and Rule.format("verbose")) |
Function | demo |
Serializes the learned tagger to a file in pickle format; reloads it and validates the process. |
Function | demo |
Exemplify repr(Rule) (see also str(Rule) and Rule.format("verbose")) |
Function | demo |
Show aggregate statistics per template. Little used templates are candidates for deletion, much used templates may possibly be refined. |
Function | demo |
Exemplify Rule.format("verbose") |
Function | postag |
Brill Tagger Demonstration :param templates: how many sentences of training and testing data to use :type templates: list of Template |
Constant | NN |
Undocumented |
Constant | REGEXP |
Undocumented |
Function | _demo |
Undocumented |
Function | _demo |
Undocumented |
Run a demo with defaults. See source comments for details, or docstrings of any of the more specific demo_* functions.
Template.expand and Feature.expand are class methods facilitating generating large amounts of templates. See their documentation for details.
Note: training with 500 templates can easily fill all available even on relatively small corpora
Discard rules with low accuracy. This may hurt performance a bit, but will often produce rules which are more interesting read to a human.
Plot a learning curve -- the contribution on tagging accuracy of the individual rules. Note: requires matplotlib
The feature/s of a template takes a list of positions relative to the current word where the feature should be looked for, conceptually joined by logical OR. For instance, Pos([-1, 1]), given a value V, will hold whenever V is found one step to the left and/or one step to the right.
For contiguous ranges, a 2-arg form giving inclusive end points can also be used: Pos(-3, -1) is the same as the arg below.
Show aggregate statistics per template. Little used templates are candidates for deletion, much used templates may possibly be refined.
Deleting unused templates is mostly about saving time and/or space: training is basically O(T) in the number of templates T (also in terms of memory usage, which often will be the limiting factor).
Brill Tagger Demonstration :param templates: how many sentences of training and testing data to use :type templates: list of Template
Note on separate_baseline_data: if True, reuse training data both for baseline and rule learner. This is fast and fine for a demo, but is likely to generalize worse on unseen data. Also cannot be sensibly used for learning curves on training data (the baseline will be artificially high).
Parameters | |
templates | Undocumented |
tagged | maximum number of rule instances to create |
num | how many sentences of training and testing data to use |
max | maximum number of rule instances to create |
min | the minimum score for a rule in order for it to be considered |
min | the minimum score for a rule in order for it to be considered |
train:C{float} | the fraction of the the corpus to be used for training (1=all) |
trace:C{int} | the level of diagnostic tracing output to produce (0-4) |
randomize:C{bool} | whether the training data should be a random subset of the corpus |
ruleformat:C{str} | rule output format, one of "str", "repr", "verbose" |
incremental | if true, will tag incrementally and collect stats for each rule (rather slow) |
template | if true, will print per-template statistics collected in training and (optionally) testing |
error | the file where errors will be saved |
serialize | the file where the learned tbl tagger will be saved |
learning | filename of plot of learning curve(s) (train and also test, if available) |
learning | how many rules plotted |
baseline | the file where rules will be saved |
separate | use a fraction of the training data exclusively for training baseline |
cache | cache baseline tagger to this file (only interesting as a temporary workaround to get deterministic output from the baseline unigram tagger between python versions) |
Undocumented
Value |
|