遇见数据集

megabiodiversity/lex-ambiental-pan

收藏
Hugging Face2026-04-18 更新2026-04-26 收录
官方服务:

资源简介:

--- license: cc-by-4.0 language: - es - en tags: - legal - environmental-law - panama - biodiversity - NLP - embeddings - indigenous-rights pretty_name: LEX_AMBIENTAL_PAN size_categories: - 1K<n<10K task_categories: - text-retrieval - text-classification --- # LEX_AMBIENTAL_PAN Machine-readable corpus of **119 Panamanian environmental legal instruments** parsed into **2,955 structured articles**, with multilingual vector embeddings and a semantic relationship graph. ## Quick start ```python from huggingface_hub import hf_hub_download import json, numpy as np # Inventario de instrumentos inv_path = hf_hub_download("megabiodiversity/lex-ambiental-pan", "data/inventario_leyes_pan.json", repo_type="dataset") inventario = json.loads(open(inv_path).read()) print(f"{len(inventario['instrumentos'])} instrumentos") # Embeddings (2955 × 768, float32, L2-normalizado) npz_path = hf_hub_download("megabiodiversity/lex-ambiental-pan", "data/articulos_embeddings.npz", repo_type="dataset") data = np.load(npz_path, allow_pickle=True) vecs, ids = data["embeddings"], data["art_ids"] print(f"Shape: {vecs.shape}") # Índice de artículos idx_path = hf_hub_download("megabiodiversity/lex-ambiental-pan", "data/articulos_index.jsonl", repo_type="dataset") index = [json.loads(l) for l in open(idx_path)] # Búsqueda por similitud coseno query_vec = vecs[0] sims = vecs @ query_vec top5 = sims.argsort()[-6:][::-1][1:] for i in top5: print(ids[i], round(float(sims[i]), 4)) ``` ## Dataset structure ``` lex-ambiental-pan/ ├── data/ │ ├── inventario_leyes_pan.json # 131 instruments, v4.0 │ ├── articulos_embeddings.npz # 2955 × 768 float32 │ ├── articulos_index.jsonl # row metadata │ └── embeddings_meta.json # model info └── TEXTOS/ └── <INSTRUMENT_ID>/ └── articulos.json # parsed articles ``` ## Coverage | Category | Count | |---|---| | Instruments (inventory) | 131 | | Instruments with articles | 119 | | Total articles | 2,955 | | International instruments | ~40 | | National Panamanian instruments | ~79 | Instruments span: constitutional provisions, framework environmental laws, sector laws (fisheries, forests, mining, water, protected areas), executive decrees, international conventions (CBD, CITES, Ramsar, C169 ILO, UNCLOS, Escazú, BBNJ), EU instruments, and indigenous peoples' rights instruments. ## Embeddings Model: `sentence-transformers/paraphrase-multilingual-mpnet-base-v2` (768 dim, multilingual). Vectors are L2-normalized — cosine similarity = dot product. ## Citation ```bibtex @dataset{lex_ambiental_pan_2026, author = {Rodríguez Neira, Juan Carlos}, title = {{LEX\_AMBIENTAL\_PAN: A Structured Corpus of Panamanian Environmental Law}}, year = {2026}, publisher = {Zenodo}, doi = {10.5281/zenodo.19637411}, url = {https://doi.org/10.5281/zenodo.19637411} } ``` ## License CC BY 4.0 — see LICENSE file.

许可证:CC BY 4.0 语言: - 西班牙语 - 英语 标签: - 法律 - 环境法 - 巴拿马 - 生物多样性 - 自然语言处理(Natural Language Processing,简称NLP) - 语义向量嵌入(embeddings) - 原住民权利(indigenous rights) 展示名称:LEX_AMBIENTAL_PAN 样本量区间:1000 < 样本量 < 10000 任务类别: - 文本检索 - 文本分类 # LEX_AMBIENTAL_PAN 本数据集为可机器读取的语料库,包含119份巴拿马环境法律文书,已解析为2955条结构化条款,配套多语言语义向量嵌入与语义关系图谱。 ## 快速上手 python from huggingface_hub import hf_hub_download import json, numpy as np # 法律文书清单 inv_path = hf_hub_download("megabiodiversity/lex-ambiental-pan", "data/inventario_leyes_pan.json", repo_type="dataset") inventario = json.loads(open(inv_path).read()) print(f"{len(inventario['instrumentos'])} 份法律文书") # 语义向量嵌入(2955 × 768,float32,L2归一化) npz_path = hf_hub_download("megabiodiversity/lex-ambiental-pan", "data/articulos_embeddings.npz", repo_type="dataset") data = np.load(npz_path, allow_pickle=True) vecs, ids = data["embeddings"], data["art_ids"] print(f"向量形状:{vecs.shape}") # 条款索引 idx_path = hf_hub_download("megabiodiversity/lex-ambiental-pan", "data/articulos_index.jsonl", repo_type="dataset") index = [json.loads(l) for l in open(idx_path)] # 基于余弦相似度的检索 query_vec = vecs[0] sims = vecs @ query_vec top5 = sims.argsort()[-6:][::-1][1:] for i in top5: print(ids[i], round(float(sims[i]), 4)) ## 数据集结构 lex-ambiental-pan/ ├── data/ │ ├── inventario_leyes_pan.json # 131份法律文书,版本v4.0 │ ├── articulos_embeddings.npz # 2955 × 768 float32 格式向量 │ ├── articulos_index.jsonl # 行元数据 │ └── embeddings_meta.json # 模型元信息 └── TEXTOS/ └── <INSTRUMENT_ID>/ └── articulos.json # 解析后的条款 ## 数据覆盖范围 | 分类 | 数量 | |---|---| | 法律文书清单总数 | 131 | | 含条款的法律文书 | 119 | | 总条款数 | 2955 | | 国际法律文书 | 约40份 | | 巴拿马国家级法律文书 | 约79份 | 本数据集涵盖的法律文书类型包括:宪法条款、环境框架法、部门专项法律(涵盖渔业、林业、矿业、水资源、保护区管理等领域)、行政法令、国际公约(包括《生物多样性公约》(Convention on Biological Diversity, CBD)、《濒危野生动植物种国际贸易公约》(CITES)、《拉姆萨尔湿地公约》(Ramsar Convention)、《国际劳工组织第169号原住民和部落民族公约》(ILO C169)、《联合国海洋法公约》(UNCLOS)、《埃斯卡苏协定》(Escazú Agreement)、《国家管辖范围以外区域海洋生物多样性养护和可持续利用协定》(BBNJ协定))、欧盟法律文书以及原住民权利相关法律文书。 ## 向量嵌入说明 嵌入模型采用`sentence-transformers/paraphrase-multilingual-mpnet-base-v2`(768维,支持多语言)。所有向量均经过L2归一化处理,此时余弦相似度等价于点积计算结果。 ## 引用格式 bibtex @dataset{lex_ambiental_pan_2026, author = {Rodríguez Neira, Juan Carlos}, title = {{LEX_AMBIENTAL_PAN: A Structured Corpus of Panamanian Environmental Law}}, year = {2026}, publisher = {Zenodo}, doi = {10.5281/zenodo.19637411}, url = {https://doi.org/10.5281/zenodo.19637411} } ## 许可证 本数据集采用CC BY 4.0许可证,详细条款详见LICENSE文件。

提供机构:
megabiodiversity
二维码
社区交流群
二维码
科研交流群
商业服务