Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -17,53 +17,113 @@ task_categories:
|
|
| 17 |
- image-to-text
|
| 18 |
- text-generation
|
| 19 |
- question-answering
|
| 20 |
-
pretty_name: "Expediente 23-F:
|
| 21 |
size_categories:
|
| 22 |
-
- n<
|
| 23 |
---
|
| 24 |
|
| 25 |
-
# Expediente 23-F:
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
-
##
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|---|---|---|
|
| 33 |
-
| `
|
| 34 |
-
| `
|
| 35 |
-
| `
|
| 36 |
-
| `text` | string | Texto extraido de la pagina (OCR / pdf-parse) |
|
| 37 |
-
| `ministry` | string | Ministerio de procedencia (interior, exteriores, defensa) |
|
| 38 |
-
| `archive_id` | string | Signatura del archivo (ej: AGA-83-07633, AGMAE-R39017) |
|
| 39 |
|
| 40 |
-
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
##
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
|
|
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
```python
|
| 55 |
from datasets import load_dataset
|
| 56 |
|
| 57 |
ds = load_dataset("JorgeAV/23f-expediente")
|
| 58 |
|
| 59 |
-
#
|
| 60 |
print(ds["train"][0]["text"])
|
| 61 |
ds["train"][0]["image"].show()
|
| 62 |
|
| 63 |
-
#
|
| 64 |
interior = ds["train"].filter(lambda x: x["ministry"] == "interior")
|
|
|
|
|
|
|
|
|
|
| 65 |
```
|
| 66 |
|
| 67 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
|
|
|
| 17 |
- image-to-text
|
| 18 |
- text-generation
|
| 19 |
- question-answering
|
| 20 |
+
pretty_name: "Expediente 23-F: Declassified Documents from the 1981 Spanish Coup Attempt"
|
| 21 |
size_categories:
|
| 22 |
+
- 1K<n<10K
|
| 23 |
---
|
| 24 |
|
| 25 |
+
# Expediente 23-F: Declassified Documents from the 1981 Spanish Coup Attempt
|
| 26 |
|
| 27 |
+
A page-level multimodal dataset of declassified Spanish government documents related to the failed coup d'etat of February 23, 1981 (known as 23-F). Each row contains a rendered page image paired with its extracted text, sourced from official state archives.
|
| 28 |
|
| 29 |
+
## Historical Context
|
| 30 |
|
| 31 |
+
On February 23, 1981, Lieutenant Colonel Antonio Tejero stormed the Spanish Congress of Deputies with armed Guardia Civil officers during the investiture vote of Prime Minister Leopoldo Calvo-Sotelo. The coup failed after King Juan Carlos I publicly opposed it in a televised address. These documents were declassified and published by the Spanish Government through the *Portal de Archivos Estatales*.
|
| 32 |
+
|
| 33 |
+
## Dataset Schema
|
| 34 |
+
|
| 35 |
+
| Column | Type | Description |
|
| 36 |
+
|---|---|---|
|
| 37 |
+
| `image` | `Image` | Rendered page image (150 DPI) |
|
| 38 |
+
| `pdf_source` | `string` | Relative path to the original PDF or image file |
|
| 39 |
+
| `page_number` | `int32` | Page number within the source document (1-indexed) |
|
| 40 |
+
| `text` | `string` | Extracted text for the page (OCR or pdf-parse) |
|
| 41 |
+
| `ministry` | `string` | Originating ministry (`interior`, `exteriores`, `defensa`) |
|
| 42 |
+
| `archive_id` | `string` | Archival signature (e.g., `AGA-83-07633`, `AGMAE-R39017`) |
|
| 43 |
+
|
| 44 |
+
## Dataset Statistics
|
| 45 |
+
|
| 46 |
+
| Metric | Value |
|
| 47 |
+
|---|---|
|
| 48 |
+
| **Total rows (pages)** | 1,224 |
|
| 49 |
+
| **Source documents** | 167 |
|
| 50 |
+
| **Text coverage** | 100% (all pages have extracted text) |
|
| 51 |
+
| **Total extracted text** | ~12.6 million characters |
|
| 52 |
+
| **File types** | 155 PDFs (92.8%), 12 JPGs (7.2%) |
|
| 53 |
+
|
| 54 |
+
### Documents by Ministry
|
| 55 |
+
|
| 56 |
+
| Ministry | Documents | Description |
|
| 57 |
|---|---|---|
|
| 58 |
+
| `defensa` | 108 | Military intelligence reports (CESID/CNI), internal memos |
|
| 59 |
+
| `exteriores` | 31 | Diplomatic cables, embassy communications, verbal notes |
|
| 60 |
+
| `interior` | 28 | Wiretap transcripts from the Guardia Civil, phone intercepts between conspirators |
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
### Document Characteristics
|
| 63 |
|
| 64 |
+
| Property | Breakdown |
|
| 65 |
+
|---|---|
|
| 66 |
+
| **Format** | 90 typed, 73 scanned, 4 handwritten |
|
| 67 |
+
| **Classification level** | 88 *secreto*, 77 *reservado*, 2 *confidencial* |
|
| 68 |
+
| **Pages per document** | Min: 1, Max: 312, Mean: 7.3 |
|
| 69 |
+
| **Text length per document** | Min: 130 chars, Median: 26.8K chars, Max: 3.45M chars |
|
| 70 |
|
| 71 |
+
## Data Processing Pipeline
|
| 72 |
|
| 73 |
+
### Image Rendering
|
| 74 |
+
- **Tool:** `pdf2image` + Poppler
|
| 75 |
+
- **Resolution:** 150 DPI (PNG)
|
| 76 |
+
- **JPG documents** are loaded directly as single-page images
|
| 77 |
|
| 78 |
+
### Text Extraction
|
| 79 |
+
Two extraction methods were used depending on document type:
|
| 80 |
|
| 81 |
+
1. **pdf-parse** (typed documents): Direct text extraction from digitally-created PDFs
|
| 82 |
+
2. **Vision-Language OCR** (scanned/handwritten documents):
|
| 83 |
+
- **Model:** [`mlx-community/GLM-OCR-bf16`](https://huggingface.co/mlx-community/GLM-OCR-bf16) running on Apple Silicon via MLX
|
| 84 |
+
- **Input resolution:** 200 DPI
|
| 85 |
+
- **Max tokens per page:** 8,192
|
| 86 |
+
- **Post-processing:** Whitespace normalization, paragraph structure preservation
|
| 87 |
+
|
| 88 |
+
The `isOcrText` field in the source metadata indicates which method was used per document.
|
| 89 |
+
|
| 90 |
+
## Usage
|
| 91 |
|
| 92 |
```python
|
| 93 |
from datasets import load_dataset
|
| 94 |
|
| 95 |
ds = load_dataset("JorgeAV/23f-expediente")
|
| 96 |
|
| 97 |
+
# Display a page
|
| 98 |
print(ds["train"][0]["text"])
|
| 99 |
ds["train"][0]["image"].show()
|
| 100 |
|
| 101 |
+
# Filter by ministry
|
| 102 |
interior = ds["train"].filter(lambda x: x["ministry"] == "interior")
|
| 103 |
+
|
| 104 |
+
# Get all pages from a specific document
|
| 105 |
+
doc_pages = ds["train"].filter(lambda x: x["pdf_source"] == "interior/guardia-civil/23F_1_conversacion_gc_tejero.pdf")
|
| 106 |
```
|
| 107 |
|
| 108 |
+
## Intended Uses
|
| 109 |
+
|
| 110 |
+
- **Historical research** on the Spanish Transition to democracy
|
| 111 |
+
- **Document AI** benchmarking: OCR, layout analysis, and document understanding on Spanish historical documents
|
| 112 |
+
- **NLP in Spanish**: text extraction quality evaluation, named entity recognition on official/archival language
|
| 113 |
+
- **Educational projects** about 20th-century European political history
|
| 114 |
+
|
| 115 |
+
## Limitations
|
| 116 |
+
|
| 117 |
+
- OCR quality is lower on handwritten documents (4 out of 167)
|
| 118 |
+
- Some scanned pages may contain text artifacts or recognition errors
|
| 119 |
+
- Text extraction from multi-column layouts may not preserve reading order perfectly
|
| 120 |
+
- All text is in Spanish; no translations are provided
|
| 121 |
+
|
| 122 |
+
## Source & License
|
| 123 |
+
|
| 124 |
+
- **Original documents:** Public domain (declassified records from the Spanish Government, published via the *Portal de Archivos Estatales*)
|
| 125 |
+
- **Structured dataset:** [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)
|
| 126 |
+
|
| 127 |
+
## Associated Project
|
| 128 |
|
| 129 |
+
This dataset powers [23f-expediente](https://github.com/JorgeAV/23f-expediente), an interactive educational web application with an FBI/spy case-file aesthetic for exploring the 23-F documents.
|