Package sentence :: Module pairwiseparallelsentence :: Class PairwiseParallelSentence
[hide private]
[frames] | no frames]

Class PairwiseParallelSentence

source code

                       object --+    
                                |    
parallelsentence.ParallelSentence --+
                                    |
                                   PairwiseParallelSentence

A pairwise parallel sentence, is a parallel sentence that contains output produced by only two systems.

Instance Methods [hide private]
 
__init__(self, source=None, translations=[], systems=[], reference=None, attributes={}, rank_name=u'rank', **kwargs)
Constructor
source code
 
_cast(self, parallelsentence)
Reload in place a pairwise parallelsentence which has the type of a simple parallelsentence
source code
 
_normalize_ranks(self, invert_ranks=False)
Reads the two rank scores for the two respective system outputs, compares them and sets 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
 
get_system_names(self) source code
 
get_rank(self)
provide the rank value of the parallel sentence return: the rank value rtype: string
source code
 
get_translations(self) source code
 
get_reversed(self) source code

Inherited from parallelsentence.ParallelSentence: __eq__, __gt__, __lt__, __str__, add_attributes, add_judgment_id, get_attribute, get_attribute_names, get_attributes, get_compact_id, get_compact_judgment_id, get_filtered_target_attribute_values, get_judgment_id, get_nested_attribute_names, get_nested_attributes, get_pairwise_parallelsentences, get_ranking, get_reference, get_source, get_target_attribute_values, get_tuple_id, has_judgment_id, import_indexed_parallelsentence, import_missing_parallelsentence, merge_parallelsentence, recover_attributes, remove_ties, serialize, set_id, set_langsrc, set_langtgt, set_reference, set_source, set_translations

Inherited from parallelsentence.ParallelSentence (private): _prefix

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

Instance Variables [hide private]
str rank_name
the name of the attribute that serves as the rank
SimpleSentence src
the source sentence
tuple(Simplesentence, SimpleSentence) translations
a tuple of two target sentences

Inherited from parallelsentence.ParallelSentence: ref, tgt

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, source=None, translations=[], systems=[], reference=None, attributes={}, rank_name=u'rank', **kwargs)
(Constructor)

source code 

Constructor

Parameters:
  • source (SimpleSentence) - the source text of the parallel sentence
  • translations (tuple of translations (SimpleSentence, SimpleSentence)) - a pair of translations
  • reference (SimpleSentence) - The desired translation provided by the system
  • the, attributes (dict { String name : String value }) - that describe the parallel sentence
  • systems (tuple of strings) - names of target systems
  • cast - set True if you want to initialize a pairwise parallel sentence out of a simple parallel sentence
Overrides: object.__init__

_cast(self, parallelsentence)

source code 

Reload in place a pairwise parallelsentence which has the type of a simple parallelsentence

Parameters:
  • parellesenentence - the simple parallelsentence
  • parallelsentence (ParallelSentence)

_normalize_ranks(self, invert_ranks=False)

source code 

Reads the two rank scores for the two respective system outputs, compares them and sets 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. The value is set as a new argument of the current object

Parameters:
  • invert_ranks (boolean) - If set to True, it inverts the ranks (useful for non-penalty metrics)

get_rank(self)

source code 

provide the rank value of the parallel sentence return: the rank value rtype: string

Overrides: parallelsentence.ParallelSentence.get_rank
(inherited documentation)

get_translations(self)

source code 
Overrides: parallelsentence.ParallelSentence.get_translations