un-digital-library
收藏资源简介:
联合国数字图书馆(UNDL)综合主数据集是一个经过系统收集、标准化处理和增强的大规模多语言数据集,源自联合国数字图书馆的官方档案。该图书馆是联合国文件、投票数据、演讲和公共领域地图的核心存储库,涵盖大会、安全理事会、经济及社会理事会、托管理事会和秘书处的资料。数据集通过先进的OAI-PMH收割管道获取原始元数据,并转化为高度结构化的Parquet格式,适用于机器学习任务。数据规模介于1万到10万条记录之间,支持六种联合国官方语言(阿拉伯语、中文、英语、法语、俄语和西班牙语)。数据集包含丰富的字段,如唯一标识符(record_id)、文件符号(doc_symbol)、标题(title)、事件日期(event_date)、年份(year)、主题(subjects)、提及国家(countries_mentioned)、语言(languages)以及PDF链接等。通过数据增强流程,数据集还提取了联合国机构分类(如安全理事会、大会)、文档层级关系、时间精度和国家实体信息,便于进行国际关系分析、多语言自然语言处理、政治科学研究等任务。数据集旨在降低计算社会科学的研究门槛,为训练大语言模型、构建外交关系图网络或执行历史决议的临时查询提供基础设施。
The United Nations Digital Library (UNDL) Comprehensive Main Dataset is a systematically collected, standardized, and enhanced large-scale multilingual dataset derived from the official archives of the United Nations Digital Library. This library serves as the core repository for UN documents, voting data, speeches, and public domain maps, covering materials from the General Assembly, Security Council, Economic and Social Council, Trusteeship Council, and Secretariat. The dataset is acquired through an advanced OAI-PMH harvesting pipeline, converting raw metadata into a highly structured Parquet format suitable for machine learning tasks. It contains between 10,000 and 100,000 records and supports the six official UN languages (Arabic, Chinese, English, French, Russian, and Spanish). The dataset includes rich fields such as unique identifiers (record_id), document symbols (doc_symbol), titles (title), event dates (event_date), years (year), subjects (subjects), mentioned countries (countries_mentioned), languages (languages), and PDF links. Through data enhancement processes, it also extracts UN agency classifications (e.g., Security Council, General Assembly), document hierarchical relationships, temporal precision, and country entity information, facilitating tasks like international relations analysis, multilingual natural language processing, and political science research. The dataset aims to lower the barrier to computational social science research, providing infrastructure for training large language models, constructing diplomatic relationship graph networks, or performing temporal queries on historical resolutions.
数据集概述
基本信息
- 数据集名称: United Nations Digital Library (UNDL) Comprehensive Master Dataset
- 语言: 阿拉伯语、中文、英语、法语、俄语、西班牙语
- 许可证: CC-BY-4.0
- 数据规模: 10,000 - 100,000 条记录
- 任务类型: 文本分类、文本生成、标记分类、翻译、问答、摘要、特征提取
数据来源与采集
- 来源: 联合国数字图书馆,涵盖联合国大会、安全理事会、经济及社会理事会、托管理事会和秘书处的文档、投票数据、演讲和公共领域地图。
- 采集方式: 通过自定义的 OAI-PMH (开放档案倡议元数据收割协议) 爬取管道实现,脚本为
un_digital_library_harvester.py。 - 管道特性:
- 断点续传: 使用
harvest_state.json文件保存状态,支持中断后通过--resume标志恢复。 - 网络弹性: 默认3秒请求延迟,遇到服务器过载(如502、503、504错误)时采用指数退避策略(初始5秒,最大重试5次)。
- XML解析: 处理多种命名空间,将嵌套 XML 展平为干净字典。
- PDF链接提取: 识别
.pdf文件链接并保存至pdf_links.jsonl。
- 断点续传: 使用
数据处理与富化
- 处理脚本:
jsonl_to_parquet.py,将原始 JSONL 转换为优化的 Parquet 格式。 - 格式选择理由: Parquet 提供高压缩比(使用
zstd算法)、列式存储效率、类型安全和分片支持(默认每片1000条记录)。 - 富化过程:
- 联合国机构解析: 根据文档符号前缀(A/、S/、E/、T/、ST/)映射至对应机构。
- 文档层级关系: 通过正则解析 Addendum、Revision、Corrigendum 等后缀,提取父文档符号。
- 时间富化: 解析多种日期格式(YYYY-MM-DD、YYYY-MM、YYYY),提取年份并标注精度(exact、month-only、year-only)。
- 地理实体提取: 扫描标题和主题字段,自动识别提及的193个联合国会员国及历史实体。
- 语言映射: 将 ISO 639-2 三字母语言代码转换为可读名称。
- 导出链接生成: 根据记录ID动态生成 BibTeX、EndNote、RefWorks、RIS 和 DublinCore 格式的引用导出 URL。
Parquet 模式定义
| 列名 | 数据类型 | 描述 | 示例 |
|---|---|---|---|
record_id |
Int64 |
联合国数字图书馆分配的唯一整数标识符 | 3849102 |
doc_symbol |
String |
官方联合国文档符号 | S/RES/2585(2021) |
un_body |
String |
文档所属的联合国主要机构 | Security Council |
is_resolution |
Boolean |
是否为正式决议(符号包含 /RES/) |
true |
is_addendum |
Boolean |
是否为增编、修订或更正 | false |
parent_record_symbol |
String |
若为增编,该字段为父文档符号 | A/75/250 |
title |
String |
文档主标题 | Resolution adopted by the General Assembly on 2 March 2022 |
event_date |
String |
原始日期字符串 | 2022-03-02 |
year |
Int64 |
提取的4位年份 | 2022 |
date_precision |
String |
日期精度(exact、month-only、year-only 或 null) | exact |
subjects |
List[String] |
联合国图书馆员分配的主题关键词数组 | ["PEACEKEEPING OPERATIONS", "MALI", "HUMAN RIGHTS"] |
primary_topic |
String |
subjects 数组中的第一个主题 |
PEACEKEEPING OPERATIONS |
countries_mentioned |
List[String] |
标题或主题中明确提及的联合国会员国 | ["Mali", "France"] |
languages |
List[String] |
文档可用的语言列表 | ["English", "French", "Arabic", "Russian", "Spanish", "Chinese"] |
record_url |
String |
文档的联合国数字图书馆页面 URL | https://digitallibrary.un.org/record/3849102 |
pdf_url |
String |
PDF 全文直接下载 URL(如可用) | https://digitallibrary.un.org/record/3849102/files/S_RES_2585-EN.pdf |
has_pdf |
Boolean |
元数据中是否找到 PDF 链接 | true |
export_formats_json |
String |
JSON 编码的引用导出 URL 字典 | {"bibtex": "..."} |
oai_datestamp |
String |
OAI 服务器上元数据记录的最后修改时间戳 | 2024-01-15T08:32:11Z |
联合国文档符号详解
- 主要机构前缀: A/(大会)、S/(安全理事会)、E/(经济及社会理事会)、T/(托管理事会)、ST/(秘书处)。
- 子机构后缀: /C.1/ 至 /C.6/(大会主要委员会)、/CN.(委员会)、/CONF.(会议)、/WG.(工作组)。
- 文档类型: /RES/(决议)、/PRST/(主席声明)、/DEC/(决定)、/L.(有限分发)、/PV.(逐字记录)、/SR.(简要记录)。
- 修改类型: /Add.(增编)、/Amend.(修订)、/Corr.(更正)、/Rev.(修订版)。
使用指南
数据集设计为与 HuggingFace datasets 库高度兼容,适用于 NLP 工作流。




