cstr commited on
Commit
fc43475
Β·
verified Β·
1 Parent(s): 876e6cf

Add comprehensive README for truly lossless dataset

Browse files
Files changed (1) hide show
  1. README.md +143 -0
README.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-3.0
3
+ task_categories:
4
+ - text-retrieval
5
+ language:
6
+ - en
7
+ tags:
8
+ - wiktionary
9
+ - dictionary
10
+ - english
11
+ - linguistics
12
+ - morphology
13
+ - semantics
14
+ - normalized
15
+ - lossless
16
+ size_categories:
17
+ - 1M<n<10M
18
+ ---
19
+
20
+ # English Wiktionary - TRULY LOSSLESS Normalized SQLite Database
21
+
22
+ This is a **100% lossless, fully normalized** SQLite database of English Wiktionary, capturing EVERY field from the `cstr/en-wiktionary-extracted-all` dataset.
23
+
24
+ ## 🎯 Key Features
25
+
26
+ - **βœ… 100% Lossless**: ALL fields captured including:
27
+ - πŸ”— **Wikilinks** in definitions (semantic connections)
28
+ - πŸ“ **Qualifiers** (e.g., "archaic", "US", "informal")
29
+ - 🏷️ **Sense IDs** (unique identifiers)
30
+ - 🌐 **Wikidata IDs** (for semantic web linking)
31
+ - πŸ“š **Attestations** (historical citations)
32
+ - 🎭 **Head templates** (morphological data)
33
+ - πŸ“– **Info templates** (structured metadata)
34
+ - **⚑ Fast Queries**: Fully indexed schema for sub-20ms queries
35
+ - **πŸ”— Complete Semantic Web**: All relations preserved with sense-level granularity
36
+ - **πŸ“± Mobile-ready**: Optimized for sqflite (Flutter) and local DB use cases
37
+
38
+ ## πŸ“Š Database Statistics
39
+
40
+ - **Entries**: 1,427,190
41
+ - **Word Senses**: 1,705,177
42
+ - **Definitions (Glosses)**: 1,753,523
43
+ - **Wikilinks**: 3,476,476
44
+ - **Sense IDs**: 1,705,177
45
+ - **Qualifiers**: Embedded in senses
46
+ - **Translations**: 3,394,497
47
+ - **Word Forms**: 944,222
48
+ - **Head Templates**: 1,424,086
49
+ - **Pronunciations**: 519,225
50
+ - **Examples**: 708,542
51
+ - **Attestations**: 12,434
52
+ - **Wikidata IDs**: 6,652
53
+ - **Synonyms**: 573,360
54
+ - **Antonyms**: 36,234
55
+ - **Hypernyms**: 23,416
56
+ - **Hyponyms**: 4,576
57
+
58
+ ## πŸ—οΈ Database Schema (40+ Tables)
59
+
60
+ ### New Tables (vs Previous Versions)
61
+ - **head_templates**: Morphological templates
62
+ - **entry_wikipedia**: Wikipedia cross-references
63
+ - **sense_links**: Wikilinks in definitions
64
+ - **sense_raw_tags**: Unstructured tags
65
+ - **sense_wikidata**: Wikidata identifiers
66
+ - **sense_wikipedia**: Wikipedia at sense level
67
+ - **attestations**: Historical citations
68
+ - **info_templates**: Structured metadata
69
+
70
+ ### Core Tables
71
+ - **entries**: Core word data with etymology
72
+ - **senses**: Definitions with qualifier, senseid, head_nr
73
+ - **translations**: Multi-language translations
74
+ - **examples**: Usage examples
75
+ - **semantic relations**: hypernyms/hyponyms/meronyms/holonyms/coordinate_terms
76
+
77
+ ## πŸ“– Usage
78
+
79
+ ### Download
80
+ ```python
81
+ from huggingface_hub import hf_hub_download
82
+ import sqlite3
83
+ import gzip
84
+ import shutil
85
+
86
+ # Download compressed database
87
+ db_gz_path = hf_hub_download(
88
+ repo_id="cstr/en-wiktionary-sqlite-all",
89
+ filename="en_wiktionary_normalized_all.db.gz",
90
+ repo_type="dataset"
91
+ )
92
+
93
+ # Decompress
94
+ db_path = db_gz_path.replace('.gz', '')
95
+ with gzip.open(db_gz_path, 'rb') as f_in:
96
+ with open(db_path, 'wb') as f_out:
97
+ shutil.copyfileobj(f_in, f_out)
98
+
99
+ # Connect
100
+ conn = sqlite3.connect(db_path)
101
+ ```
102
+
103
+ ### Example Queries
104
+
105
+ ```python
106
+ # Get definition with wikilinks for "dog"
107
+ cursor.execute('''
108
+ SELECT g.gloss_text, GROUP_CONCAT(l.link_text, ', ') as links
109
+ FROM entries e
110
+ JOIN senses s ON e.id = s.entry_id
111
+ JOIN glosses g ON s.id = g.sense_id
112
+ LEFT JOIN sense_links l ON s.id = l.sense_id
113
+ WHERE e.word = ? AND e.lang = 'English'
114
+ GROUP BY g.id
115
+ ''', ('dog',))
116
+
117
+ # Get words with specific qualifier (e.g., "archaic")
118
+ cursor.execute('''
119
+ SELECT e.word, s.qualifier, g.gloss_text
120
+ FROM entries e
121
+ JOIN senses s ON e.id = s.entry_id
122
+ JOIN glosses g ON s.id = g.sense_id
123
+ WHERE s.qualifier LIKE '%archaic%'
124
+ LIMIT 10
125
+ ''')
126
+
127
+ # Find Wikidata ID for a sense
128
+ cursor.execute('''
129
+ SELECT e.word, w.wikidata_id
130
+ FROM entries e
131
+ JOIN senses s ON e.id = s.entry_id
132
+ JOIN sense_wikidata w ON s.id = w.sense_id
133
+ WHERE e.word = ?
134
+ ''', ('cat',))
135
+ ```
136
+
137
+ ## πŸ“œ License
138
+
139
+ CC-BY-SA 4.0 (same as source)
140
+
141
+ ## πŸ”„ Version
142
+
143
+ This is a **truly lossless** version capturing all 40+ fields from the source data.