Package featuregenerator :: Package wer :: Module werfeaturegenerator :: Class WERFeatureGenerator
[hide private]
[frames] | no frames]

Class WERFeatureGenerator

source code

                       object --+    
                                |    
featuregenerator.FeatureGenerator --+
                                    |
                                   WERFeatureGenerator

Class that provides a feature generator able to count the number of the tokens in the given simplesentences sudo apt-get install python all dev sudo pypi-install python-Levenshtein

Instance Methods [hide private]
dict
get_features_tgt(self, target, parallelsentence)
Calculates word error rate for the given target sentence, against the reference sentence
source code

Inherited from featuregenerator.FeatureGenerator: add_features_batch, add_features_dataset, add_features_parallelsentence, add_features_simplesentence, add_features_src, add_features_tgt, get_annotation_name, get_features_parallelsentence, get_features_simplesentence, get_features_src, get_features_string, process_dataset

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

get_features_tgt(self, target, parallelsentence)

source code 

Calculates word error rate for the given target sentence, against the reference sentence

Parameters:
  • simplesentence (sentence.sentence.SimpleSentence) - The target sentence to be scored
Returns: dict
dictionary containing lenght attribute
Overrides: featuregenerator.FeatureGenerator.get_features_tgt