Remove confidence scoring and refine correction prompts
This commit is contained in:
@@ -13,7 +13,6 @@ func TestPreviewProposalForSegmentRequireUniqueSuccess(t *testing.T) {
|
||||
TargetSegmentID: 7,
|
||||
OriginalText: "gestures",
|
||||
CorrectedText: "Jesters",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
result := PreviewProposalForSegment(segment, proposal, ReplacementPolicyRequireUnique)
|
||||
@@ -34,7 +33,6 @@ func TestPreviewProposalForSegmentRequireUniqueMissingOriginalText(t *testing.T)
|
||||
TargetSegmentID: 7,
|
||||
OriginalText: "gestures",
|
||||
CorrectedText: "Jesters",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
result := PreviewProposalForSegment(segment, proposal, ReplacementPolicyRequireUnique)
|
||||
@@ -52,7 +50,6 @@ func TestPreviewProposalForSegmentRequireUniqueAmbiguousOriginalText(t *testing.
|
||||
TargetSegmentID: 7,
|
||||
OriginalText: "rank",
|
||||
CorrectedText: "Hrank",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
result := PreviewProposalForSegment(segment, proposal, ReplacementPolicyRequireUnique)
|
||||
@@ -70,7 +67,6 @@ func TestPreviewProposalForSegmentReplaceAllSuccessMultipleOccurrences(t *testin
|
||||
TargetSegmentID: 8,
|
||||
OriginalText: "uh",
|
||||
CorrectedText: "um",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
result := PreviewProposalForSegment(segment, proposal, ReplacementPolicyReplaceAll)
|
||||
@@ -91,7 +87,6 @@ func TestPreviewProposalForSegmentReplaceAllMissingOriginalText(t *testing.T) {
|
||||
TargetSegmentID: 8,
|
||||
OriginalText: "uh",
|
||||
CorrectedText: "um",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
result := PreviewProposalForSegment(segment, proposal, ReplacementPolicyReplaceAll)
|
||||
@@ -109,7 +104,6 @@ func TestPreviewProposalForSegmentNoEffectReplacement(t *testing.T) {
|
||||
TargetSegmentID: 8,
|
||||
OriginalText: "hello",
|
||||
CorrectedText: "hello",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
result := PreviewProposalForSegment(segment, proposal, ReplacementPolicyRequireUnique)
|
||||
@@ -127,7 +121,6 @@ func TestPreviewProposalForSegmentAllowsEmptyCorrectedTextWhenSegmentRemainsNonE
|
||||
TargetSegmentID: 8,
|
||||
OriginalText: "uh ",
|
||||
CorrectedText: "",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
result := PreviewProposalForSegment(segment, proposal, ReplacementPolicyRequireUnique)
|
||||
@@ -140,7 +133,7 @@ func TestPreviewProposalForSegmentAllowsEmptyCorrectedTextWhenSegmentRemainsNonE
|
||||
}
|
||||
|
||||
func TestPreviewProposalForSegmentWhitespaceSpan(t *testing.T) {
|
||||
proposal := CorrectionProposal{TargetSegmentID: 8, OriginalText: " ", CorrectedText: " ", Confidence: 0.9}
|
||||
proposal := CorrectionProposal{TargetSegmentID: 8, OriginalText: " ", CorrectedText: " "}
|
||||
unique := PreviewProposalForSegment(&schema.Segment{ID: 8, Text: "hello world"}, proposal, ReplacementPolicyRequireUnique)
|
||||
if !unique.Applicable || unique.CorrectedSegmentText != "hello world" || unique.ReplacementCount != 1 {
|
||||
t.Fatalf("unexpected spacing preview: %+v", unique)
|
||||
@@ -157,7 +150,7 @@ func TestPreviewProposalForSegmentWhitespaceSpan(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPreviewProposalForSegmentRejectsEmptyOriginalText(t *testing.T) {
|
||||
preview := PreviewProposalForSegment(&schema.Segment{ID: 8, Text: "hello"}, CorrectionProposal{TargetSegmentID: 8, OriginalText: "", CorrectedText: "x", Confidence: 0.9}, ReplacementPolicyRequireUnique)
|
||||
preview := PreviewProposalForSegment(&schema.Segment{ID: 8, Text: "hello"}, CorrectionProposal{TargetSegmentID: 8, OriginalText: "", CorrectedText: "x"}, ReplacementPolicyRequireUnique)
|
||||
if preview.Applicable || preview.SkipReason != SkipReasonInvalidProposal {
|
||||
t.Fatalf("expected invalid empty original: %+v", preview)
|
||||
}
|
||||
@@ -169,7 +162,6 @@ func TestPreviewProposalForSegmentRejectsEmptyResultingSegment(t *testing.T) {
|
||||
TargetSegmentID: 8,
|
||||
OriginalText: "uh",
|
||||
CorrectedText: "",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
result := PreviewProposalForSegment(segment, proposal, ReplacementPolicyRequireUnique)
|
||||
@@ -188,7 +180,6 @@ func TestPreviewProposalForSegmentPreservesInputSegment(t *testing.T) {
|
||||
TargetSegmentID: 9,
|
||||
OriginalText: "rank",
|
||||
CorrectedText: "Hrank",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
|
||||
_ = PreviewProposalForSegment(segment, proposal, ReplacementPolicyReplaceAll)
|
||||
@@ -205,7 +196,6 @@ func TestPreviewProposalForSegmentLiteralMatchingCaseSensitiveAndPunctuation(t *
|
||||
TargetSegmentID: 10,
|
||||
OriginalText: "world.",
|
||||
CorrectedText: "earth.",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
punctuationResult := PreviewProposalForSegment(segment, punctuationProposal, ReplacementPolicyRequireUnique)
|
||||
if !punctuationResult.Applicable {
|
||||
@@ -219,7 +209,6 @@ func TestPreviewProposalForSegmentLiteralMatchingCaseSensitiveAndPunctuation(t *
|
||||
TargetSegmentID: 10,
|
||||
OriginalText: "hello",
|
||||
CorrectedText: "Hi",
|
||||
Confidence: 0.9,
|
||||
}
|
||||
caseMismatchResult := PreviewProposalForSegment(segment, caseMismatchProposal, ReplacementPolicyRequireUnique)
|
||||
if caseMismatchResult.Applicable {
|
||||
|
||||
Reference in New Issue
Block a user