You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

platovec — Wikipedia entities, documents, linearity triples & ZELDA links

A dataset for studying entity representations in LLMs: how entities are encoded, how those representations form, and their causal effects.

Built from a seed entity list (the factual relations of Hernandez et al. 2024, by title, plus ZELDA mention targets, by Wikipedia page id) by joining wikimedia/structured-wikipedia (text + links) and Wikidata — labels / aliases / properties from either the Wikidata API or a local .json.bz2 dump.

Configs

config granularity description
entities one row / entity the entity, its text, abstract, aliases, properties, links
documents one row / document mention positions of entities within a document
triples one row / linearity fact (subject, object) + chosen template + QIDs + Wikidata property
templates one row / relation candidate prompt templates per relation (best-first)
links one row / ZELDA document entity-linking mentions for retrieval eval (split test)
from datasets import load_dataset
entities  = load_dataset("ykolo/entityconcepts", "entities",  split="train")
documents = load_dataset("ykolo/entityconcepts", "documents", split="train")
triples   = load_dataset("ykolo/entityconcepts", "triples",   split="train")
links     = load_dataset("ykolo/entityconcepts", "links",     split="test")

entities

column type description
qid str Wikidata QID (row key)
label str entity name (Wikipedia article title)
description str one-line description
alias list[str] alternative names (Wikidata "also known as", English)
wikidata_url str
wikipedia_url str
what_links_here list[str] QIDs of seed entities whose article links to this one
properties list[{property_id, value}] Wikidata claims (value = QID for items, rendered text otherwise)
text str flat article text (reconstructed from structured-wikipedia sections)
abstract str | null article lead/abstract (from structured-wikipedia)
page_id int | null English Wikipedia page id (structured-wikipedia identifier)
n_characters int | null article length (structured-wikipedia version.number_of_characters)
origin list[str] seed origin(s): linearity and/or zelda
n_mentions int total mention occurrences across the documents table
pile_count int | null frequency of the label in the Pile (if provided)
n_triples int number of triples where this entity is the subject
n_tokens_pythia int | null tokens of label under the Pythia (GPT-NeoX) tokenizer
n_tokens_llama int | null tokens of label under the Llama-3.x tokenizer

documents

One row = one document (an entity's Wikipedia article). Lists are aligned by position: entity_ids[i]aliases[i]index[i]. The document text is entities[document_id].text (not duplicated here). Use it to extract an entity's activations at its mention positions across several documents (self-mention ⇔ document_identity_ids).

column type description
document_id str QID of the entity whose article is this document (→ entities.qid)
entity_ids list[str] QID of each mentioned entity (repeats for multiple mentions)
aliases list[str] surface form found in the text for each mention (hyperlink anchor for cross-page mentions; matched label/alias for self-mentions)
index list[[int, int]] character [start, end] offsets in the document's text
entity_count int number of distinct entities mentioned in the document

triples

Facts from the factual linearity relations (one row per (subject, object) sample).

column type description
id int
relation_id str | null mapped Wikidata property, e.g. P36 (null if unmapped)
relation_name str human-readable name, e.g. "country capital city"
template str prompt template with {} as the subject placeholder
template_id int | null index of the template used in templates.templates[] (0 = relation best; may differ per triple with per-triple selection)
subject str subject
subject_qid str|null qid of subject
object str object
object_qid str|null qid of object

links

Entity-linking documents from the ZELDA dataset, for retrieval evaluation. One row = one document; each mention's ZELDA wikipedia_id is matched to the page_id column of entities to recover its QID. Split test (the source column gives the ZELDA subset, e.g. aida-b; train is available too if built). Lists aligned by position: entity_ids[i]index[i]wikipedia_ids[i]wikipedia_titles[i].

column type description
source str split origin (train, or test set name e.g. aida-b)
document_id str | null QID of the document's own Wikipedia page (train only; via entities.page_id)
entity_ids list[str] QID of each mention's gold entity
index list[[int, int]] character [start, end] offsets in text
text str document text
wikipedia_ids list[int] raw ZELDA Wikipedia page ids of the mentions (traceability)
wikipedia_titles list[str] ZELDA Wikipedia titles of the mentions (traceability)

Mentions whose wikipedia_id is not present in entities (entity not scraped) are dropped (logged).

Construction

  • seed entities: subjects + objects of the factual relations (by title) + ZELDA mention targets (by page_id). origin records which source(s) each entity came from.
  • entities / documents: text + link graph from hugging face wikimedia/structured-wikipedia (enwiki); aliases & properties from Wikidata (API or local dump); abstract/text from structured-wikipedia; disambiguation pages filtered out. Mentions: an entity in its own page is found by matching its label + aliases; mentions in other pages come from hyperlink anchors (exact surface form + offset) by default, which avoids false positives (e.g. matching "Paris" inside Notre-Dame de Paris).
  • triples: linearity relations; relation_id is the Wikidata P-id from a static mapping. template is the best prompt — either per relation (max partial-match in generation) or, with per-triple selection, the candidate that maximises the gold object's teacher-forced log-prob for that specific (subject, object).
  • links: ZELDA entity-linking documents; mention wikipedia_id matched to entities.page_id → QID.

Code: https://github.com/siemovit/platovec

Downloads last month
438