albertgd/legal-divorce-es
收藏Hugging Face2026-03-26 更新2026-03-29 收录
下载链接:
https://hf-mirror.com/datasets/albertgd/legal-divorce-es
下载链接
链接失效反馈官方服务:
资源简介:
---
language:
- es
license: cc-by-4.0
task_categories:
- question-answering
- text-generation
- summarization
tags:
- legal
- spanish
- divorce
- constitutional-court
- rag
- tribunal-constitucional
- amparo
- family-law
pretty_name: Spanish Constitutional Court — Divorce & Family Law Cases
size_categories:
- n<1K
---
# Spanish Constitutional Court — Divorce & Family Law Cases
A curated dataset of **168 rulings** from the Spanish Constitutional Court (*Tribunal Constitucional de España*) related to divorce, separation, and family law proceedings. Each record contains the full anonymised case text, structured legal sections, and agent-ready distilled learnings — designed for building RAG pipelines and fine-tuning legal AI assistants in Spanish.
## Dataset Details
### Source
Cases retrieved from the [official HJ search engine](https://hj.tribunalconstitucional.es/) of the *Tribunal Constitucional de España*. All source documents are public legal records.
### Coverage
| Attribute | Value |
|---|---|
| Total cases | 168 |
| Decision type — SENTENCIA | 97 |
| Decision type — AUTO | 71 |
| Date range | 1986 – present |
| Language | Spanish (es) |
| Size | ~3.8 MB (JSONL) |
### PII Handling
All personal names of private individuals have been anonymised using [Microsoft Presidio](https://github.com/microsoft/presidio) with the `es_core_news_lg` spaCy model:
- **Person names** → `[PERSONA_1]`, `[PERSONA_2]`, … (numbered consistently within each document so the narrative remains coherent)
- **DNI / NIE** → `[DNI]` / `[NIE]`
- **Phone numbers** → `[TELEFONO]`
- **Email addresses** → `[EMAIL]`
Court names, institutional parties, and judges are **preserved** as they are essential legal context and already part of the public record.
---
## Dataset Structure
### Fields
| Field | Type | Description |
|---|---|---|
| `case_id` | string | Internal identifier, e.g. `CASO_11051` |
| `title` | string | Full official title of the ruling |
| `ecli` | string | European Case Law Identifier, e.g. `ECLI:ES:TC:1986:1031A` |
| `url` | string | Source URL on the Tribunal Constitucional website |
| `referencia` | string | Short reference, e.g. `AUTO 1031/1986` |
| `tipo` | string | `SENTENCIA` (judgment) or `AUTO` (court order) |
| `fecha` | string | Date of the ruling in Spanish long form |
| `hechos` | string | Facts / antecedents section (anonymised) |
| `doctrina` | string | Legal doctrine and reasoning section (anonymised) |
| `fallo` | string | Operative part / ruling (anonymised) |
| `sintesis` | string | Official descriptive and analytical synthesis |
| `learnings` | string | Agent-ready distilled learnings: key doctrine, takeaways, and practical notes |
| `text` | string | Full composite text combining all sections — ready for embedding or fine-tuning |
### Example Record
```python
{
"case_id": "CASO_1201",
"title": "Sala Segunda. SENTENCIA 260/1988, de 22 de diciembre",
"ecli": "ECLI:ES:TC:1988:260",
"tipo": "SENTENCIA",
"fecha": "22 de diciembre de 1988",
"hechos": "El Procurador de los Tribunales don [PERSONA_3], en nombre de doña [PERSONA_2], interpone recurso de amparo...",
"learnings": "## Doctrina que se fija\n- La Disposición adicional décima de la Ley 30/1981...",
"text": "# Sala Segunda. SENTENCIA 260/1988...\n\n## Hechos\n..."
}
```
---
## Usage
### Load the dataset
```python
from datasets import load_dataset
ds = load_dataset("albertgd/legal-divorce-es")
print(ds["train"])
```
### RAG pipeline (embed + retrieve)
```python
from datasets import load_dataset
from sentence_transformers import SentenceTransformer
import numpy as np
ds = load_dataset("albertgd/legal-divorce-es", split="train")
model = SentenceTransformer("sentence-transformers/paraphrase-multilingual-mpnet-base-v2")
embeddings = model.encode(ds["text"], show_progress_bar=True)
# Query
query = "¿Cuándo puede modificarse una pensión compensatoria tras el divorcio?"
q_emb = model.encode([query])
scores = np.dot(embeddings, q_emb.T).squeeze()
top_idx = scores.argsort()[-3:][::-1]
for i in top_idx:
print(ds[int(i)]["title"])
print(ds[int(i)]["learnings"][:300])
print()
```
### Fine-tuning (instruction format)
```python
from datasets import load_dataset
ds = load_dataset("albertgd/legal-divorce-es", split="train")
def to_instruction(example):
return {
"prompt": f"Analiza el siguiente caso legal español y extrae los aprendizajes clave:\n\n{example['text']}",
"response": example["learnings"]
}
ft_ds = ds.map(to_instruction)
```
---
## Legal Context
The *Tribunal Constitucional de España* is Spain's supreme interpreter of the Constitution. It handles:
- **Recurso de amparo** — constitutional protection appeals by individuals against violations of fundamental rights
- **Cuestiones de inconstitucionalidad** — questions of unconstitutionality raised by courts
In the context of divorce law, these cases primarily concern:
- Application of **Ley 30/1981** (divorce reform) — retroactivity, transitional provisions
- **Art. 14 CE** — equality / non-discrimination in family settlements
- **Art. 24 CE** — right to effective judicial protection
- Enforcement of foreign divorce judgments (*exequátur*)
- Pension and property disputes in separation / divorce proceedings
---
## Citation
If you use this dataset, please cite the source:
```bibtex
@dataset{albertgd_legal_divorce_es_2026,
author = {albertgd},
title = {Spanish Constitutional Court — Divorce \& Family Law Cases},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/albertgd/legal-divorce-es},
note = {Cases sourced from the Tribunal Constitucional de España (hj.tribunalconstitucional.es). PII anonymised with Microsoft Presidio.}
}
```
Original case texts: © Tribunal Constitucional de España — public records, freely accessible at [hj.tribunalconstitucional.es](https://hj.tribunalconstitucional.es/).
---
## License
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) — you may share and adapt the dataset with attribution.
提供机构:
albertgd



