kiwi.metrics package¶
Submodules¶
kiwi.metrics.functions module¶
-
kiwi.metrics.functions.
delta_average
(y_true, y_rank)[source]¶ Calculate the DeltaAvg score
This is a much faster version than the Perl one provided in the WMT QE task 1.
References: could not find any.
Author: Fabio Kepler (contributed to MARMOT)
Parameters: - y_true – array of reference score (not rank) of each segment.
- y_rank – array of rank of each segment.
Returns: the absolute delta average score.
kiwi.metrics.metrics module¶
-
class
kiwi.metrics.metrics.
CorrectMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
ExpectedErrorMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
F1Metric
(labels, **kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
LogMetric
(targets, metric_name=None, **kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
Logs averages of values in loss, model or batch.
-
class
kiwi.metrics.metrics.
Metric
(target_name=None, metric_name=None, PAD=None, STOP=None, prefix=None)[source]¶ Bases:
object
-
class
kiwi.metrics.metrics.
MovingF1
[source]¶ Bases:
kiwi.metrics.metrics.MovingMetric
-
init
(scores, labels, class_idx=1)[source]¶ Compute F1 Mult for all decision thresholds over (scores, labels) Initialize the threshold s.t. all examples are classified as class_idx. :param scores: Likelihood scores for class index :param Labels: Gold Truth classes in {0,1} :param class_index: ID of class
-
-
class
kiwi.metrics.metrics.
MovingMetric
[source]¶ Bases:
object
Class to compute the changes in one metric as a function of a second metric. Example: F1 score vs. Classification Threshold, Quality vs Skips
-
class
kiwi.metrics.metrics.
MovingSkipsAtQuality
(scores_higher_is_better=False, labels_higher_is_better=False)[source]¶ Bases:
kiwi.metrics.metrics.MovingMetric
Computes Quality of skipped examples vs fraction of skips.
-
choose
(thresholds, target_qual)[source]¶ Chooses the smallest threshold such that avg. quality is greater than or equal to target_qual
-
eval
(scores, labels)[source]¶ Parameters: - scores – Model output quality or error scores. If quality scores are provided, pass scores_higher_is_better=True.
- labels – Ground truth quality or error scores. If quality scores are provided, pass labels_higher_is_better=True.
-
-
class
kiwi.metrics.metrics.
NLLMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
PearsonMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
PerplexityMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
RMSEMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
SpearmanMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
ThresholdCalibrationMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
-
class
kiwi.metrics.metrics.
TokPerSecMetric
(**kwargs)[source]¶ Bases:
kiwi.metrics.metrics.Metric
kiwi.metrics.stats module¶
-
class
kiwi.metrics.stats.
Stats
(metrics, main_metric=None, main_metric_ordering=<built-in function max>, log_interval=0)[source]¶ Bases:
object