CoolFace
Datasetpublic

cstr/en-wiktionary-sqlite-full

English Wiktionary - Normalized SQLite Database This is a normalized SQLite database of English Wiktionary, capturing every field from the cstr/en-wiktionary-extracted dataset. Note that this does not include all that would be extractable per wiktextract with --all, like translations, examples, etc. ๐ŸŽฏ Key Features fields captured including: ๐Ÿ”— Wikilinks in definitions (semantic connections) ๐Ÿ“ Qualifiers (e.g., "archaic", "US", "informal") ๐Ÿท๏ธ Sense IDs (uniqueโ€ฆ See the full description on the dataset page: https://huggingface.co/datasets/cstr/en-wiktionary-sqlite-full.

sourceHugging Facecc-by-sa-4.0updated 10mo agoView on Hugging Face
1likes81downloads
Dataset Card

English Wiktionary - Normalized SQLite Database

This is a normalized SQLite database of English Wiktionary, capturing every field from the cstr/en-wiktionary-extracted dataset. Note that this does not include all that would be extractable per wiktextract with --all, like translations, examples, etc.

๐ŸŽฏ Key Features

  • โ€”fields captured including:
  • โ€”๐Ÿ”— Wikilinks in definitions (semantic connections)
  • โ€”๐Ÿ“ Qualifiers (e.g., "archaic", "US", "informal")
  • โ€”๐Ÿท๏ธ Sense IDs (unique identifiers)
  • โ€”๐ŸŒ Wikidata IDs (for semantic web linking)
  • โ€”๐Ÿ“š Attestations (historical citations)
  • โ€”๐ŸŽญ Head templates (morphological data)
  • โ€”๐Ÿ“– Info templates (structured metadata)
  • โ€”โšก Fast Queries: Fully indexed schema for sub-20ms queries
  • โ€”๐Ÿ”— Semantic Web: relations preserved with sense-level granularity
  • โ€”๐Ÿ“ฑ Mobile-ready: Optimized for sq(f)lite (Flutter) and local DB use cases

๐Ÿ“Š Database Statistics

  • โ€”Entries: 1,243,200
  • โ€”Word Senses: 1,361,968
  • โ€”Definitions (Glosses): 1,381,486
  • โ€”Wikilinks: 2,585,821
  • โ€”Sense IDs: 1,361,968
  • โ€”Qualifiers: Embedded in senses
  • โ€”Translations: 0
  • โ€”Word Forms: 700,191
  • โ€”Head Templates: 1,237,679
  • โ€”Pronunciations: 0
  • โ€”Examples: 0
  • โ€”Attestations: 4,295
  • โ€”Wikidata IDs: 2,309
  • โ€”Synonyms: 214,838
  • โ€”Antonyms: 11,816
  • โ€”Hypernyms: 9,818
  • โ€”Hyponyms: 22,649
  • โ€”

๐Ÿ—๏ธ Database Schema (40+ Tables)

New Tables (vs Previous Versions)

  • โ€”head_templates: Morphological templates
  • โ€”entry_wikipedia: Wikipedia cross-references
  • โ€”sense_links: Wikilinks in definitions
  • โ€”sense_raw_tags: Unstructured tags
  • โ€”sense_wikidata: Wikidata identifiers
  • โ€”sense_wikipedia: Wikipedia at sense level
  • โ€”attestations: Historical citations
  • โ€”info_templates: Structured metadata

Core Tables

  • โ€”entries: Core word data with etymology
  • โ€”senses: Definitions with qualifier, senseid, head_nr
  • โ€”translations: Multi-language translations
  • โ€”examples: Usage examples
  • โ€”semantic relations: hypernyms/hyponyms/meronyms/holonyms/coordinate_terms

๐Ÿ“– Usage

Download

python
from huggingface_hub import hf_hub_download
import sqlite3
import gzip
import shutil

# Download compressed database
db_gz_path = hf_hub_download(
    repo_id="cstr/en-wiktionary-sqlite-full",
    filename="en_wiktionary_normalized_full.db.gz",
    repo_type="dataset"
)

# Decompress
db_path = db_gz_path.replace('.gz', '')
with gzip.open(db_gz_path, 'rb') as f_in:
    with open(db_path, 'wb') as f_out:
        shutil.copyfileobj(f_in, f_out)

# Connect
conn = sqlite3.connect(db_path)

Example Queries

python
# Get definition with wikilinks for "dog"
cursor.execute('''
    SELECT g.gloss_text, GROUP_CONCAT(l.link_text, ', ') as links
    FROM entries e
    JOIN senses s ON e.id = s.entry_id
    JOIN glosses g ON s.id = g.sense_id
    LEFT JOIN sense_links l ON s.id = l.sense_id
    WHERE e.word = ? AND e.lang = 'English'
    GROUP BY g.id
''', ('dog',))

# Get words with specific qualifier (e.g., "archaic")
cursor.execute('''
    SELECT e.word, s.qualifier, g.gloss_text
    FROM entries e
    JOIN senses s ON e.id = s.entry_id
    JOIN glosses g ON s.id = g.sense_id
    WHERE s.qualifier LIKE '%archaic%'
    LIMIT 10
''')

# Find Wikidata ID for a sense
cursor.execute('''
    SELECT e.word, w.wikidata_id
    FROM entries e
    JOIN senses s ON e.id = s.entry_id
    JOIN sense_wikidata w ON s.id = w.sense_id
    WHERE e.word = ?
''', ('cat',))

๐Ÿ“œ License

CC-BY-SA 4.0 (same as source)

๐Ÿ”„ Version

This is a truly lossless version capturing all 40+ fields from the source data.