@@ -49,7 +49,7 @@ def parse_parser_results(text):
49
49
# make [ignore,ignore,a,b,c,d] into [[a,b],[c,d]]
50
50
av = zip (* [av [2 :][x ::2 ] for x in (0 , 1 )])
51
51
# save as attr-value dict, convert numbers into ints
52
- tmp ['words' ][av [1 ]] = dict (map ( lambda x : ( x [ 0 ], x [ 1 ]. isdigit () and int ( x [ 1 ]) or x [ 1 ]), av ) )
52
+ tmp ['words' ][av [1 ]] = dict (av )
53
53
# the results of this can't be serialized into JSON?
54
54
# tmp['words'][av[1]] = dict(map(lambda x: (x[0], x[1].isdigit() and int(x[1]) or x[1]), av))
55
55
state = 3
@@ -106,16 +106,15 @@ def __init__(self):
106
106
107
107
print "Starting the Stanford Core NLP parser."
108
108
# show progress bar while loading the models
109
- self .state = "State of the parser"
110
109
widgets = ['Loading Models: ' , Fraction (), ' ' ,
111
110
Bar (marker = RotatingMarker ()), ' ' , self .state ]
111
+ self .state = "plays hard to get, smiles from time to time"
112
112
pbar = ProgressBar (widgets = widgets , maxval = 5 , force_update = True ).start ()
113
113
self ._server .expect ("done." , timeout = 20 ) # Load pos tagger model (~5sec)
114
114
pbar .update (1 )
115
115
self ._server .expect ("done." , timeout = 200 ) # Load NER-all classifier (~33sec)
116
116
pbar .update (2 )
117
117
self ._server .expect ("done." , timeout = 600 ) # Load NER-muc classifier (~60sec)
118
- self .state = "Loading CoNLL classifier"
119
118
pbar .update (3 )
120
119
self ._server .expect ("done." , timeout = 600 ) # Load CoNLL classifier (~50sec)
121
120
pbar .update (4 )
0 commit comments