-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest.py
63 lines (37 loc) · 976 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from pprint import pprint
import os
import cotools
help(cotools.download)
from datetime import datetime
from datetime import timedelta
cotools.download(dir="data")
import pdb; pdb.set_trace() # XXX BREAKPOINT
# noncomm = cotools.Paperset("data/noncomm_use_subset")
data = cotools.Paperset("data/noncomm_use_subset")
text(data[-1])
# pprint(data[0])
# print(type(data[0]))
# get the text for one feature
cotools.text(data[0])
cotools.texts(data[:15])
import pdb
pdb.set_trace() # XXX BREAKPOINT
data.apply(len)
# dict
# pprint(data[:2])
print(type(data[2:5]))
# list
print(len(data))
# takes about 5gb in memory
# alldata = data[:]
import pdb; pdb.set_trace() # XXX BREAKPOINT
#data[:]
# len(data)
# len(alldata)
txt = [["novel coronavirus"], ["ventilator", "cpap", "bipap"]]
import pdb
pdb.set_trace() # XXX BREAKPOINT
x = cotools.search(data, txt)
print(len(x))
print(len(cotools.search(data, txt[0])))
print(len(cotools.search(data, txt[-1])))