fix(cv-qa): preserve ambiguous structures and measure extraction accuracy
This commit is contained in:
@@ -104,7 +104,8 @@ public static class CvDocumentReview
|
||||
if (!scalar.TryGetValue<string>(out var text) || string.IsNullOrWhiteSpace(text)) return;
|
||||
var block = Evidence(path, text);
|
||||
if (block is null) { if (value.Parent is JsonObject parent) parent[path.Split('.').Last()] = null; return; }
|
||||
metadata[path] = new() { Method = "deterministic-source", SourceBlockId = block.Id, SourcePage = block.Page, SourceSnippet = text.Length > 500 ? text[..500] : text, ReviewState = "suggested" };
|
||||
var groupingNeedsReview = selected.TryGetValue(path, out var selectedEvidence) && selectedEvidence.Method == "legacy-paragraph-continuation";
|
||||
metadata[path] = new() { Method = groupingNeedsReview ? "legacy-paragraph-continuation" : "deterministic-source", SourceBlockId = block.Id, SourcePage = block.Page, SourceSnippet = text.Length > 500 ? text[..500] : text, ReviewState = groupingNeedsReview ? "needs_review" : "suggested" };
|
||||
}
|
||||
}
|
||||
Walk(node, "");
|
||||
@@ -165,7 +166,7 @@ public static class CvDocumentReview
|
||||
var label = Regex.Replace(path.Split('.').Last(), "([a-z])([A-Z])", "$1 $2");
|
||||
if (int.TryParse(label, out _)) label = "Item";
|
||||
label = char.ToUpperInvariant(label[0]) + label[1..];
|
||||
fields.Add(new(path, label, previous?.ToString(), text, source?.SourceSnippet, source?.SourcePage, source?.Method ?? "deterministic-source", "suggested"));
|
||||
fields.Add(new(path, label, previous?.ToString(), text, source?.SourceSnippet, source?.SourcePage, source?.Method ?? "deterministic-source", source?.ReviewState ?? "suggested"));
|
||||
}
|
||||
}
|
||||
Walk(item, existing, id);
|
||||
|
||||
Reference in New Issue
Block a user