Package featuregenerator :: Module diff_generator :: Class DiffGenerator
[hide private]
[frames] | no frames]

Class DiffGenerator

source code

                       object --+    
                                |    
featuregenerator.FeatureGenerator --+
                                    |
                                   DiffGenerator

Operates on a ParallelSentence with two target sentences (pairwise). Computes subtraction of numerical features with the same name in the two target sentences

Instance Methods [hide private]
 
get_features_parallelsentence(self, parallelsentence)
Gets executed once per parallel 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_simplesentence, get_features_src, get_features_string, get_features_tgt, 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_parallelsentence(self, parallelsentence)

source code 

Gets executed once per parallel sentence. Performs subtraction of the respective numerical features of the 2 target sentences. Features with the same name get subtracted and the new feature gets added to the level of the parallel sentence. This is because the feature generation is being used on the last part of the generation process, upon pairwise comparison

Parameters:
  • parallesentence - the object of the parallelsentence, already containing the simplesentences for the target translations
  • parallelsentence (sentence.parallelsentence.ParallelSentence)
Overrides: featuregenerator.FeatureGenerator.get_features_parallelsentence