cid string | end_document_index int64 | first_key string | kind string | last_key string | relative_path string | row_count int64 | schema_version string | sha256 string | shard_id int32 | size_bytes int64 | start_document_index int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bafkreicxfhjqef4bw4nyvoisjqxrkgvy6bfca3ijaupll4wyt64zenjl2q | 2,173 | bafkreia6wwqjvjvivcsstgjd2edvwofd2lk2slfm67pxot7kfegvv73abm | bm25_documents | bafkreidduaevsqhza7egpz66f6lbkhpu4ui3cjwc6t72poyoica3bkoxru | data/bm25/documents/part-000000.parquet | 2,174 | cvefixes-hf-shard-meta/v1 | 5729d3021781b71b8ab9124c2f151ab8f04a206d09051eb5f2d89fb992352bd4 | 0 | 247,250 | 0 |
Patent Legal IR GraphRAG
Single-dataset retrieval release at
justicedao/patent-legal-ir-graphrag.
Layout matches Publicus IR GraphRAG releases
(Publicus/cvefixes-security-ir-graphrag, Publicus/skillcenter-ir):
| Family | Path | Notes |
|---|---|---|
| Corpus | data/corpus/*.parquet |
dense document_index, CID keys |
| BM25 documents | data/bm25/documents/*.parquet |
lengths + entry CID |
| BM25 postings | data/bm25/postings/*.parquet |
sorted terms, FTS5 IDF, sparse lists |
| Vectors | data/vectors/*.parquet |
256-d embeddings |
| Graph nodes | data/graph/nodes/*.parquet |
structural + BM25 term vocabulary |
| Graph edges | data/graph/edges/*.parquet |
authority edges + contains_term |
| Adjacency | data/graph/adjacency/{incoming,outgoing}/*.parquet |
paged pointers |
| Routing indexes | indexes/*.parquet |
remote shard selection |
Sparse BM25 formula (Publicus)
- Tokenizer:
cvefixes-ascii-code-nfkc-casefold/v1(Publicus HF sparse formula) - Ranking params: k1=1.2, b=0.75, title_weight=5.0, body_weight=1.0
- Terms are sorted lexicographically; postings shards expose
first_term/last_term - IDF: FTS5
log((N - df + 0.5) / (df + 0.5))with floor1e-6 - Shard bounds: ≤ 4096 rows / ≤ 4096 terms per postings shard
Counts
- corpus documents: 2,174
- BM25 terms: 30,514
- BM25 postings: 854,046
- vectors: 2,174
- graph nodes: 37,764 (incl. BM25 terms: 30,514)
- graph edges: 883,628 (contains_term: 854,046)
Efficient retrieval
- Load meta indexes under
indexes/(keyword shards, vector chunks, adjacency). - Probe BM25 by term range → download only matching
data/bm25/postings/part-*.parquet. - Probe vectors by centroid → download only relevant vector shards.
- Expand via graph adjacency pages; BM25 term nodes share the lexical vocabulary.
BM25 layout fragment:
{
"average_document_length": 1771.7778288868444,
"b": 0.75,
"body_weight": 1.0,
"k1": 1.2,
"max_query_terms": 64,
"posting_rows_per_record": 4096,
"terms_per_shard": 4096,
"title_weight": 5.0,
"tokenizer": "cvefixes-ascii-code-nfkc-casefold/v1"
}
Primary identity
- Primary key: content ID (
entry_cid/ CIDv1bafk…) - Secondary pointer: dense
document_index(0..N-1) used only inside sparse postings and shard ranges - Graph endpoints use
node_cid/edge_cid/subject_cid/object_cid
Coverage
| Family | Documents | Source pin |
|---|---|---|
| CFR Title 37 | 1,246 | cfr-title37-annual-2024 (through 2024-07-01) |
| MPEP | 746 | mpep-mpep-9-r07.2022 (through 2022-07-01) |
| 35 U.S.C. | 175 | uscode-title35-2024 |
| USPTO guidance | 7 | uspto-guidance-pdfs-2024-07-17 |
| Total | 2,174 |
Query client (local / e2e)
From the ipfs_datasets_py repository:
# Rule retrieval evaluation suite (BM25 + hybrid, citation-aware ranking)
python3 scripts/ops/legal_data/query_patent_legal_ir_hf.py \
--release-dir /path/to/local/checkout-or-download \
evaluate --strict
# Interactive BM25 (citation + topic→section boost ON by default)
python3 scripts/ops/legal_data/query_patent_legal_ir_hf.py \
--release-dir /path/to/local/checkout-or-download \
bm25 "duty of candor and good faith" --top-k 10
# Explicit section ranking
python3 scripts/ops/legal_data/query_patent_legal_ir_hf.py \
--release-dir /path/to/local/checkout-or-download \
bm25 "information disclosure statement 37 CFR 1.97"
Citation-aware re-ranking:
- explicit cues:
37 CFR 1.97,35 USC 103,MPEP § 2001, bare1.56 - topic lexicon: “duty of candor” →
1.56/ MPEP2001; “IDS timing” →1.97/1.98/609 - family-safe matching (avoids false friends like CFR
2.103for USC103)
Verified e2e (local): 9/9 rule cases PASS; pytest integration suite 13/13 PASS.
Snapshot roots
corpus_root_cid:bafkreiak2bzrnblycry6t34kyusupep3nusxpptwlaffaz7glur3cpeiemrelease_root_cid:bafkreidjgszp2welhobw42nhsvxebcjt7uugqsbufgzph46ghvj2r6vose- layout:
publicus-ir-graphrag/v1 - schema:
patent.public_legal_ir_hf_release/v1
- Downloads last month
- 315