Commit 0d8e647d83f201821f147a98d26d3a9b479e8a7a
1 parent
3fa58087
Minor bugfix.
Showing
1 changed file
with
3 additions
and
14 deletions
corneferencer/resolvers/resolve.py
... | ... | @@ -123,20 +123,9 @@ def closest(text, threshold): |
123 | 123 | if i > 0: |
124 | 124 | for ante in reversed(text.mentions[:i]): |
125 | 125 | if not features.pair_intersect(ante, ana): |
126 | - pair_features = get_pair_features(ante, ana) | |
127 | - | |
128 | - ante_vec = [] | |
129 | - ante_vec.extend(ante.features) | |
130 | - ante_vec.extend(pair_features) | |
131 | - ante_sample = numpy.asarray([ante_vec], dtype=numpy.float32) | |
132 | - | |
133 | - ana_vec = [] | |
134 | - ana_vec.extend(ana.features) | |
135 | - ana_vec.extend(pair_features) | |
136 | - ana_sample = numpy.asarray([ana_vec], dtype=numpy.float32) | |
137 | - | |
138 | - prediction = NEURAL_MODEL.predict([ante_sample, ana_sample])[0] | |
139 | - | |
126 | + pair_vec = get_pair_vector(ante, ana) | |
127 | + sample = numpy.asarray([pair_vec], dtype=numpy.float32) | |
128 | + prediction = NEURAL_MODEL.predict(sample)[0] | |
140 | 129 | if prediction > threshold: |
141 | 130 | if ante.set: |
142 | 131 | ana.set = ante.set |
... | ... |