Gaëtan Caillaut commited on
Commit
76834b8
1 Parent(s): 85d463c

move word features in python code

Browse files
Files changed (2) hide show
  1. pubmed-word-features.txt +0 -501
  2. pubmed.py +5 -8
pubmed-word-features.txt DELETED
@@ -1,501 +0,0 @@
1
- w-rat
2
- w-common
3
- w-use
4
- w-examin
5
- w-pathogenesi
6
- w-retinopathi
7
- w-mous
8
- w-studi
9
- w-anim
10
- w-model
11
- w-metabol
12
- w-abnorm
13
- w-contribut
14
- w-develop
15
- w-investig
16
- w-mice
17
- w-2
18
- w-month
19
- w-compar
20
- w-obtain
21
- w-method
22
- w-induc
23
- w-6
24
- w-inject
25
- w-experiment
26
- w-normal
27
- w-diet
28
- w-30
29
- w-hyperglycemia
30
- w-level
31
- w-lipid
32
- w-oxid
33
- w-activ
34
- w-protein
35
- w-kinas
36
- w-c
37
- w-measur
38
- w-result
39
- w-increas
40
- w-retin
41
- w-stress
42
- w-3
43
- w-similar
44
- w-observ
45
- w-conclus
46
- w-play
47
- w-import
48
- w-role
49
- w-present
50
- w-p
51
- w-m
52
- w-r
53
- w-muscl
54
- w-control
55
- w-chang
56
- w-dure
57
- w-lower
58
- w-higher
59
- w-mass
60
- w-correl
61
- w-decreas
62
- w-determin
63
- w-concentr
64
- w-stimul
65
- w-period
66
- w-caus
67
- w-mark
68
- w-group
69
- w-evid
70
- w-fast
71
- w-type
72
- w-signific
73
- w-differ
74
- w-ratio
75
- w-suggest
76
- w-degre
77
- w-occur
78
- w-vivo
79
- w-respect
80
- w-dysfunct
81
- w-region
82
- w-high
83
- w-appear
84
- w-sever
85
- w-affect
86
- w-cardiovascular
87
- w-complic
88
- w-primari
89
- w-death
90
- w-patient
91
- w-clinic
92
- w-suscept
93
- w-cardiac
94
- w-tissu
95
- w-specif
96
- w-function
97
- w-defect
98
- w-possibl
99
- w-indic
100
- w-state
101
- w-onli
102
- w-bodi
103
- w-weight
104
- w-loss
105
- w-valu
106
- w-howev
107
- w-4
108
- w-condit
109
- w-durat
110
- w-8
111
- w-week
112
- w-onset
113
- w-data
114
- w-direct
115
- w-report
116
- w-provid
117
- w-addit
118
- w-evalu
119
- w-sensit
120
- w-heart
121
- w-object
122
- w-mean
123
- w-blood
124
- w-glucos
125
- w-strong
126
- w-hba
127
- w-1c
128
- w-a1c
129
- w-variabl
130
- w-independ
131
- w-assess
132
- w-relat
133
- w-trial
134
- w-research
135
- w-design
136
- w-profil
137
- w-sampl
138
- w-particip
139
- w-n
140
- w-1
141
- w-consist
142
- w-befor
143
- w-min
144
- w-predict
145
- w-adjust
146
- w-sex
147
- w-treatment
148
- w-7
149
- w-gt
150
- w-0
151
- w-larg
152
- w-influenc
153
- w-base
154
- w-standard
155
- w-14
156
- w-10
157
- w-wherea
158
- w-enhanc
159
- w-manag
160
- w-day
161
- w-secret
162
- w-cholesterol
163
- w-insulin
164
- w-24
165
- w-h
166
- w-low
167
- w-rate
168
- w-fatti
169
- w-acid
170
- w-effect
171
- w-hormon
172
- w-hepat
173
- w-contrast
174
- w-product
175
- w-major
176
- w-plasma
177
- w-current
178
- w-flow
179
- w-chronic
180
- w-mechan
181
- w-test
182
- w-therefor
183
- w-analys
184
- w-mrna
185
- w-streptozotocin
186
- w-did
187
- w-15
188
- w-g
189
- w-25
190
- w-mmol
191
- w-l
192
- w-5
193
- w-reduc
194
- w-number
195
- w-densiti
196
- w-posit
197
- w-cell
198
- w-17
199
- w-mm
200
- w-18
201
- w-induct
202
- w-associ
203
- w-express
204
- w-glycem
205
- w-respons
206
- w-therapi
207
- w-random
208
- w-initi
209
- w-ani
210
- w-singl
211
- w-new
212
- w-agent
213
- w-metformin
214
- w-medic
215
- w-glycosyl
216
- w-hemoglobin
217
- w-analysi
218
- w-baselin
219
- w-health
220
- w-factor
221
- w-process
222
- w-care
223
- w-9
224
- w-01
225
- w-95
226
- w-interv
227
- w-ci
228
- w-12
229
- w-reduct
230
- w-achiev
231
- w-target
232
- w-lt
233
- w-diseas
234
- w-class
235
- w-age
236
- w-obes
237
- w-renal
238
- w-improv
239
- w-progress
240
- w-noninsulindepend
241
- w-mellitus
242
- w-becaus
243
- w-s
244
- w-index
245
- w-hypertens
246
- w-need
247
- w-followup
248
- w-year
249
- w-mg
250
- w-dl
251
- w-remain
252
- w-subject
253
- w-treat
254
- w-oral
255
- w-requir
256
- w-0001
257
- w-mortal
258
- w-includ
259
- w-vs
260
- w-background
261
- w-poor
262
- w-drug
263
- w-13
264
- w-rang
265
- w-combin
266
- w-intervent
267
- w-daili
268
- w-dose
269
- w-100
270
- w-toler
271
- w-receiv
272
- w-11
273
- w-postprandi
274
- w-kg
275
- w-hypoglycemia
276
- w-frequent
277
- w-event
278
- w-versus
279
- w-symptom
280
- w-incid
281
- w-parent
282
- w-complex
283
- w-longterm
284
- w-inhibitor
285
- w-peripher
286
- w-nerv
287
- w-stz
288
- w-conduct
289
- w-demonstr
290
- w-frequenc
291
- w-inhibit
292
- w-neuropathi
293
- w-pathway
294
- w-shown
295
- w-time
296
- w-ii
297
- w-individu
298
- w-adult
299
- w-50
300
- w-60
301
- w-diagnosi
302
- w-healthi
303
- w-follow
304
- w-young
305
- w-seen
306
- w-alter
307
- w-gene
308
- w-e
309
- w-identifi
310
- w-previous
311
- w-mediat
312
- w-vascular
313
- w-lipoprotein
314
- w-involv
315
- w-phenotyp
316
- w-confirm
317
- w-variant
318
- w-endotheli
319
- w-potenti
320
- w-disord
321
- w-popul
322
- w-nonobes
323
- w-aim
324
- w-serum
325
- w-hba1c
326
- w-hypoglycaemia
327
- w-continu
328
- w-case
329
- w-impair
330
- w-risk
331
- w-known
332
- w-men
333
- w-women
334
- w-40
335
- w-complet
336
- w-estim
337
- w-like
338
- w-particular
339
- w-human
340
- w-character
341
- w-elev
342
- w-synthesi
343
- w-greater
344
- w-small
345
- w-reveal
346
- w-liver
347
- w-niddm
348
- w-genet
349
- w-receptor
350
- w-growth
351
- w-pancreat
352
- w-betacel
353
- w-molecul
354
- w-enzym
355
- w-regul
356
- w-polymorph
357
- w-total
358
- w-allel
359
- w-02
360
- w-resist
361
- w-cpeptid
362
- w-hypothesi
363
- w-perform
364
- w-score
365
- w-001
366
- w-05
367
- w-histori
368
- w-action
369
- w-approxim
370
- w-suppress
371
- w-glucagon
372
- w-ml
373
- w-x
374
- w-free
375
- w-peopl
376
- w-uptak
377
- w-intens
378
- w-relationship
379
- w-prevent
380
- w-autoimmun
381
- w-recent
382
- w-preval
383
- w-nondiabet
384
- w-genotyp
385
- w-conclud
386
- w-linkag
387
- w-islet
388
- w-peptid
389
- w-form
390
- w-membran
391
- w-transgen
392
- w-failur
393
- w-isol
394
- w-negat
395
- w-earli
396
- w-famili
397
- w-chromosom
398
- w-immun
399
- w-support
400
- w-16
401
- w-cohort
402
- w-insulindepend
403
- w-outcom
404
- w-screen
405
- w-approach
406
- w-infus
407
- w-multipl
408
- w-depend
409
- w-physic
410
- w-transport
411
- w-acut
412
- w-releas
413
- w-presenc
414
- w-glycaem
415
- w-male
416
- w-antibodi
417
- w-femal
418
- w-pattern
419
- w-t2dm
420
- w-promot
421
- w-fat
422
- w-d
423
- w-bmi
424
- w-haplotyp
425
- w-triglycerid
426
- w-interact
427
- w-marker
428
- w-describ
429
- w-area
430
- w-20
431
- w-cytokin
432
- w-bind
433
- w-bb
434
- w-alpha
435
- w-beta
436
- w-cd4
437
- w-spontan
438
- w-given
439
- w-vitro
440
- w-basal
441
- w-protect
442
- w-pressur
443
- w-detect
444
- w-exercis
445
- w-children
446
- w-adolesc
447
- w-life
448
- w-b
449
- w-antigen
450
- w-iddm
451
- w-american
452
- w-hla
453
- w-arteri
454
- w-nephropathi
455
- w-review
456
- w-destruct
457
- w-content
458
- w-autoantibodi
459
- w-dm
460
- w-select
461
- w-infect
462
- w-recipi
463
- w-intak
464
- w-placebo
465
- w-db
466
- w-pancrea
467
- w-diagnos
468
- w-glomerular
469
- w-albumin
470
- w-excret
471
- w-syndrom
472
- w-t
473
- w-lymphocyt
474
- w-produc
475
- w-coronari
476
- w-status
477
- w-microalbuminuria
478
- w-nod
479
- w-mhc
480
- w-insul
481
- w-administr
482
- w-revers
483
- w-transplant
484
- w-graft
485
- w-t1d
486
- w-lead
487
- w-v
488
- w-dietari
489
- w-general
490
- w-macrophag
491
- w-kidney
492
- w-urinari
493
- w-myocardi
494
- w-meal
495
- w-ica
496
- w-locus
497
- w-tcell
498
- w-depress
499
- w-bone
500
- w-mutat
501
- summary
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pubmed.py CHANGED
@@ -52,6 +52,9 @@ _CLASS_LABELS = [
52
  "Diabetes Mellitus Type 2"
53
  ]
54
 
 
 
 
55
 
56
  # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
57
  class PubmedDataset(datasets.GeneratorBasedBuilder):
@@ -80,12 +83,9 @@ class PubmedDataset(datasets.GeneratorBasedBuilder):
80
 
81
  def _info(self):
82
  if self.config.name == "nodes":
83
- with open("pubmed-word-features.txt", "rt", encoding="UTF-8") as f:
84
- word_features = f.read().split("\n")
85
-
86
  features_dict = {
87
  w: datasets.Value("float32")
88
- for w in word_features
89
  }
90
  features_dict["node"] = datasets.Value("string")
91
  features_dict["label"] = datasets.ClassLabel(names=_CLASS_LABELS)
@@ -165,9 +165,6 @@ class PubmedDataset(datasets.GeneratorBasedBuilder):
165
  neighbors[n] = []
166
  neighbors[src].append(target)
167
 
168
- with open("pubmed-word-features.txt", "rt", encoding="UTF-8") as f:
169
- word_features = f.read().split("\n")
170
-
171
  def _word_feature_tuple(x):
172
  w, v = x.split("=")
173
  return (w, float(v))
@@ -184,7 +181,7 @@ class PubmedDataset(datasets.GeneratorBasedBuilder):
184
  w_features = dict(map(_word_feature_tuple, row[2:-1]))
185
  features = {"node": node, "label": label,
186
  "neighbors": neighbors[node]}
187
- for x in word_features:
188
  features[x] = w_features.get(x, 0.0)
189
  yield id, features
190
 
 
52
  "Diabetes Mellitus Type 2"
53
  ]
54
 
55
+ _WORD_FEATURES = ["w-rat", "w-common", "w-use", "w-examin", "w-pathogenesi", "w-retinopathi", "w-mous", "w-studi", "w-anim", "w-model", "w-metabol", "w-abnorm", "w-contribut", "w-develop", "w-investig", "w-mice", "w-2", "w-month", "w-compar", "w-obtain", "w-method", "w-induc", "w-6", "w-inject", "w-experiment", "w-normal", "w-diet", "w-30", "w-hyperglycemia", "w-level", "w-lipid", "w-oxid", "w-activ", "w-protein", "w-kinas", "w-c", "w-measur", "w-result", "w-increas", "w-retin", "w-stress", "w-3", "w-similar", "w-observ", "w-conclus", "w-play", "w-import", "w-role", "w-present", "w-p", "w-m", "w-r", "w-muscl", "w-control", "w-chang", "w-dure", "w-lower", "w-higher", "w-mass", "w-correl", "w-decreas", "w-determin", "w-concentr", "w-stimul", "w-period", "w-caus", "w-mark", "w-group", "w-evid", "w-fast", "w-type", "w-signific", "w-differ", "w-ratio", "w-suggest", "w-degre", "w-occur", "w-vivo", "w-respect", "w-dysfunct", "w-region", "w-high", "w-appear", "w-sever", "w-affect", "w-cardiovascular", "w-complic", "w-primari", "w-death", "w-patient", "w-clinic", "w-suscept", "w-cardiac", "w-tissu", "w-specif", "w-function", "w-defect", "w-possibl", "w-indic", "w-state", "w-onli", "w-bodi", "w-weight", "w-loss", "w-valu", "w-howev", "w-4", "w-condit", "w-durat", "w-8", "w-week", "w-onset", "w-data", "w-direct", "w-report", "w-provid", "w-addit", "w-evalu", "w-sensit", "w-heart", "w-object", "w-mean", "w-blood", "w-glucos", "w-strong", "w-hba", "w-1c", "w-a1c", "w-variabl", "w-independ", "w-assess", "w-relat", "w-trial", "w-research", "w-design", "w-profil", "w-sampl", "w-particip", "w-n", "w-1", "w-consist", "w-befor", "w-min", "w-predict", "w-adjust", "w-sex", "w-treatment", "w-7", "w-gt", "w-0", "w-larg", "w-influenc", "w-base", "w-standard", "w-14", "w-10", "w-wherea", "w-enhanc", "w-manag", "w-day", "w-secret", "w-cholesterol", "w-insulin", "w-24", "w-h", "w-low", "w-rate", "w-fatti", "w-acid", "w-effect", "w-hormon", "w-hepat", "w-contrast", "w-product", "w-major", "w-plasma", "w-current", "w-flow", "w-chronic", "w-mechan", "w-test", "w-therefor", "w-analys", "w-mrna", "w-streptozotocin", "w-did", "w-15", "w-g", "w-25", "w-mmol", "w-l", "w-5", "w-reduc", "w-number", "w-densiti", "w-posit", "w-cell", "w-17", "w-mm", "w-18", "w-induct", "w-associ", "w-express", "w-glycem", "w-respons", "w-therapi", "w-random", "w-initi", "w-ani", "w-singl", "w-new", "w-agent", "w-metformin", "w-medic", "w-glycosyl", "w-hemoglobin", "w-analysi", "w-baselin", "w-health", "w-factor", "w-process", "w-care", "w-9", "w-01", "w-95", "w-interv", "w-ci", "w-12", "w-reduct", "w-achiev", "w-target", "w-lt", "w-diseas", "w-class", "w-age", "w-obes", "w-renal", "w-improv", "w-progress", "w-noninsulindepend", "w-mellitus", "w-becaus", "w-s", "w-index", "w-hypertens", "w-need", "w-followup", "w-year", "w-mg", "w-dl", "w-remain", "w-subject", "w-treat", "w-oral", "w-requir", "w-0001", "w-mortal", "w-includ", "w-vs", "w-background", "w-poor", "w-drug", "w-13", "w-rang", "w-combin", "w-intervent", "w-daili", "w-dose", "w-100", "w-toler", "w-receiv", "w-11", "w-postprandi", "w-kg", "w-hypoglycemia", "w-frequent", "w-event", "w-versus", "w-symptom", "w-incid", "w-parent", "w-complex", "w-longterm", "w-inhibitor", "w-peripher", "w-nerv", "w-stz", "w-conduct", "w-demonstr", "w-frequenc", "w-inhibit", "w-neuropathi", "w-pathway", "w-shown", "w-time", "w-ii", "w-individu", "w-adult", "w-50", "w-60", "w-diagnosi", "w-healthi", "w-follow", "w-young", "w-seen", "w-alter", "w-gene", "w-e", "w-identifi", "w-previous", "w-mediat", "w-vascular", "w-lipoprotein", "w-involv", "w-phenotyp", "w-confirm", "w-variant", "w-endotheli", "w-potenti", "w-disord", "w-popul", "w-nonobes", "w-aim", "w-serum", "w-hba1c", "w-hypoglycaemia", "w-continu", "w-case", "w-impair", "w-risk", "w-known", "w-men", "w-women", "w-40", "w-complet", "w-estim", "w-like", "w-particular", "w-human", "w-character", "w-elev", "w-synthesi", "w-greater", "w-small", "w-reveal", "w-liver", "w-niddm", "w-genet", "w-receptor", "w-growth", "w-pancreat", "w-betacel", "w-molecul", "w-enzym", "w-regul", "w-polymorph", "w-total", "w-allel", "w-02", "w-resist", "w-cpeptid", "w-hypothesi", "w-perform", "w-score", "w-001", "w-05", "w-histori", "w-action", "w-approxim", "w-suppress", "w-glucagon", "w-ml", "w-x", "w-free", "w-peopl", "w-uptak", "w-intens", "w-relationship", "w-prevent", "w-autoimmun", "w-recent", "w-preval", "w-nondiabet", "w-genotyp", "w-conclud", "w-linkag", "w-islet", "w-peptid", "w-form", "w-membran", "w-transgen", "w-failur", "w-isol", "w-negat", "w-earli", "w-famili", "w-chromosom", "w-immun", "w-support", "w-16", "w-cohort", "w-insulindepend", "w-outcom", "w-screen", "w-approach", "w-infus", "w-multipl", "w-depend", "w-physic", "w-transport", "w-acut", "w-releas", "w-presenc", "w-glycaem", "w-male", "w-antibodi", "w-femal", "w-pattern", "w-t2dm", "w-promot", "w-fat", "w-d", "w-bmi", "w-haplotyp", "w-triglycerid", "w-interact", "w-marker", "w-describ", "w-area", "w-20", "w-cytokin", "w-bind", "w-bb", "w-alpha", "w-beta", "w-cd4", "w-spontan", "w-given", "w-vitro", "w-basal", "w-protect", "w-pressur", "w-detect", "w-exercis", "w-children", "w-adolesc", "w-life", "w-b", "w-antigen", "w-iddm", "w-american", "w-hla", "w-arteri", "w-nephropathi", "w-review", "w-destruct", "w-content", "w-autoantibodi", "w-dm", "w-select", "w-infect", "w-recipi", "w-intak", "w-placebo", "w-db", "w-pancrea", "w-diagnos", "w-glomerular", "w-albumin", "w-excret", "w-syndrom", "w-t", "w-lymphocyt", "w-produc", "w-coronari", "w-status", "w-microalbuminuria", "w-nod", "w-mhc", "w-insul", "w-administr", "w-revers", "w-transplant", "w-graft", "w-t1d", "w-lead", "w-v", "w-dietari", "w-general", "w-macrophag", "w-kidney", "w-urinari", "w-myocardi", "w-meal", "w-ica", "w-locus", "w-tcell", "w-depress", "w-bone", "w-mutat"
56
+ ]
57
+
58
 
59
  # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
60
  class PubmedDataset(datasets.GeneratorBasedBuilder):
 
83
 
84
  def _info(self):
85
  if self.config.name == "nodes":
 
 
 
86
  features_dict = {
87
  w: datasets.Value("float32")
88
+ for w in _WORD_FEATURES
89
  }
90
  features_dict["node"] = datasets.Value("string")
91
  features_dict["label"] = datasets.ClassLabel(names=_CLASS_LABELS)
 
165
  neighbors[n] = []
166
  neighbors[src].append(target)
167
 
 
 
 
168
  def _word_feature_tuple(x):
169
  w, v = x.split("=")
170
  return (w, float(v))
 
181
  w_features = dict(map(_word_feature_tuple, row[2:-1]))
182
  features = {"node": node, "label": label,
183
  "neighbors": neighbors[node]}
184
+ for x in _WORD_FEATURES:
185
  features[x] = w_features.get(x, 0.0)
186
  yield id, features
187