class documentation
Class for transition based parser. Implement 2 algorithms which are "arc-standard" and "arc-eager"
| Method | __init__ |
No summary |
| Method | parse |
No summary |
| Method | train |
:param depgraphs : list of DependencyGraph as the training data :type depgraphs : DependencyGraph :param modelfile : file name to save the trained model :type modelfile : str |
| Constant | ARC |
Undocumented |
| Constant | ARC |
Undocumented |
| Method | _convert |
:return : string of binary features in libsvm format which is 'featureID:value' pairs |
| Method | _create |
Create the training example in the libsvm format and write it to the input_file. Reference : 'A Dynamic Oracle for Arc-Eager Dependency Parsing' by Joav Goldberg and Joakim Nivre |
| Method | _create |
Create the training example in the libsvm format and write it to the input_file. Reference : Page 32, Chapter 3. Dependency Parsing by Sandra Kubler, Ryan McDonal and Joakim Nivre (2009) |
| Method | _get |
Undocumented |
| Method | _is |
Undocumented |
| Method | _write |
write the binary features to input file and update the transition dictionary |
| Instance Variable | _algorithm |
Undocumented |
| Instance Variable | _dictionary |
Undocumented |
| Instance Variable | _match |
Undocumented |
| Instance Variable | _transition |
Undocumented |
| Parameters | |
| algorithm:str | the algorithm option of this parser. Currently support arc-standard and arc-eager algorithm |
| Parameters | |
| depgraphs:list(DependencyGraph) | the list of test sentence, each sentence is represented as a dependency graph where the 'head' information is dummy |
| model | Undocumented |
| modelfile:str | the model file |
| Returns | |
| list (DependencyGraph) with the 'head' and 'rel' information | |
:param depgraphs : list of DependencyGraph as the training data :type depgraphs : DependencyGraph :param modelfile : file name to save the trained model :type modelfile : str
:return : string of binary features in libsvm format which is 'featureID:value' pairs
| Parameters | |
| features:list(str) | list of feature string which is needed to convert to binary features |
Create the training example in the libsvm format and write it to the input_file. Reference : 'A Dynamic Oracle for Arc-Eager Dependency Parsing' by Joav Goldberg and Joakim Nivre
Create the training example in the libsvm format and write it to the input_file. Reference : Page 32, Chapter 3. Dependency Parsing by Sandra Kubler, Ryan McDonal and Joakim Nivre (2009)