Datasets:
Formats:
parquet
Languages:
English
Size:
100K - 1M
Tags:
knowledge-graph
knowledge-updating
graph-analysis
factual-knowledge
question-answering
retrieval
License:
Add original FACTPROP graph checkpoint and verified loader
Browse files- GRAPH.md +39 -0
- README.md +18 -5
- SHA256SUMS +5 -2
- final.pkl +3 -0
- load_graph.py +18 -0
- metadata/release.json +4 -2
GRAPH.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FACTPROP graph checkpoint
|
| 2 |
+
|
| 3 |
+
`final.pkl` is the unchanged original checkpoint, 125,274,720 bytes.
|
| 4 |
+
|
| 5 |
+
SHA-256: `437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8`
|
| 6 |
+
|
| 7 |
+
## Structure
|
| 8 |
+
|
| 9 |
+
The pickle contains a dictionary. `payload["graph"]` is a NetworkX **DiGraph**, with 100,015 nodes and 432,562 stored directed edges. Additional keys are `state`, `seed_entities`, `validator_state`, and `scheduler_stats`, retained as original construction metadata.
|
| 10 |
+
|
| 11 |
+
Node identifiers are entity-label strings. Node attributes are `qid` and `qid_status`; QID mappings may be missing or shared by multiple nodes.
|
| 12 |
+
|
| 13 |
+
| Edge field | Meaning |
|
| 14 |
+
| --- | --- |
|
| 15 |
+
| `relation` | Relation identifier |
|
| 16 |
+
| `question` | Associated natural-language question |
|
| 17 |
+
| `surface` | Natural-language statement |
|
| 18 |
+
| `evidence` | Stored supporting text |
|
| 19 |
+
| `confidence` | Construction-time confidence value |
|
| 20 |
+
| `group` | Construction category |
|
| 21 |
+
| `is_inverse` | Whether the edge is an inverse traversal edge |
|
| 22 |
+
|
| 23 |
+
There are 357,205 forward edges and 75,357 inverse edges. Popularity counts incoming edges with `is_inverse is not True`. Do not use total in-degree without filtering inverse edges when comparing to the browser index. Field presence does not guarantee that all values are non-empty or independently correct.
|
| 24 |
+
|
| 25 |
+
## Load and inspect
|
| 26 |
+
|
| 27 |
+
Install `networkx` and `huggingface_hub`, then run the accompanying `load_graph.py`. It downloads the graph, checks its checksum, loads the dictionary, and prints graph counts. Python pickle loading can execute code, so only load a checkpoint you trust.
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
from load_graph import load_graph
|
| 31 |
+
|
| 32 |
+
graph = load_graph()
|
| 33 |
+
entity = "Apple Inc."
|
| 34 |
+
score = sum(1 for _, _, attrs in graph.in_edges(entity, data=True)
|
| 35 |
+
if attrs.get("is_inverse") is not True)
|
| 36 |
+
assert score == 467
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
No graph nodes, mappings, edges, or checkpoint metadata were changed for this release. Mapping revisions must be maintained separately.
|
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
pretty_name: FACTPROP —
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
size_categories:
|
|
@@ -25,14 +25,17 @@ configs:
|
|
| 25 |
|
| 26 |
## Overview
|
| 27 |
|
| 28 |
-
FACTPROP is a factual graph for studying how knowledge updates affect connected facts in large language models. This
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
## Contents
|
| 33 |
|
| 34 |
| File | Description |
|
| 35 |
| --- | --- |
|
|
|
|
|
|
|
|
|
|
| 36 |
| `data/entities.jsonl` | One object per graph node, suitable for the dataset viewer |
|
| 37 |
| `browser-index.json` | Unchanged index used by the project website |
|
| 38 |
| `metadata/graph.json` | Graph counts, thresholds, export date, and source-graph checksum |
|
|
@@ -60,6 +63,16 @@ This score measures connectivity in this graph version. It does not measure sear
|
|
| 60 |
|
| 61 |
For example, `Apple Inc.` / `Q312` has degree **467**, while `Apple` / `Q89` has degree **4**.
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
## Load the index
|
| 64 |
|
| 65 |
```python
|
|
@@ -88,7 +101,7 @@ with open(path, encoding="utf-8") as stream:
|
|
| 88 |
- Some expected mappings, including the Java and Python programming languages, are absent.
|
| 89 |
- A missing mapping does not imply low popularity or a score of zero. A known graph node may independently have a true degree of zero.
|
| 90 |
- Multiple nodes with one QID must be reviewed separately. Do not automatically sum their degrees or take the maximum.
|
| 91 |
-
-
|
| 92 |
|
| 93 |
## Provenance and versions
|
| 94 |
|
|
@@ -98,7 +111,7 @@ Entity labels, QIDs, and scores are preserved without remapping or aggregation.
|
|
| 98 |
|
| 99 |
## License
|
| 100 |
|
| 101 |
-
A dataset-specific license has not yet been specified by the authors. This index release does not assign a new license to its upstream sources. Licensing and attribution
|
| 102 |
|
| 103 |
## Citation
|
| 104 |
|
|
|
|
| 1 |
---
|
| 2 |
+
pretty_name: FACTPROP — Factual Graph and Entity Index
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
size_categories:
|
|
|
|
| 25 |
|
| 26 |
## Overview
|
| 27 |
|
| 28 |
+
FACTPROP is a factual graph for studying how knowledge updates affect connected facts in large language models. This release includes the original `final.pkl` graph checkpoint and the **entity popularity index** used by the project’s browser explorer: 100,015 graph-node records with entity labels, available Wikidata QIDs, and forward-edge object in-degree.
|
| 29 |
|
| 30 |
+
The graph checkpoint includes directed relations and edge attributes for questions, surface statements, and evidence. Experiment outputs and model checkpoints are not included. The dataset viewer displays the entity index; download `final.pkl` to access the complete graph.
|
| 31 |
|
| 32 |
## Contents
|
| 33 |
|
| 34 |
| File | Description |
|
| 35 |
| --- | --- |
|
| 36 |
+
| `final.pkl` | Original graph checkpoint (125,274,720 bytes), unchanged |
|
| 37 |
+
| `GRAPH.md` | Checkpoint structure and graph loading guide |
|
| 38 |
+
| `load_graph.py` | Download, verify, and load the graph |
|
| 39 |
| `data/entities.jsonl` | One object per graph node, suitable for the dataset viewer |
|
| 40 |
| `browser-index.json` | Unchanged index used by the project website |
|
| 41 |
| `metadata/graph.json` | Graph counts, thresholds, export date, and source-graph checksum |
|
|
|
|
| 63 |
|
| 64 |
For example, `Apple Inc.` / `Q312` has degree **467**, while `Apple` / `Q89` has degree **4**.
|
| 65 |
|
| 66 |
+
## Load the graph
|
| 67 |
+
|
| 68 |
+
See [GRAPH.md](GRAPH.md) for the checkpoint schema. After installing `networkx` and `huggingface_hub`, run:
|
| 69 |
+
|
| 70 |
+
```bash
|
| 71 |
+
python load_graph.py
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
The loader verifies the original file checksum before loading it. Only load pickle files from a trusted source.
|
| 75 |
+
|
| 76 |
## Load the index
|
| 77 |
|
| 78 |
```python
|
|
|
|
| 101 |
- Some expected mappings, including the Java and Python programming languages, are absent.
|
| 102 |
- A missing mapping does not imply low popularity or a score of zero. A known graph node may independently have a true degree of zero.
|
| 103 |
- Multiple nodes with one QID must be reviewed separately. Do not automatically sum their degrees or take the maximum.
|
| 104 |
+
- The index supports node-level lookup; use `final.pkl` for graph traversal. The graph alone does not include every experiment input or output needed to reproduce all paper results.
|
| 105 |
|
| 106 |
## Provenance and versions
|
| 107 |
|
|
|
|
| 111 |
|
| 112 |
## License
|
| 113 |
|
| 114 |
+
A dataset-specific license has not yet been specified by the authors. This index release does not assign a new license to its upstream sources. Licensing and upstream attribution remain under review; no new license is assigned by this upload.
|
| 115 |
|
| 116 |
## Citation
|
| 117 |
|
SHA256SUMS
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
fa7d9aec01b9c98c09cebc941265e4351693b362ffb3048d2c86585e84d7800d browser-index.json
|
| 3 |
2c21f2aefb9cbcc749cd813412dd90fea440050eeb8efb3356de786ebeb501e6 data/entities.jsonl
|
|
|
|
|
|
|
| 4 |
29e825c9838eb795a18672eb6a569cc2b666cf6971b5bd911655113a138e94ad metadata/graph.json
|
| 5 |
-
|
|
|
|
| 1 |
+
edb72ce528ffc4495ab97a80767eaa81a08a57d18f4c25d09f47c516b3e414f0 GRAPH.md
|
| 2 |
+
9206dcac8a3fb4ebf99a8d4d1f6e35b4276dbf0c2e4d71572f259c5b53be5966 README.md
|
| 3 |
fa7d9aec01b9c98c09cebc941265e4351693b362ffb3048d2c86585e84d7800d browser-index.json
|
| 4 |
2c21f2aefb9cbcc749cd813412dd90fea440050eeb8efb3356de786ebeb501e6 data/entities.jsonl
|
| 5 |
+
437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8 final.pkl
|
| 6 |
+
dc3b8e818d864a3966ee1c0bba19e788b2648e90100dfc84cdb1f427bae9e389 load_graph.py
|
| 7 |
29e825c9838eb795a18672eb6a569cc2b666cf6971b5bd911655113a138e94ad metadata/graph.json
|
| 8 |
+
8fb3ae92e171613be24a99da45559538da97b81dba174ca70b2b1b366e634acb metadata/release.json
|
final.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8
|
| 3 |
+
size 125274720
|
load_graph.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Download, verify, and load the trusted original FACTPROP checkpoint."""
|
| 2 |
+
import hashlib
|
| 3 |
+
import pickle
|
| 4 |
+
from huggingface_hub import hf_hub_download
|
| 5 |
+
|
| 6 |
+
SHA256 = "437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8"
|
| 7 |
+
|
| 8 |
+
def load_graph():
|
| 9 |
+
path = hf_hub_download("factprop/FACTPROP", "final.pkl", repo_type="dataset")
|
| 10 |
+
with open(path, "rb") as stream:
|
| 11 |
+
content = stream.read()
|
| 12 |
+
if hashlib.sha256(content).hexdigest() != SHA256:
|
| 13 |
+
raise ValueError("Graph checksum mismatch")
|
| 14 |
+
return pickle.loads(content)["graph"]
|
| 15 |
+
|
| 16 |
+
if __name__ == "__main__":
|
| 17 |
+
graph = load_graph()
|
| 18 |
+
print(type(graph).__name__, graph.number_of_nodes(), graph.number_of_edges())
|
metadata/release.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
{
|
| 2 |
-
"release": "
|
| 3 |
"source_repository": "https://github.com/factprop/FACTPROP",
|
| 4 |
"source_commit": "738ab3471f259340db6cacf404f1c0cf8063cfc3",
|
| 5 |
"source_file": "website/data/entities.json",
|
| 6 |
"records": 100015,
|
| 7 |
"missing_qid_records": 33901,
|
| 8 |
"qids_with_multiple_nodes": 5037,
|
| 9 |
-
"scope": "
|
|
|
|
|
|
|
| 10 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"release": "graph-and-index-v1",
|
| 3 |
"source_repository": "https://github.com/factprop/FACTPROP",
|
| 4 |
"source_commit": "738ab3471f259340db6cacf404f1c0cf8063cfc3",
|
| 5 |
"source_file": "website/data/entities.json",
|
| 6 |
"records": 100015,
|
| 7 |
"missing_qid_records": 33901,
|
| 8 |
"qids_with_multiple_nodes": 5037,
|
| 9 |
+
"scope": "Original graph checkpoint and entity popularity index.",
|
| 10 |
+
"graph_file": "final.pkl",
|
| 11 |
+
"graph_sha256": "437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8"
|
| 12 |
}
|