Remove confidence scoring and refine correction prompts

This commit is contained in:
2026-11-11 17:05:52 +00:00
parent bbf89bb4f5
commit d155bf4cb3
92 changed files with 448 additions and 786 deletions

View File

@@ -15,7 +15,6 @@ func TestApplyProposalsApplyingOneProposal(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "gestures",
CorrectedText: "Jesters",
Confidence: 0.95,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 0, ModuleKey: "glossary", ModuleInstance: "glossary_1"},
},
@@ -42,7 +41,6 @@ func TestApplyProposalsApplyingMultipleProposalsInStableOrder(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "Hrank",
CorrectedText: "X",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 2, ModuleKey: "grammar", ModuleInstance: "grammar_1"},
},
@@ -51,7 +49,6 @@ func TestApplyProposalsApplyingMultipleProposalsInStableOrder(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "rank",
CorrectedText: "Hrank",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 1, ModuleKey: "homophones", ModuleInstance: "homophones"},
},
@@ -78,7 +75,6 @@ func TestApplyProposalsStaleProposalSkippedAfterEarlierChange(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "foo bar",
CorrectedText: "foo-bar",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 0, ModuleKey: "grammar", ModuleInstance: "grammar_1"},
},
@@ -87,7 +83,6 @@ func TestApplyProposalsStaleProposalSkippedAfterEarlierChange(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "foo bar",
CorrectedText: "foobar",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 1, ModuleKey: "grammar", ModuleInstance: "grammar_1"},
},
@@ -112,8 +107,8 @@ func TestApplyProposalsStaleProposalSkippedAfterEarlierChange(t *testing.T) {
func TestApplyProposalsRechecksBlankResultAfterEarlierDeletion(t *testing.T) {
transcript := &schema.Transcript{Segments: []schema.Segment{{ID: 1, Text: "a b"}}}
proposed := []EnrichedCorrectionProposal{
{CorrectionProposal: CorrectionProposal{TargetSegmentID: 1, OriginalText: "a", CorrectedText: "", Confidence: 1}, ProposalMetadata: ProposalMetadata{ProposalIndex: 0}},
{CorrectionProposal: CorrectionProposal{TargetSegmentID: 1, OriginalText: "b", CorrectedText: "", Confidence: 1}, ProposalMetadata: ProposalMetadata{ProposalIndex: 1}},
{CorrectionProposal: CorrectionProposal{TargetSegmentID: 1, OriginalText: "a", CorrectedText: ""}, ProposalMetadata: ProposalMetadata{ProposalIndex: 0}},
{CorrectionProposal: CorrectionProposal{TargetSegmentID: 1, OriginalText: "b", CorrectedText: ""}, ProposalMetadata: ProposalMetadata{ProposalIndex: 1}},
}
for _, candidate := range proposed {
if preview := PreviewProposalForSegment(&transcript.Segments[0], candidate.CorrectionProposal, ReplacementPolicyRequireUnique); !preview.Applicable {
@@ -137,7 +132,6 @@ func TestApplyProposalsMissingSegmentSkip(t *testing.T) {
TargetSegmentID: 999,
OriginalText: "hello",
CorrectedText: "hi",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 0, ModuleKey: "grammar", ModuleInstance: "grammar_1"},
},
@@ -161,7 +155,6 @@ func TestApplyProposalsRequireUniqueAmbiguousSkip(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "uh",
CorrectedText: "um",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 0, ModuleKey: "spoken_word", ModuleInstance: "spoken_word"},
},
@@ -185,7 +178,6 @@ func TestApplyProposalsReplaceAllMultipleReplacements(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "uh",
CorrectedText: "um",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 0, ModuleKey: "spoken_word", ModuleInstance: "spoken_word"},
},
@@ -214,7 +206,6 @@ func TestApplyProposalsNoMutationOfInputTranscript(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "hello",
CorrectedText: "hi",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 0, ModuleKey: "grammar", ModuleInstance: "grammar_1"},
},
@@ -243,7 +234,6 @@ func TestApplyProposalsSegmentMetadataPreservation(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "rank",
CorrectedText: "Hrank",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 0, ModuleKey: "glossary", ModuleInstance: "glossary_1"},
},
@@ -268,7 +258,6 @@ func TestApplyProposalsAppliedAndSkippedRecords(t *testing.T) {
TargetSegmentID: 1,
OriginalText: "hello",
CorrectedText: "hi",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 0, ModuleKey: "grammar", ModuleInstance: "grammar_1"},
},
@@ -277,7 +266,6 @@ func TestApplyProposalsAppliedAndSkippedRecords(t *testing.T) {
TargetSegmentID: 999,
OriginalText: "x",
CorrectedText: "y",
Confidence: 0.9,
},
ProposalMetadata: ProposalMetadata{ProposalIndex: 1, ModuleKey: "grammar", ModuleInstance: "grammar_1"},
},