Add claim_type field: distinguish claims vs responses vs replies

Legal documents have 3 types of assertions:
- claim: from appeal documents (כתב ערר)
- response: from original responses (כתב תשובה)
- reply: from supplementary responses (תגובה, השלמת טיעון)

DB: added claim_type column to claims table
Extractor: _infer_claim_type() auto-detects from doc_type + title
Updated existing 113 records: 29 claims, 28 responses, 56 replies

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 15:35:16 +00:00
parent 328436f56d
commit 96ea54dc6e
2 changed files with 27 additions and 2 deletions

View File

@@ -572,14 +572,15 @@ async def store_claims(case_id: UUID, claims: list[dict], source_document: str =
)
for claim in claims:
await conn.execute(
"""INSERT INTO claims (case_id, party_role, party_name, claim_text, claim_index, source_document)
VALUES ($1, $2, $3, $4, $5, $6)""",
"""INSERT INTO claims (case_id, party_role, party_name, claim_text, claim_index, source_document, claim_type)
VALUES ($1, $2, $3, $4, $5, $6, $7)""",
case_id,
claim["party_role"],
claim.get("party_name", ""),
claim["claim_text"],
claim.get("claim_index", 0),
source_document,
claim.get("claim_type", "claim"),
)
return len(claims)