ipfs_iran_laws_ir
收藏资源简介:
这是一个用于伊朗法律信息检索的研究数据集,基于 CID 键控的稀疏 GraphRAG 结构。数据源自 `endomorphosis/ipfs_iran_laws` 的特定版本,打包为 `country-laws-ir-graphrag/v1` 布局。数据集包含 11,249 篇法律文章(Articles)作为规范文档,无独立法律条目(Laws 计数为 0)。BM25 索引包含 3,708 个术语和 43,282 个 posting,图结构包含 12,055 个节点和 147,164 条边,向量嵌入为 11,249 条 384 维的 `thenlper/gte-small` 向量。每条记录的主键为 `entry_cid`(CIDv1 raw sha2-256 规范身份记录),规范字段包括:entry_cid, law_cid, record_type, jurisdiction, language, instrument_id, instrument_title, article_number, article_title, title, body, source_url, snapshot_date, coverage, license, collector, source_dataset, source_revision。数据优先以文章/节为单元,若 `articles.parquet` 为空则回退至法律级。索引布局采用 Zstandard 压缩的 Parquet 分片,每片最多 4,096 行,包括:BM25 关键字分片、向量路由质心分片、语料库分片、属性图节点/边、以及入度/出度邻接表。BM25 使用 Okapi BM25 算法(k1=1.2, b=0.75, title_weight=5, body_weight=1,基于 FTS5 unicode61 分词器)。图节点包括每个 `entry_cid` 对应的节点以及基于 jurisdiction、language、instrument、source、status 等构建的面节点;邻居边(BM25_NEIGHBOR_OF, k=8)携带分数和匹配词,结构边包括 ARTICLE_OF(文章到父法律)等。数据集仅供研究使用,不构成法律建议,官方公报或伊朗真实来源优先。查询可通过 Python 脚本执行 BM25、向量或图邻居搜索。
This is a research dataset for Iranian legal information retrieval, based on a CID-keyed sparse GraphRAG structure. The data originates from a specific version of `endomorphosis/ipfs_iran_laws` and is packaged in the `country-laws-ir-graphrag/v1` layout. The dataset contains 11,249 legal articles as canonical documents, with no independent law entries (Laws count is 0). The BM25 index includes 3,708 terms and 43,282 postings, the graph structure has 12,055 nodes and 147,164 edges, and vector embeddings consist of 11,249 384-dimensional vectors from `thenlper/gte-small`. Each records primary key is `entry_cid` (CIDv1 raw sha2-256 canonical identity record). Canonical fields include: entry_cid, law_cid, record_type, jurisdiction, language, instrument_id, instrument_title, article_number, article_title, title, body, source_url, snapshot_date, coverage, license, collector, source_dataset, source_revision. Data is prioritized at the article/section level, falling back to the law level if `articles.parquet` is empty. The index layout uses Zstandard-compressed Parquet shards, each with up to 4,096 rows, including: BM25 keyword shards, vector routing centroid shards, corpus shards, property graph nodes/edges, and in-degree/out-degree adjacency lists. BM25 uses the Okapi BM25 algorithm (k1=1.2, b=0.75, title_weight=5, body_weight=1, based on FTS5 unicode61 tokenizer). Graph nodes include nodes corresponding to each `entry_cid` and facet nodes built from jurisdiction, language, instrument, source, status, etc.; neighbor edges (BM25_NEIGHBOR_OF, k=8) carry scores and matching words, and structural edges include ARTICLE_OF (article to parent law). The dataset is for research use only and does not constitute legal advice; official gazettes or authentic Iranian sources take precedence. Queries can be executed via Python scripts for BM25, vector, or graph neighbor search.
数据集概述
数据集名称:Iran legislation IR (CID-keyed sparse GraphRAG)
数据集链接:https://huggingface.co/datasets/justicedao/ipfs_iran_laws_ir
许可证:other(非标准许可,具体条款需参考上游数据集)
任务类别:文本检索(text-retrieval)
标签:法律、伊朗、GraphRAG、BM25、研究用途(非法律建议)
数据集内容
该数据集是伊朗立法文本的研究检索快照,源自 endomorphosis/ipfs_iran_laws 数据集的一个修订版本(revision cc3e6e1f1e29cf1d7b58bf7ad248d812b4ff94a4),并按 country-laws-ir-graphrag/v1 布局重新打包。
关键统计信息:
| 项目 | 数量 |
|---|---|
| 法律(语料单元) | 0 |
| 条款(语料单元) | 11,249 |
| 规范文档数 | 11,249 |
| BM25 词项数 | 3,708 |
| BM25 倒排记录数 | 43,282 |
| 图节点数 | 12,055 |
| 图边数 | 147,164 |
| 向量数 | 11,249 × 384维(thenlper/gte-small 嵌入) |
数据单元策略:优先使用条款/章节行;当 articles.parquet 为空时,回退至法律级数据。
数据字段(Canonical Fields)
每条记录包含以下字段:
entry_cid(主键,CIDv1 raw sha2-256)law_cid、record_type、jurisdiction、languageinstrument_id、instrument_titlearticle_number、article_title、title、bodysource_url、snapshot_date、coveragelicense、collector、source_dataset、source_revision
数据配置(Configs)
数据集包含多个子配置(config),均为 train 分割,使用 parquet 格式:
| 配置名 | 对应数据路径 | 说明 |
|---|---|---|
corpus |
data/corpus/*.parquet |
语料单元 |
bm25_documents |
data/bm25/documents/*.parquet |
BM25 文档 |
bm25_postings |
data/bm25/postings/*.parquet |
BM25 倒排记录 |
bm25_keyword_index |
indexes/bm25_keyword_shards.parquet |
词项索引(词项范围→倒排分片) |
vectors |
data/vectors/*.parquet |
向量数据 |
vector_meta_index |
indexes/vector_chunks.parquet |
语义路由质心(按余弦相似度排序) |
graph_nodes |
data/graph/nodes/*.parquet |
属性图节点 |
graph_edges |
data/graph/edges/*.parquet |
属性图边 |
graph_outgoing_adjacency |
data/graph/adjacency/outgoing/*.parquet |
按得分排序的出边邻接表 |
graph_incoming_adjacency |
data/graph/adjacency/incoming/*.parquet |
按得分排序的入边邻接表 |
索引另含 indexes/corpus_chunks.parquet(文档范围→语料分片)。
存储格式:Zstandard 压缩的 parquet 分片,每分片最多 4,096 行。
检索算法参数
- BM25:Okapi 算法,k1=1.2,b=0.75,标题权重=5,正文权重=1(FTS5 unicode61 风格分词器)
- 图结构:每个
entry_cid一个节点,另有侧面节点(facet nodes,按司法辖区、语言、文书、来源、状态生成);邻居边BM25_NEIGHBOR_OF(k=8)携带得分和匹配词项;结构性边包括ARTICLE_OF(条款→父法律)、IDENTIFIED_BY_ELI/IDENTIFIED_BY(仅在源数据中存在相应标识符时使用)
重要声明
- 非法律建议:这是研究快照,伊朗官方公报/权威来源优先于本语料库。检索出的文档和图边仅为检索证据,未发明任何法律文本。
- 主键说明:
entry_cid是规范身份记录的 CID;整数document_index只是紧凑的分片指针,而非身份标识。 - 来源说明:CID 标识本地内容,不证明公共 IPFS 固定。
用途建议
该数据集适用于法律文本检索、图检索增强生成(GraphRAG)等研究场景,尤其适合对伊朗法律体系进行自然语言查询、语义检索和知识图谱分析的研究工作。




