Class ConfidenceScoredTranslation
- java.lang.Object
-
- net.sf.okapi.common.annotation.AltTranslation
-
- com.acumenvelocity.ath.mt.confidence.ConfidenceScoredTranslation
-
- All Implemented Interfaces:
Comparable<net.sf.okapi.common.annotation.AltTranslation>
public class ConfidenceScoredTranslation extends net.sf.okapi.common.annotation.AltTranslationExtended 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.
-
-
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 intcompareTo(net.sf.okapi.common.annotation.AltTranslation other)Compares this translation to another, primarily by confidence score.DoublegetConfidenceScore()Gets the fine-grained confidence score (0-1 range).voidsetConfidenceScore(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 sourcetargetLocId- the locale of the targetoriginalSource- the original source contentalternateSource- the source content corresponding to the alternate translationalternateTarget- the content of alternate translationtype- the type of alternate translationorigin- 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:
compareToin interfaceComparable<net.sf.okapi.common.annotation.AltTranslation>- Overrides:
compareToin classnet.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
-
-