Wuhuwill Cursor commited on
Commit
37c81ba
·
1 Parent(s): d397850

Add browsable knowledge connections

Browse files

Co-authored-by: Cursor <cursoragent@cursor.com>

Files changed (3) hide show
  1. README.md +63 -6
  2. SHA256SUMS +2 -1
  3. data/knowledge_edges.parquet +3 -0
README.md CHANGED
@@ -10,8 +10,12 @@ tags:
10
  - factprop
11
  - tabular
12
  configs:
13
- - config_name: entity_index
14
  default: true
 
 
 
 
15
  data_files:
16
  - split: curated
17
  path: data/entities_curated.jsonl
@@ -25,9 +29,9 @@ configs:
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 `factprop_graph_v1.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 dataset viewer exposes only the derived `curated` split so that recognizable, mapped entities appear first. The unchanged complete entity index—including numeric labels and unresolved nodes—remains available as the downloadable `data/entities.jsonl` file. Download `factprop_graph_v1.pkl` to access the complete graph with directed relations and edge attributes for questions, surface statements, and evidence.
31
 
32
  ## Contents
33
 
@@ -36,6 +40,7 @@ The dataset viewer exposes only the derived `curated` split so that recognizable
36
  | `factprop_graph_v1.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_curated.jsonl` | Derived browsing view: mapped, readable labels sorted by structural popularity |
40
  | `data/entities.jsonl` | One unchanged record per graph node, including numeric and unresolved labels |
41
  | `browser-index.json` | Unchanged index used by the project website |
@@ -43,11 +48,30 @@ The dataset viewer exposes only the derived `curated` split so that recognizable
43
  | `metadata/release.json` | Source version and mapping statistics |
44
  | `SHA256SUMS` | File integrity checksums |
45
 
 
 
46
  The `curated` split contains records whose labels include at least one letter, do not begin with a negative numeric value, and whose QIDs match the standard `Q<number>` form. It is sorted by descending `forward_object_in_degree`. Records and scores are copied without modification, QID duplicates are not merged, and the split is intended only to improve browsing.
47
 
48
  The downloadable `data/entities.jsonl` file remains the complete 100,015-record entity index in its original order. The `curated` split is not a training or test split.
49
 
50
- ## Fields
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  | Field | Type | Meaning |
53
  | --- | --- | --- |
@@ -81,11 +105,44 @@ The loader verifies the original file checksum before loading it. Only load pick
81
  ```python
82
  from datasets import load_dataset
83
 
 
84
  curated = load_dataset("factprop/FACTPROP", "entity_index", split="curated")
85
  matches = curated.filter(lambda row: row["qid"] == "Q312")
86
  print(matches[:])
87
  ```
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  To retrieve the browser-format file:
90
 
91
  ```python
@@ -104,7 +161,7 @@ with open(path, encoding="utf-8") as stream:
104
  - Some expected mappings, including the Java and Python programming languages, are absent.
105
  - 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.
106
  - Multiple nodes with one QID must be reviewed separately. Do not automatically sum their degrees or take the maximum.
107
- - Numeric labels can represent literal values, identifiers, or extraction artifacts. They are graph nodes, not standalone factual claims, and remain available only in the complete downloadable index.
108
  - The `curated` split is a display filter, not a quality label. Use `data/entities.jsonl` and graph-edge context for research analysis.
109
  - The index supports node-level lookup; use `factprop_graph_v1.pkl` for graph traversal. The graph alone does not include every experiment input or output needed to reproduce all paper results.
110
 
@@ -112,7 +169,7 @@ with open(path, encoding="utf-8") as stream:
112
 
113
  The files derive from the index already published in the [FACTPROP code repository](https://github.com/factprop/FACTPROP/tree/738ab3471f259340db6cacf404f1c0cf8063cfc3/website/data). That index was exported from the paper graph; its source checksum is retained in `metadata/graph.json`. The graph was constructed from Wikipedia-derived facts with Wikidata validation, as described in the paper.
114
 
115
- Entity labels, QIDs, and scores are preserved without remapping or aggregation. Proposed mapping corrections should be maintained separately from the original records.
116
 
117
  ## License
118
 
 
10
  - factprop
11
  - tabular
12
  configs:
13
+ - config_name: knowledge_graph
14
  default: true
15
+ data_files:
16
+ - split: knowledge_edges
17
+ path: data/knowledge_edges.parquet
18
+ - config_name: entity_index
19
  data_files:
20
  - split: curated
21
  path: data/entities_curated.jsonl
 
29
 
30
  ## Overview
31
 
32
+ FACTPROP is a factual graph for studying how knowledge updates affect connected facts in large language models. This release includes the original `factprop_graph_v1.pkl` graph checkpoint, a browsable table of 357,205 forward knowledge edges, and the **entity popularity index** used by the project’s browser explorer.
33
 
34
+ The dataset viewer opens on `knowledge_edges`, where every row shows a `subject → relation → object` connection. The `curated` split provides a compact entity-level view sorted by structural popularity. Download `factprop_graph_v1.pkl` to obtain the complete NetworkX graph, including forward facts, auxiliary inverse traversal edges, questions, surface statements, evidence, confidence, and construction metadata.
35
 
36
  ## Contents
37
 
 
40
  | `factprop_graph_v1.pkl` | Original graph checkpoint (125,274,720 bytes), unchanged |
41
  | `GRAPH.md` | Checkpoint structure and graph loading guide |
42
  | `load_graph.py` | Download, verify, and load the graph |
43
+ | `data/knowledge_edges.parquet` | Derived table of all forward `subject → relation → object` knowledge connections |
44
  | `data/entities_curated.jsonl` | Derived browsing view: mapped, readable labels sorted by structural popularity |
45
  | `data/entities.jsonl` | One unchanged record per graph node, including numeric and unresolved labels |
46
  | `browser-index.json` | Unchanged index used by the project website |
 
48
  | `metadata/release.json` | Source version and mapping statistics |
49
  | `SHA256SUMS` | File integrity checksums |
50
 
51
+ The `knowledge_edges` split contains all 357,205 forward edges from the checkpoint and excludes the 75,357 generated inverse traversal edges. It is sorted by descending object in-degree so highly connected knowledge is easy to inspect. Internal negative year literals are rendered as readable BCE dates—for example, `-3100` becomes `3100 BCE`—without changing the checkpoint.
52
+
53
  The `curated` split contains records whose labels include at least one letter, do not begin with a negative numeric value, and whose QIDs match the standard `Q<number>` form. It is sorted by descending `forward_object_in_degree`. Records and scores are copied without modification, QID duplicates are not merged, and the split is intended only to improve browsing.
54
 
55
  The downloadable `data/entities.jsonl` file remains the complete 100,015-record entity index in its original order. The `curated` split is not a training or test split.
56
 
57
+ ## Knowledge-edge fields
58
+
59
+ | Field | Meaning |
60
+ | --- | --- |
61
+ | `edge_id` | Sequential row identifier starting at zero; not a graph-node identifier |
62
+ | `subject`, `relation`, `object` | Human-readable forward knowledge connection |
63
+ | `subject_qid`, `object_qid` | Wikidata QIDs where available; literals have no QID |
64
+ | `object_type` | `entity`, `literal`, or `date_literal` |
65
+ | `question` | Natural-language question associated with the edge |
66
+ | `surface` | Natural-language statement expressing the connection |
67
+ | `group` | Construction category such as Person, Work, or Event |
68
+ | `confidence` | Construction-time confidence value where available |
69
+ | `subject_forward_out_degree` | Number of forward facts originating at the subject |
70
+ | `object_forward_in_degree` | Number of forward facts pointing to the object; FACTPROP structural popularity |
71
+
72
+ The Parquet table is a complete row-wise view of the forward graph topology and selected edge metadata, with BCE literals normalized for display. Use the checkpoint as the canonical source when exact raw labels, inverse edges, stored evidence, or construction state are required.
73
+
74
+ ## Entity-index fields
75
 
76
  | Field | Type | Meaning |
77
  | --- | --- | --- |
 
105
  ```python
106
  from datasets import load_dataset
107
 
108
+ edges = load_dataset("factprop/FACTPROP", "knowledge_graph", split="knowledge_edges")
109
  curated = load_dataset("factprop/FACTPROP", "entity_index", split="curated")
110
  matches = curated.filter(lambda row: row["qid"] == "Q312")
111
  print(matches[:])
112
  ```
113
 
114
+ Each edge row can be interpreted directly:
115
+
116
+ ```python
117
+ row = edges[0]
118
+ print(row["subject"], "--", row["relation"], "-->", row["object"])
119
+ print("Object connectivity:", row["object_forward_in_degree"])
120
+ ```
121
+
122
+ ## Download the complete connected graph
123
+
124
+ To download the entire dataset repository, including the original graph checkpoint:
125
+
126
+ ```bash
127
+ hf download factprop/FACTPROP \
128
+ --repo-type dataset \
129
+ --local-dir FACTPROP-data
130
+ ```
131
+
132
+ Or use Python:
133
+
134
+ ```python
135
+ from huggingface_hub import snapshot_download
136
+
137
+ snapshot_download(
138
+ repo_id="factprop/FACTPROP",
139
+ repo_type="dataset",
140
+ local_dir="FACTPROP-data",
141
+ )
142
+ ```
143
+
144
+ Downloading only a split through `load_dataset` retrieves its viewer table, not the full checkpoint. `FACTPROP-data/factprop_graph_v1.pkl` is the complete connected knowledge graph. Load only this trusted pickle after verifying its published SHA-256 checksum.
145
+
146
  To retrieve the browser-format file:
147
 
148
  ```python
 
161
  - Some expected mappings, including the Java and Python programming languages, are absent.
162
  - 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.
163
  - Multiple nodes with one QID must be reviewed separately. Do not automatically sum their degrees or take the maximum.
164
+ - Numeric labels can represent literal values such as dates or identifiers. Negative numeric labels in this graph are BCE date literals, not negative row indices or negative popularity scores.
165
  - The `curated` split is a display filter, not a quality label. Use `data/entities.jsonl` and graph-edge context for research analysis.
166
  - The index supports node-level lookup; use `factprop_graph_v1.pkl` for graph traversal. The graph alone does not include every experiment input or output needed to reproduce all paper results.
167
 
 
169
 
170
  The files derive from the index already published in the [FACTPROP code repository](https://github.com/factprop/FACTPROP/tree/738ab3471f259340db6cacf404f1c0cf8063cfc3/website/data). That index was exported from the paper graph; its source checksum is retained in `metadata/graph.json`. The graph was constructed from Wikipedia-derived facts with Wikidata validation, as described in the paper.
171
 
172
+ Entity labels, QIDs, and scores are preserved without remapping or aggregation. The `knowledge_edges` table changes only the display of negative year literals; topology and metrics are derived directly from the unchanged checkpoint. Proposed mapping corrections should be maintained separately from the original records.
173
 
174
  ## License
175
 
SHA256SUMS CHANGED
@@ -1,8 +1,9 @@
1
  8eebe4a8b875d1061c7b55947883b455fa1565fb6a6e39b8056c7160381d7cfc GRAPH.md
2
- 1f479379eb91932edfe661c57738afb6afb54a6a941544b728840e0a4f1c1d2c README.md
3
  fa7d9aec01b9c98c09cebc941265e4351693b362ffb3048d2c86585e84d7800d browser-index.json
4
  010beb905ef89b491159a8d8b2b013ea55219d26c8545bed07f64010bfa9ffce data/entities_curated.jsonl
5
  2c21f2aefb9cbcc749cd813412dd90fea440050eeb8efb3356de786ebeb501e6 data/entities.jsonl
 
6
  437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8 factprop_graph_v1.pkl
7
  c73d0a4b3f6df2166ba960a64cd5d3522728f46c2597f4f6604cc65533b46888 load_graph.py
8
  29e825c9838eb795a18672eb6a569cc2b666cf6971b5bd911655113a138e94ad metadata/graph.json
 
1
  8eebe4a8b875d1061c7b55947883b455fa1565fb6a6e39b8056c7160381d7cfc GRAPH.md
2
+ 34bacddc6cf5f77513415be6bd8cb0c24b7b95251a35168a1c069ce372601dfd README.md
3
  fa7d9aec01b9c98c09cebc941265e4351693b362ffb3048d2c86585e84d7800d browser-index.json
4
  010beb905ef89b491159a8d8b2b013ea55219d26c8545bed07f64010bfa9ffce data/entities_curated.jsonl
5
  2c21f2aefb9cbcc749cd813412dd90fea440050eeb8efb3356de786ebeb501e6 data/entities.jsonl
6
+ 6fe12df06d87425f2c8a9d2c9e8fb805896190e3f40325b45be15f7d6e182b53 data/knowledge_edges.parquet
7
  437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8 factprop_graph_v1.pkl
8
  c73d0a4b3f6df2166ba960a64cd5d3522728f46c2597f4f6604cc65533b46888 load_graph.py
9
  29e825c9838eb795a18672eb6a569cc2b666cf6971b5bd911655113a138e94ad metadata/graph.json
data/knowledge_edges.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fe12df06d87425f2c8a9d2c9e8fb805896190e3f40325b45be15f7d6e182b53
3
+ size 17291148