Atharva commited on
Commit
1d6a89d
1 Parent(s): d520035

added threshold

Browse files
Files changed (1) hide show
  1. src/__init__.py +1 -3
src/__init__.py CHANGED
@@ -181,8 +181,6 @@ class GBRT(Base):
181
  return emb/n
182
 
183
  def link(self, mentions_cands, context):
184
- n_features = self.model.n_features_in_
185
-
186
  # Calculate max prior probability of all candidates.
187
  mentions = set([i for i, _ in mentions_cands])
188
  candidates = set([i for _, j in mentions_cands for i in j])
@@ -223,7 +221,7 @@ class GBRT(Base):
223
  X = [j + [i + 1] for i, j in enumerate(X)]
224
 
225
  # Predict
226
- pred, conf = 'NIL', 0
227
  for i in X:
228
  c = self.model.predict(np.array([i[1:]]))[0]
229
  if c > conf:
 
181
  return emb/n
182
 
183
  def link(self, mentions_cands, context):
 
 
184
  # Calculate max prior probability of all candidates.
185
  mentions = set([i for i, _ in mentions_cands])
186
  candidates = set([i for _, j in mentions_cands for i in j])
 
221
  X = [j + [i + 1] for i, j in enumerate(X)]
222
 
223
  # Predict
224
+ pred, conf = 'NIL', 0.2
225
  for i in X:
226
  c = self.model.predict(np.array([i[1:]]))[0]
227
  if c > conf: