Upload folder using huggingface_hub
Browse files
ldv-backend/detector/detector_distilbert.py
CHANGED
|
@@ -186,6 +186,10 @@ _DOC_TYPE_SPECS: list[dict] = [
|
|
| 186 |
"label": "purchase order",
|
| 187 |
"hypothesis": "This document is a purchase order requesting the supply of goods or services.",
|
| 188 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
]
|
| 190 |
|
| 191 |
# ── Clause risk hypotheses for zero-shot classification ───────────────────────
|
|
|
|
| 186 |
"label": "purchase order",
|
| 187 |
"hypothesis": "This document is a purchase order requesting the supply of goods or services.",
|
| 188 |
},
|
| 189 |
+
{
|
| 190 |
+
"label": "non-contract",
|
| 191 |
+
"hypothesis": "This document is a resume, curriculum vitae (CV), article, advertisement, letter, or other non-contract text.",
|
| 192 |
+
},
|
| 193 |
]
|
| 194 |
|
| 195 |
# ── Clause risk hypotheses for zero-shot classification ───────────────────────
|
ldv-backend/detector/detector_explain.py
CHANGED
|
@@ -141,6 +141,7 @@ def _unified_explain_prompt(findings: str, text_excerpt: str, jurisdiction: Opti
|
|
| 141 |
juris = jurisdiction or "the detected jurisdiction"
|
| 142 |
return (
|
| 143 |
"You are a legal expert performing a contract analysis and compliance check.\n"
|
|
|
|
| 144 |
"Based on the findings and excerpt below, generate the following 4 sections. "
|
| 145 |
"You MUST format the output exactly as requested, beginning each section with its respective "
|
| 146 |
"=== HEADER === delimiter line, followed by the content for that section.\n\n"
|
|
|
|
| 141 |
juris = jurisdiction or "the detected jurisdiction"
|
| 142 |
return (
|
| 143 |
"You are a legal expert performing a contract analysis and compliance check.\n"
|
| 144 |
+
"CRITICAL VALIDATION: If the document is clearly NOT a contract (e.g. it is a resume, CV, article, personal letter, or advertisement), you MUST write EXACTLY 'This document does not appear to be a contract.' under the '=== RISK SUMMARY ===' header, and leave all other sections entirely blank.\n\n"
|
| 145 |
"Based on the findings and excerpt below, generate the following 4 sections. "
|
| 146 |
"You MUST format the output exactly as requested, beginning each section with its respective "
|
| 147 |
"=== HEADER === delimiter line, followed by the content for that section.\n\n"
|