Package sentence :: Module rankhandler :: Class RankHandler
[hide private]
[frames] | no frames]

Class RankHandler

source code

object --+
         |
        RankHandler

classdocs

Instance Methods [hide private]
 
__init__(self, rank_name='rank')
Collection of convenience functions for transforming parallel sentences with many ranks into pairwise mode and vice versa.
source code
 
get_multiclass_from_pairwise_set(self, parallelsentences, allow_ties=False) source code
 
get_pairwise_from_multiclass_sentence(self, parallelsentence, judgement_id, allow_ties=False, exponential=True, rename_rank=True)
Converts a the ranked system translations of one sentence into many sentences containing one translation pair each, so that system output can be compared in a pairwise manner.
source code
 
get_pairwise_from_multiclass_set(self, parallelsentences, allow_ties=False, exponential=True, rename_rank=True) source code
 
merge_overlapping_pairwise_set(self, parallelsentences) source code
 
_annotator_weight(self, ps) source code
 
_normalize_rank(self, system_a, system_b)
Receives two rank scores for the two respective system outputs, compares them and returns a universal comparison value, namely -1 if the first system is better, +1 if the second system output is better, and 0 if they are equally good.
source code

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, rank_name='rank')
(Constructor)

source code 

Collection of convenience functions for transforming parallel sentences with many ranks into pairwise mode and vice versa. Most of the implementations here are ugly with many nested loops, so a more object-oriented approach would be to go through the various DataSet types

Overrides: object.__init__

get_pairwise_from_multiclass_sentence(self, parallelsentence, judgement_id, allow_ties=False, exponential=True, rename_rank=True)

source code 

Converts a the ranked system translations of one sentence into many sentences containing one translation pair each, so that system output can be compared in a pairwise manner.

Parameters:
  • parallelsentence (ParallelSentence) - the parallesentences than needs to be split into pairs
  • allow_ties (boolean @return a list of parallelsentences containing a pair of system translations and a universal rank value) - sentences of equal performance (rank=0) will be included in the set, if this is set to True