Exr0n commited on
Commit
e24dfb3
1 Parent(s): 65ea45b

dataset loading script attempt

Browse files
link_synonyms-2018-thresh_10.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:18b55dd635faceab3fc7319a586bf4f96c97b0e525de45f03f26dd4960a06e52
3
- size 179962151
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b0d40f46c726b44d50f3bf04012d04f0d0c5b19366ecd1b7d48eb5800340c00
3
+ size 179962150
link_synonyms-2018-thresh_20.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1ab3702b28e66c0031ae5fa2b1376c80560a73bd0aeb865cb89106dc389c5256
3
- size 130267170
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa27205303089d737ccbe0baf6a216c99fe2a4dda3876a22cfb35b9364c6bed1
3
+ size 130267169
link_synonyms-2018-thresh_5.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2c44c75e9aa73e417265586796821cf817fd92ab568b3a42812ea4793b73d96c
3
- size 235345207
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98ec11d644c10f5dca6603187be83a6732c4011173e872f49fbe7e8496e82cf1
3
+ size 235345206
requirements.txt ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ acme==1.21.0
2
+ aiohttp==3.8.1
3
+ aiosignal==1.2.0
4
+ alabaster==0.7.12
5
+ apparmor==3.0.3
6
+ appdirs==1.4.4
7
+ arandr==0.1.10
8
+ argcomplete==1.12.3
9
+ async-timeout==4.0.2
10
+ attrs==21.2.0
11
+ Babel==2.9.1
12
+ beautifulsoup4==4.10.0
13
+ bleach==3.3.0
14
+ blessed==1.17.6
15
+ blis==0.7.4
16
+ Brlapi==0.8.3
17
+ btrfsutil==5.15.1
18
+ CacheControl==0.12.6
19
+ catalogue==2.0.4
20
+ certbot==1.21.0
21
+ certbot-nginx==1.19.0
22
+ certifi==2020.12.5
23
+ cffi==1.15.0
24
+ chardet==4.0.0
25
+ charset-normalizer==2.0.9
26
+ click==7.1.2
27
+ click-completion==0.5.2
28
+ cloudpickle==1.6.0
29
+ colorama==0.4.4
30
+ coloredlogs==15.0.1
31
+ ConfigArgParse==1.5
32
+ configobj==5.1.0.dev0
33
+ contextlib2==0.6.0.post1
34
+ coverage==5.5
35
+ crcmod==1.7
36
+ cryptography==35.0.0
37
+ cycler==0.10.0
38
+ cymem==2.0.5
39
+ datasets==1.17.0
40
+ defusedxml==0.7.1
41
+ dill==0.3.4
42
+ distlib==0.3.3
43
+ distro==1.6.0
44
+ dnspython==2.1.0
45
+ docopt==0.6.2
46
+ docutils==0.17.1
47
+ dotty-dict==1.3.0
48
+ emoji==1.6.1
49
+ en-core-web-lg @ https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.1.0/en_core_web_lg-3.1.0-py3-none-any.whl
50
+ file-magic==0.4.0
51
+ filelock==3.4.2
52
+ flake8==3.9.2
53
+ frozenlist==1.2.0
54
+ fsspec==2021.11.1
55
+ future==0.18.2
56
+ gh-md-to-html==1.21.1
57
+ Glances==3.2.1
58
+ greenlet==1.1.0
59
+ gym==0.18.3
60
+ halo==0.0.31
61
+ hid==1.0.4
62
+ hjson==3.0.2
63
+ html5lib==1.1
64
+ httplib2==0.19.1
65
+ huggingface-hub==0.2.1
66
+ humanfriendly==10.0
67
+ idna==2.10
68
+ imagesize==1.3.0
69
+ img2pdf==0.4.1
70
+ importlib-metadata==4.0.1
71
+ importlib-resources==5.2.2
72
+ inquirer==2.7.0
73
+ isc==2.0
74
+ iterfzf==0.5.0.20.0
75
+ jedi==0.17.2
76
+ jeepney==0.6.0
77
+ Jinja2==3.0.1
78
+ joblib==1.0.1
79
+ josepy==1.10.0
80
+ jsonschema==3.2.0
81
+ kaggle==1.5.12
82
+ keyring==23.0.1
83
+ kiwisolver==1.3.1
84
+ lazr.config==2.2.3
85
+ lazr.delegates==2.0.4
86
+ lazr.restfulclient==0.14.2
87
+ lazr.uri==1.0.5
88
+ LibAppArmor==3.0.3
89
+ libarchive-c==3.2
90
+ libfdt==1.6.1
91
+ libvirt-python==7.8.0
92
+ llvmlite==0.36.0
93
+ log-symbols==0.0.14
94
+ loguru==0.5.3
95
+ louis==3.20.0
96
+ lxml==4.6.3
97
+ Markdown==3.3.6
98
+ MarkupSafe==2.0.1
99
+ matplotlib==3.4.2
100
+ mccabe==0.6.1
101
+ meson==0.60.2
102
+ milc==1.4.2
103
+ mock==3.0.5
104
+ more-itertools==8.10.0
105
+ MouseInfo==0.1.3
106
+ msgpack==1.0.2
107
+ multidict==5.2.0
108
+ multiprocess==0.70.12.2
109
+ murmurhash==1.0.5
110
+ mypy-extensions==0.4.3
111
+ neovim==0.3.1
112
+ nftables==0.1
113
+ nltk==3.6.2
114
+ nose==1.3.7
115
+ nose2==0.10.0
116
+ notify-py==0.3.1
117
+ npyscreen==4.10.5
118
+ numba==0.53.1
119
+ numpy==1.20.3
120
+ oauthlib==3.1.1
121
+ ocrmypdf==12.6.0
122
+ openpyscad==0.4.0
123
+ ordered-set==4.0.2
124
+ packaging==20.9
125
+ pacman-mirrors==4.23.1
126
+ pandas==1.3.4
127
+ parsedatetime==2.6
128
+ parso==0.7.1
129
+ pathy==0.6.0
130
+ pbr==5.5.1
131
+ pdfminer.six==20201018
132
+ pendulum==2.1.2
133
+ pep517==0.12.0
134
+ petname==2.0
135
+ pikepdf==3.1.1
136
+ Pillow==8.2.0
137
+ Pit2ya==0.4.2
138
+ pkginfo==1.7.0
139
+ pluggy==0.13.1
140
+ ply==3.11
141
+ preshed==3.0.5
142
+ progress==1.6
143
+ progressbar2==3.55.0
144
+ protobuf==3.17.3
145
+ PTable==0.9.2
146
+ pyarrow==6.0.1
147
+ PyAutoGUI==0.9.52
148
+ pybind11==2.8.1
149
+ pycairo==1.20.1
150
+ pycodestyle==2.7.0
151
+ pycparser==2.21
152
+ pydantic==1.8.2
153
+ pyelftools==0.27
154
+ pyenchant==3.2.1
155
+ pyflakes==2.3.1
156
+ PyGetWindow==0.0.9
157
+ pyglet==1.5.15
158
+ Pygments==2.9.0
159
+ PyGObject==3.42.0
160
+ pylxd==2.3.1
161
+ pymacaroons==0.13.0
162
+ PyMsgBox==1.0.9
163
+ PyMuPDF==1.18.14
164
+ PyNaCl==1.4.0
165
+ pynvim==0.4.3
166
+ pyOpenSSL==21.0.0
167
+ pyparsing==2.4.7
168
+ PyPDF2==1.26.0
169
+ pyperclip==1.8.2
170
+ PyRect==0.1.4
171
+ pyRFC3339==1.1
172
+ pyrsistent==0.18.0
173
+ PyScreeze==0.1.27
174
+ pysha3==1.0.2
175
+ python-apt==0.0.0
176
+ python-dateutil==2.8.1
177
+ python-debian==0.1.42+git20211018
178
+ python-distutils-extra==2.39
179
+ python-editor==1.0.4
180
+ python-jsonrpc-server==0.4.0
181
+ python-language-server==0.36.2
182
+ python-slugify==5.0.2
183
+ python-utils==2.5.6
184
+ python-xlib==0.31
185
+ python3-xlib==0.15
186
+ PyTweening==1.0.3
187
+ pytz==2021.3
188
+ pytzdata==2020.1
189
+ pyusb==1.1.1
190
+ PyYAML==6.0
191
+ ranger-fm==1.9.3
192
+ raven==6.10.0
193
+ readchar==2.0.1
194
+ readme-renderer==29.0
195
+ regex==2021.4.4
196
+ reportlab==3.6.1
197
+ requests==2.26.0
198
+ requests-oauthlib==1.3.0
199
+ requests-toolbelt==0.9.1
200
+ requests-unixsocket==0.2.0
201
+ resolvelib==0.5.5
202
+ retrying==1.3.3
203
+ rfc3986==1.5.0
204
+ scipy==1.7.0
205
+ SecretStorage==3.3.1
206
+ setuptools-scm==6.0.1
207
+ setuptools-scm-git-archive==1.1
208
+ shellescape==3.8.1
209
+ shellingham==1.4.0
210
+ simplejson==3.17.6
211
+ six==1.16.0
212
+ smart-open==5.1.0
213
+ snowballstemmer==2.2.0
214
+ sortedcontainers==2.4.0
215
+ soupsieve==2.2.1
216
+ spacy==3.1.0
217
+ spacy-legacy==3.0.8
218
+ speedtest-cli==2.1.3
219
+ Sphinx==4.3.1
220
+ sphinxcontrib-applehelp==1.0.2
221
+ sphinxcontrib-devhelp==1.0.2
222
+ sphinxcontrib-htmlhelp==2.0.0
223
+ sphinxcontrib-jsmath==1.0.1
224
+ sphinxcontrib-qthelp==1.0.3
225
+ sphinxcontrib-serializinghtml==1.1.5
226
+ spinners==0.0.24
227
+ srsly==2.4.1
228
+ ssoclient==2.1.1
229
+ tabulate==0.8.9
230
+ TBB==0.2
231
+ team==1.0
232
+ termcolor==1.1.0
233
+ text-unidecode==1.3
234
+ thinc==8.0.7
235
+ togglCli==2.4.2
236
+ toml==0.10.2
237
+ tomli==1.2.2
238
+ torch==1.9.1+cu111
239
+ torchaudio==0.9.1
240
+ torchvision==0.10.1+cu111
241
+ tqdm==4.62.3
242
+ twine==3.4.1
243
+ typer==0.3.2
244
+ typing-extensions==3.10.0.2
245
+ ueberzug==18.1.9
246
+ ufw==0.36
247
+ ujson==4.0.2
248
+ urllib3==1.26.7
249
+ uWSGI==2.0.19.1
250
+ validate==5.1.0.dev0
251
+ validate-email==1.3
252
+ wadllib==1.3.4
253
+ wasabi==0.8.2
254
+ wcwidth==0.2.5
255
+ webcolors==1.11.1
256
+ webencodings==0.5.1
257
+ ws4py==0.5.1
258
+ xxhash==2.0.2
259
+ yapf==0.31.0
260
+ yarl==1.7.2
261
+ zipp==3.4.1
262
+ zope.component==5.0.1
263
+ zope.deferredimport==4.3.1
264
+ zope.deprecation==4.4.0
265
+ zope.event==4.5.0
266
+ zope.hookable==5.1.0
267
+ zope.interface==5.4.0
268
+ zope.proxy==4.5.0
wiki-entity-similarity.csv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:1ab3702b28e66c0031ae5fa2b1376c80560a73bd0aeb865cb89106dc389c5256
3
- size 130267170
 
 
 
 
wiki-entity-similarity.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import datasets
2
+
3
+ from dataclasses import dataclass
4
+ import csv
5
+
6
+ _DESCRIPTION = '''WES: Learning Semantic Similarity from 6M Names for 1M Entities'''
7
+ _CITE = '''\
8
+ @inproceedings{exr0n2022WES
9
+ author={Exr0n},
10
+ title={WES: Learning Semantic Similarity from 6M Names for 1M Entities},
11
+ year={2022}
12
+ }
13
+ '''
14
+
15
+ @dataclass
16
+ class WikiEntitySimilarityConfig(datasets.BuilderConfig):
17
+ """BuilderConfig for CSV."""
18
+ threshhold: int = None
19
+ path: str = None
20
+
21
+ class WikiEntitySimilarity(datasets.GeneratorBasedBuilder):
22
+ """WES: Learning semantic similarity from 6M names for 1M entities"""
23
+ BUILDER_CONFIG_CLASS = WikiEntitySimilarityConfig
24
+ BUILDER_CONFIGS = [
25
+ WikiEntitySimilarityConfig(
26
+ name='2008thresh5',
27
+ description='min 5 inbound links, lowest quality',
28
+ threshhold=5,
29
+ path="https://huggingface.co/datasets/Exr0n/wiki-entity-similarity/resolve/main/link_synonyms-2018-thresh_5.csv"
30
+ ),
31
+ WikiEntitySimilarityConfig(
32
+ name='2008thresh10',
33
+ description='min 10 inbound links, medium quality',
34
+ threshhold=10,
35
+ path="https://huggingface.co/datasets/Exr0n/wiki-entity-similarity/resolve/main/link_synonyms-2018-thresh_10.csv"
36
+ ),
37
+ WikiEntitySimilarityConfig(
38
+ name='2008thresh20',
39
+ description='min 20 inbound links, high quality',
40
+ threshhold=20,
41
+ path="https://huggingface.co/datasets/Exr0n/wiki-entity-similarity/resolve/main/link_synonyms-2018-thresh_20.csv"
42
+ ),
43
+ ]
44
+
45
+ def _info(self):
46
+ return datasets.DatasetInfo(
47
+ description=_DESCRIPTION,
48
+ features=datasets.Features(
49
+ {
50
+ 'article': datasets.Value('string'),
51
+ 'link_text': datasets.Value('string'),
52
+ }
53
+ ),
54
+ citation=_CITE,
55
+ homepage="https://github.com/Exr0nProjects/wiki-entity-similarity",
56
+ )
57
+
58
+ def _split_generators(self, dl_manager):
59
+ filepath = dl_manager.download(self.config.path)
60
+ return [ datasets.SplitGenerator(name=datasets.Split.ALL,
61
+ gen_kwargs={ 'filepath': filepath }) ]
62
+
63
+ def _generate_examples(self, filepath):
64
+ with open(filepath, 'r') as rf:
65
+ reader = csv.DictReader(rf)
66
+ for i, row in enumerate(reader):
67
+ yield i, row