Commit 042043dc829c57fde38152366514c932c1c1fd2b

Authored by Bartłomiej Nitoń
1 parent 44d0a5f2

Minor fixes.

corneferencer/resolvers/features.py
... ... @@ -229,7 +229,7 @@ def check_one_way_acronym(acronym, expression):
229 229 for expr2 in expr1.split():
230 230 expr2 = expr2.strip()
231 231 if expr2:
232   - initials += unicode(expr2[0]).upper()
  232 + initials += str(expr2[0]).upper()
233 233 if acronym == initials:
234 234 return 1;
235 235 return 0;
... ...
corneferencer/resolvers/resolve.py
... ... @@ -37,7 +37,7 @@ def entity_based(text):
37 37 last_set_id = 0
38 38 for i, ana in enumerate(text.mentions):
39 39 if i > 0:
40   - print ('!!!!!!!!!!%s!!!!!!!!!!!!' % ana.text)
  40 + # print ('!!!!!!!!!!%s!!!!!!!!!!!!' % ana.text)
41 41 best_fit = get_best_set(sets, ana)
42 42 if best_fit is not None:
43 43 ana.set = best_fit['set_id']
... ... @@ -54,14 +54,14 @@ def entity_based(text):
54 54 'mentions': [ana]})
55 55 ana.set = str_set_id
56 56 last_set_id += 1
57   - print (ana.set)
58   - for ss in sets:
59   - print (';;;'.join(['%s:%s' % (ss['set_id'], mnt.text) for mnt in ss['mentions']]))
  57 + # print (ana.set)
  58 + # for ss in sets:
  59 + # print (';;;'.join(['%s:%s' % (ss['set_id'], mnt.text) for mnt in ss['mentions']]))
60 60  
61 61 remove_singletons(sets)
62   - print (';'.join([ss['set_id'] for ss in sets]))
63   - for ss in sets:
64   - print (';;;'.join(['%s:%s' % (ss['set_id'], mnt.text) for mnt in ss['mentions']]))
  62 + # print (';'.join([ss['set_id'] for ss in sets]))
  63 + # for ss in sets:
  64 + # print (';;;'.join(['%s:%s' % (ss['set_id'], mnt.text) for mnt in ss['mentions']]))
65 65  
66 66  
67 67 def get_best_set(sets, ana):
... ... @@ -82,7 +82,7 @@ def predict_set(mentions, ana):
82 82 sample = numpy.asarray([pair_vec], dtype=numpy.float32)
83 83 prediction = NEURAL_MODEL.predict(sample)[0]
84 84 prediction_sum += prediction
85   - print(mnt.text, prediction, ana.text)
  85 + # print(mnt.text, prediction, ana.text)
86 86 return prediction_sum / float(len(mentions))
87 87  
88 88  
... ...