Package featuregenerator :: Module attribute_rank :: Class AttributeRankGenerator
[hide private]
[frames] | no frames]

Class AttributeRankGenerator

source code

                       object --+    
                                |    
featuregenerator.FeatureGenerator --+
                                    |
                                   AttributeRankGenerator

It produces a new ranking of the translated sentences, based on another value. This "clean" ranking starts from zero and has a maximum ranking difference of 1

Instance Methods [hide private]
 
__init__(self, critical_attribute, new_attribute_name=None, reverse=False)
@param critical_attribute The name of the attribute whose value will guide the ranking @type critical_attribute String @param new_attribute_name If the attributes needs to be renamed, the new name must be entered here.
source code
 
add_features_parallelsentence(self, ps)
Augments the provided ParallelSentence with features of the current feature generator.
source code

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

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, critical_attribute, new_attribute_name=None, reverse=False)
(Constructor)

source code 

@param critical_attribute The name of the attribute whose value will guide the ranking @type critical_attribute String @param new_attribute_name If the attributes needs to be renamed, the new name must be entered here. If not entered, then the attribute name is created based on the critical attribute, with the addition of the ending "-rank" @type new_attribute_name String @param reverse Set True if you need it to be sorted on the reverse order @type boolean

Overrides: object.__init__

add_features_parallelsentence(self, ps)

source code 

Augments the provided ParallelSentence with features of the current feature generator. 
    It fires feature generation functions over the included simplesentences it is composed of.
@param parallelsentence: The ParalleSentence whose contents will be augmented
@type parallelsentence: sentence.parallelsentence.ParalleSentence
@rtype: sentence.parallelsentence.ParalleSentence
@return: The given ParalleSentence augmented with features generated from the current featuregenerator 

Overrides: featuregenerator.FeatureGenerator.add_features_parallelsentence
(inherited documentation)