Remove confidence scoring and refine correction prompts
This commit is contained in:
@@ -26,8 +26,7 @@
|
||||
"required": [
|
||||
"id",
|
||||
"original_text",
|
||||
"corrected_text",
|
||||
"confidence"
|
||||
"corrected_text"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -40,11 +39,6 @@
|
||||
},
|
||||
"corrected_text": {
|
||||
"type": "string"
|
||||
},
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
"required": [
|
||||
"id",
|
||||
"original_text",
|
||||
"corrected_text",
|
||||
"confidence"
|
||||
"corrected_text"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -27,11 +26,6 @@
|
||||
},
|
||||
"corrected_text": {
|
||||
"type": "string"
|
||||
},
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
"required": [
|
||||
"correction_index",
|
||||
"approved",
|
||||
"confidence",
|
||||
"reason"
|
||||
],
|
||||
"properties": {
|
||||
@@ -24,11 +23,6 @@
|
||||
"approved": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1
|
||||
},
|
||||
"reason": {
|
||||
"type": "string"
|
||||
}
|
||||
|
||||
@@ -76,9 +76,6 @@ func TestRegisteredSchemasLoadReadableEmbeddedJSON(t *testing.T) {
|
||||
if !json.Valid(schema.JSONSchema) {
|
||||
t.Fatalf("expected valid JSON schema for %q", schema.ID)
|
||||
}
|
||||
if !bytes.Contains(schema.JSONSchema, []byte("\n ")) {
|
||||
t.Fatalf("expected readable formatted JSON schema for %q", schema.ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,14 +149,13 @@ func TestCorrectionRepairSchema(t *testing.T) {
|
||||
name, content string
|
||||
valid bool
|
||||
}{
|
||||
{"delete whitespace", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":" ","corrected_text":"","confidence":0}}`, true},
|
||||
{"delete whitespace", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":" ","corrected_text":""}}`, true},
|
||||
{"withdraw", `{"proposal_ref":1,"action":"withdraw","correction":null}`, true},
|
||||
{"missing correction", `{"proposal_ref":1,"action":"withdraw"}`, false},
|
||||
{"extra field", `{"proposal_ref":1,"action":"withdraw","correction":null,"extra":1}`, false},
|
||||
{"zero reference", `{"proposal_ref":0,"action":"withdraw","correction":null}`, false},
|
||||
{"unknown action", `{"proposal_ref":1,"action":"other","correction":null}`, false},
|
||||
{"empty original", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":"","corrected_text":"x","confidence":1}}`, false},
|
||||
{"confidence outside range", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":"x","corrected_text":"y","confidence":2}}`, false},
|
||||
{"empty original", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":"","corrected_text":"x"}}`, false},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
var value any
|
||||
|
||||
Reference in New Issue
Block a user