Class ConfidenceScoredTranslation

  • All Implemented Interfaces:
    Comparable<net.sf.okapi.common.annotation.AltTranslation>

    public class ConfidenceScoredTranslation
    extends net.sf.okapi.common.annotation.AltTranslation
    Extended AltTranslation with detailed confidence scoring from MT quality estimation. This class extends the standard Okapi AltTranslation to include: - Float confidence score (0-1 range) for fine-grained quality assessment - MetricX score (0-25 range, lower is better) - error-based quality metric - COMET score (0-1 range, higher is better) - semantic quality metric - Heuristic score (0-1 range) - rule-based quality estimation Used by MT Confidence Scoring Step to attach quality-scored translations to text unit segments.
    • Field Summary

      • Fields inherited from class net.sf.okapi.common.annotation.AltTranslation

        ORIGIN_SOURCEDOC
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfidenceScoredTranslation​(net.sf.okapi.common.LocaleId sourceLocId, net.sf.okapi.common.LocaleId targetLocId, net.sf.okapi.common.resource.TextFragment originalSource, net.sf.okapi.common.resource.TextFragment alternateSource, net.sf.okapi.common.resource.TextFragment alternateTarget, net.sf.okapi.common.query.MatchType type, String modelId, Double confidenceScore)
      Simplified constructor using confidence score for all integer scores.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(net.sf.okapi.common.annotation.AltTranslation other)
      Compares this translation to another, primarily by confidence score.
      Double getConfidenceScore()
      Gets the fine-grained confidence score (0-1 range).
      void setConfidenceScore​(Double confidenceScore)
      Sets the confidence score.
      • Methods inherited from class net.sf.okapi.common.annotation.AltTranslation

        equals, fromMT, getALttransType, getCombinedScore, getEngine, getEntry, getExType, getFromOriginal, getFuzzyScore, getOrigin, getQualityScore, getSource, getSourceLocale, getTarget, getTargetLocale, getTextUnit, getTool, getType, hashCode, setAltTransType, setCombinedScore, setEngine, setExType, setFromOriginal, setFuzzyScore, setOrigin, setQualityScore, setTarget, setTool, setType, toString
    • Constructor Detail

      • ConfidenceScoredTranslation

        public ConfidenceScoredTranslation​(net.sf.okapi.common.LocaleId sourceLocId,
                                           net.sf.okapi.common.LocaleId targetLocId,
                                           net.sf.okapi.common.resource.TextFragment originalSource,
                                           net.sf.okapi.common.resource.TextFragment alternateSource,
                                           net.sf.okapi.common.resource.TextFragment alternateTarget,
                                           net.sf.okapi.common.query.MatchType type,
                                           String modelId,
                                           Double confidenceScore)
        Simplified constructor using confidence score for all integer scores.
        Parameters:
        sourceLocId - the locale of the source
        targetLocId - the locale of the target
        originalSource - the original source content
        alternateSource - the source content corresponding to the alternate translation
        alternateTarget - the content of alternate translation
        type - the type of alternate translation
        origin - identifier for the origin (e.g., model ID)
        confidenceScore - confidence 0-1 (used for all scores)
    • Method Detail

      • getConfidenceScore

        public Double getConfidenceScore()
        Gets the fine-grained confidence score (0-1 range). This is the primary quality indicator combining all available metrics.
        Returns:
        confidence score between 0.0 (lowest quality) and 1.0 (highest quality)
      • setConfidenceScore

        public void setConfidenceScore​(Double confidenceScore)
        Sets the confidence score.
        Parameters:
        confidenceScore - must be between 0.0 and 1.0
        Throws:
        IllegalArgumentException - if score is out of range
      • compareTo

        public int compareTo​(net.sf.okapi.common.annotation.AltTranslation other)
        Compares this translation to another, primarily by confidence score. Higher confidence scores are ranked first.
        Specified by:
        compareTo in interface Comparable<net.sf.okapi.common.annotation.AltTranslation>
        Overrides:
        compareTo in class net.sf.okapi.common.annotation.AltTranslation
        Parameters:
        other - the AltTranslation to compare to
        Returns:
        negative if this is better, positive if other is better, 0 if equal