Bilingual Iraqi Oil Contract Clause Extraction & Exception Handler with LangChain
Oil trade contracts written under Iraqi law feature specialized legal Arabic clauses regarding force majeure, port congestion waivers, and currency conversion terms. Build a LangChain extraction agent with custom fallback chains. The agent processes raw contract text, extracts key liability thresholds, flags non-standard exception clauses, and maps Arabic legal phrasing to standard English international oil trade terms.
What you are building
The core problem, expected build, and operating context for this challenge.
Build a bilingual legal clause extraction agent using LangChain Expression Language (LCEL).
How work is evaluated
Evaluates structured clause extraction precision from Arabic petroleum legal agreements.
Challenge datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
notice_period_check
Ensure notice period in hours is extracted accurately.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
clause_extraction_f1
F1 score across extracted contract clauses. • target: 0.95 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
What you should walk away with
Construct LCEL chains using custom RunnableParallel and RunnableLambda functions.
Extract structured liability clauses from bilingual petroleum agreements.
Implement exception routing for ambiguous force majeure clauses.
Reference links and supporting material
25 Arabic-English oil contract clause pairs extracted from regional trade records.
Challenge setup
Evaluates structured clause extraction precision from Arabic petroleum legal agreements.
Challenge input
JSON with contract_text_ar
LangChain
Provides declarative syntax for multi-stage text processing.
Evaluated output
JSON with force_majeure_days, notice_period_hours, requires_somo_written_approval
- Ensure notice period in hours is extracted accurately.
- F1 score across extracted contract clauses. • target: 0.95 • range: 0-1
- Benchmark: LCEL-Extract-Bench
- Clause Extraction F1 target: 0.95
- 1 public reference case
- Python execution harness
- Python sandbox (unavailable on Versalist)
Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.
View technical recipe
Configured tools
- Langchain · Required
- LangChain · Optional
- Zed · Optional
- Langchain · Required
- LangChain · Optional
Evaluation contract
- notice_period_check · Weight 1
- clause_extraction_f1 · Weight 1
Metrics
- clause_extraction_f1 · Target 0.95
Benchmarks
- LCEL-Extract-Bench
- general
Reference cases
- 1 public reference case
Workflow tasks
- Task 1
Input: JSON with contract_text_ar
Output: JSON with force_majeure_days, notice_period_hours, requires_somo_written_approval
Execution harness: Python
Evaluation tools
- LangChain · Chain Composition Engine
Recipe freeze marker
No recipe freeze time is recorded.