Add proposal application fixtures
This commit is contained in:
25
internal/framework/proposals/testdata/ambiguous_require_unique.input.json
vendored
Normal file
25
internal/framework/proposals/testdata/ambiguous_require_unique.input.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"policy": "require_unique",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "rank rank"
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "homophones",
|
||||
"module_instance": "homophones",
|
||||
"id": 1,
|
||||
"original_text": "rank",
|
||||
"corrected_text": "Hrank",
|
||||
"confidence": 0.9
|
||||
}
|
||||
]
|
||||
}
|
||||
34
internal/framework/proposals/testdata/categories_metadata_preservation.input.json
vendored
Normal file
34
internal/framework/proposals/testdata/categories_metadata_preservation.input.json
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"policy": "require_unique",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "Narrator",
|
||||
"start": 0,
|
||||
"end": 3,
|
||||
"text": "status",
|
||||
"categories": ["meta", "state"]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"speaker": "Player",
|
||||
"start": 3,
|
||||
"end": 6,
|
||||
"text": "rank",
|
||||
"categories": ["combat"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "glossary",
|
||||
"module_instance": "glossary_1",
|
||||
"id": 2,
|
||||
"original_text": "rank",
|
||||
"corrected_text": "Hrank",
|
||||
"confidence": 0.9
|
||||
}
|
||||
]
|
||||
}
|
||||
20
internal/framework/proposals/testdata/categories_metadata_preservation.transcript.golden.json
vendored
Normal file
20
internal/framework/proposals/testdata/categories_metadata_preservation.transcript.golden.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "Narrator",
|
||||
"start": 0,
|
||||
"end": 3,
|
||||
"text": "status",
|
||||
"categories": ["meta", "state"]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"speaker": "Player",
|
||||
"start": 3,
|
||||
"end": 6,
|
||||
"text": "Hrank",
|
||||
"categories": ["combat"]
|
||||
}
|
||||
]
|
||||
}
|
||||
25
internal/framework/proposals/testdata/missing_segment.input.json
vendored
Normal file
25
internal/framework/proposals/testdata/missing_segment.input.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"policy": "require_unique",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 1,
|
||||
"text": "hello"
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"id": 99,
|
||||
"original_text": "hello",
|
||||
"corrected_text": "hi",
|
||||
"confidence": 0.9
|
||||
}
|
||||
]
|
||||
}
|
||||
68
internal/framework/proposals/testdata/mixed_scenarios.input.json
vendored
Normal file
68
internal/framework/proposals/testdata/mixed_scenarios.input.json
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"policy": "require_unique",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 4,
|
||||
"text": "foo bar rank rank"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"speaker": "B",
|
||||
"start": 4,
|
||||
"end": 5,
|
||||
"text": "hello"
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"id": 1,
|
||||
"original_text": "foo bar",
|
||||
"corrected_text": "foo-bar",
|
||||
"confidence": 0.9
|
||||
},
|
||||
{
|
||||
"proposal_index": 1,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"id": 1,
|
||||
"original_text": "foo bar",
|
||||
"corrected_text": "foobar",
|
||||
"confidence": 0.9
|
||||
},
|
||||
{
|
||||
"proposal_index": 2,
|
||||
"module_key": "homophones",
|
||||
"module_instance": "homophones",
|
||||
"id": 1,
|
||||
"original_text": "rank",
|
||||
"corrected_text": "Hrank",
|
||||
"confidence": 0.9
|
||||
},
|
||||
{
|
||||
"proposal_index": 3,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"id": 99,
|
||||
"original_text": "x",
|
||||
"corrected_text": "y",
|
||||
"confidence": 0.9
|
||||
},
|
||||
{
|
||||
"proposal_index": 4,
|
||||
"module_key": "spoken_word",
|
||||
"module_instance": "spoken_word",
|
||||
"id": 2,
|
||||
"original_text": "hello",
|
||||
"corrected_text": "hello",
|
||||
"confidence": 0.9
|
||||
}
|
||||
]
|
||||
}
|
||||
55
internal/framework/proposals/testdata/mixed_scenarios.records.golden.json
vendored
Normal file
55
internal/framework/proposals/testdata/mixed_scenarios.records.golden.json
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"applied_changes": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"target_segment_id": 1,
|
||||
"original_text": "foo bar",
|
||||
"corrected_text": "foo-bar",
|
||||
"replacement_count": 1
|
||||
}
|
||||
],
|
||||
"skipped_changes": [
|
||||
{
|
||||
"proposal_index": 1,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"target_segment_id": 1,
|
||||
"original_text": "foo bar",
|
||||
"corrected_text": "foobar",
|
||||
"skip_reason": "missing_original_text",
|
||||
"message": "original_text was not found in current segment text"
|
||||
},
|
||||
{
|
||||
"proposal_index": 2,
|
||||
"module_key": "homophones",
|
||||
"module_instance": "homophones",
|
||||
"target_segment_id": 1,
|
||||
"original_text": "rank",
|
||||
"corrected_text": "Hrank",
|
||||
"skip_reason": "ambiguous_original_text",
|
||||
"message": "original_text matched multiple spans under require_unique policy"
|
||||
},
|
||||
{
|
||||
"proposal_index": 3,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"target_segment_id": 99,
|
||||
"original_text": "x",
|
||||
"corrected_text": "y",
|
||||
"skip_reason": "missing_segment",
|
||||
"message": "target segment was not found"
|
||||
},
|
||||
{
|
||||
"proposal_index": 4,
|
||||
"module_key": "spoken_word",
|
||||
"module_instance": "spoken_word",
|
||||
"target_segment_id": 2,
|
||||
"original_text": "hello",
|
||||
"corrected_text": "hello",
|
||||
"skip_reason": "no_effect",
|
||||
"message": "original_text and corrected_text are identical"
|
||||
}
|
||||
]
|
||||
}
|
||||
34
internal/framework/proposals/testdata/multiple_proposals_one_segment.input.json
vendored
Normal file
34
internal/framework/proposals/testdata/multiple_proposals_one_segment.input.json
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"policy": "require_unique",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "foo bar"
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 2,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"id": 1,
|
||||
"original_text": "bar",
|
||||
"corrected_text": "BAR",
|
||||
"confidence": 0.9
|
||||
},
|
||||
{
|
||||
"proposal_index": 1,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"id": 1,
|
||||
"original_text": "foo",
|
||||
"corrected_text": "FOO",
|
||||
"confidence": 0.9
|
||||
}
|
||||
]
|
||||
}
|
||||
11
internal/framework/proposals/testdata/multiple_proposals_one_segment.transcript.golden.json
vendored
Normal file
11
internal/framework/proposals/testdata/multiple_proposals_one_segment.transcript.golden.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "FOO BAR"
|
||||
}
|
||||
]
|
||||
}
|
||||
25
internal/framework/proposals/testdata/multiple_replacements_one_segment.input.json
vendored
Normal file
25
internal/framework/proposals/testdata/multiple_replacements_one_segment.input.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"policy": "replace_all",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "uh uh uh"
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "spoken_word",
|
||||
"module_instance": "spoken_word",
|
||||
"id": 1,
|
||||
"original_text": "uh",
|
||||
"corrected_text": "um",
|
||||
"confidence": 0.9
|
||||
}
|
||||
]
|
||||
}
|
||||
11
internal/framework/proposals/testdata/multiple_replacements_one_segment.transcript.golden.json
vendored
Normal file
11
internal/framework/proposals/testdata/multiple_replacements_one_segment.transcript.golden.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "um um um"
|
||||
}
|
||||
]
|
||||
}
|
||||
25
internal/framework/proposals/testdata/replace_all_behavior.input.json
vendored
Normal file
25
internal/framework/proposals/testdata/replace_all_behavior.input.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"policy": "replace_all",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "ha-ha-ha"
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "spoken_word",
|
||||
"module_instance": "spoken_word",
|
||||
"id": 1,
|
||||
"original_text": "ha",
|
||||
"corrected_text": "ho",
|
||||
"confidence": 0.9
|
||||
}
|
||||
]
|
||||
}
|
||||
11
internal/framework/proposals/testdata/replace_all_behavior.transcript.golden.json
vendored
Normal file
11
internal/framework/proposals/testdata/replace_all_behavior.transcript.golden.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "ho-ho-ho"
|
||||
}
|
||||
]
|
||||
}
|
||||
25
internal/framework/proposals/testdata/simple_replacement.input.json
vendored
Normal file
25
internal/framework/proposals/testdata/simple_replacement.input.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"policy": "require_unique",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 1.25,
|
||||
"text": "gestures"
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "glossary",
|
||||
"module_instance": "glossary_1",
|
||||
"id": 1,
|
||||
"original_text": "gestures",
|
||||
"corrected_text": "Jesters",
|
||||
"confidence": 0.95
|
||||
}
|
||||
]
|
||||
}
|
||||
11
internal/framework/proposals/testdata/simple_replacement.transcript.golden.json
vendored
Normal file
11
internal/framework/proposals/testdata/simple_replacement.transcript.golden.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 1.25,
|
||||
"text": "Jesters"
|
||||
}
|
||||
]
|
||||
}
|
||||
34
internal/framework/proposals/testdata/stale_after_earlier_replacement.input.json
vendored
Normal file
34
internal/framework/proposals/testdata/stale_after_earlier_replacement.input.json
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"policy": "require_unique",
|
||||
"transcript": {
|
||||
"segments": [
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "A",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "foo bar"
|
||||
}
|
||||
]
|
||||
},
|
||||
"proposals": [
|
||||
{
|
||||
"proposal_index": 0,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"id": 1,
|
||||
"original_text": "foo bar",
|
||||
"corrected_text": "foo-bar",
|
||||
"confidence": 0.9
|
||||
},
|
||||
{
|
||||
"proposal_index": 1,
|
||||
"module_key": "grammar",
|
||||
"module_instance": "grammar_1",
|
||||
"id": 1,
|
||||
"original_text": "foo bar",
|
||||
"corrected_text": "foobar",
|
||||
"confidence": 0.9
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user