Download legex/models/classification.py from legexbenchmark/code: direct link, hf CLI and curl.
- Browser
- Download file 2.54 kB
-
https://huggingface.co/datasets/legexbenchmark/code/resolve/main/legex/models/classification.py
- Command line
-
hf download hf://datasets/legexbenchmark/code/legex/models/classification.py
-
curl -L -o classification.py https://huggingface.co/datasets/legexbenchmark/code/resolve/main/legex/models/classification.py
2.54 kB
| from datetime import date | |
| from typing import Literal | |
| from pydantic import BaseModel, ConfigDict, Field | |
| class Classification(BaseModel): | |
| """LLM-extracted variables for a single legal case. | |
| Strict typing: numbers are numbers, dates are dates. The LLM must | |
| return native JSON types — no string-wrapped numerics. | |
| """ | |
| model_config = ConfigDict(strict=True, populate_by_name=True) | |
| legal_subject_judgement: str | None = Field( | |
| default=None, description="Legal subject of the case (English, formatted)." | |
| ) | |
| trial_start_date: date | None = Field( | |
| default=None, description="Trial start date (YYYY-MM-DD)." | |
| ) | |
| trial_end_date: date | None = Field( | |
| default=None, description="Trial end (decision) date (YYYY-MM-DD)." | |
| ) | |
| dispute_value_nominal: float | Literal["nonpecuniary"] | None = Field( | |
| default=None, | |
| description="Amount in dispute as a number, or the literal string 'nonpecuniary'.", | |
| ) | |
| currency_dispute_value_nominal: str | None = Field( | |
| default=None, | |
| alias="Currency_dispute_value_nominal", | |
| description="ISO-4217 currency code for the dispute value (e.g. CHF).", | |
| ) | |
| plaintiff_loosing_share: float | None = Field( | |
| default=None, description="Plaintiff's losing share between 0.0 and 1.0." | |
| ) | |
| court_cost_awarded_nominal: float | None = Field( | |
| default=None, description="Total court fees as a number." | |
| ) | |
| currency_court_cost_awarded_nominal: str | None = Field( | |
| default=None, | |
| alias="Currency_court_cost_awarded_nominal", | |
| description="ISO-4217 currency code for the court fees.", | |
| ) | |
| party_compensation_awarded_nominal: float | None = Field( | |
| default=None, description="Total party compensation as a number." | |
| ) | |
| currency_party_compensation_awarded_nominal: str | None = Field( | |
| default=None, | |
| alias="Currency_party_compensation_awarded_nominal", | |
| description="ISO-4217 currency code for party compensation.", | |
| ) | |
| plaintiffs_all_count: int | None = Field( | |
| default=None, description="Number of plaintiffs." | |
| ) | |
| defendants_all_count: int | None = Field( | |
| default=None, description="Number of defendants." | |
| ) | |
| plaintiff_no1_ISIC1_industry_category: str | None = Field( | |
| default=None, description="ISIC sector for the first plaintiff." | |
| ) | |
| defendant_no1_ISIC1_industry_category: str | None = Field( | |
| default=None, description="ISIC sector for the first defendant." | |
| ) | |