ajitrajasekharan commited on
Commit
4b95e30
1 Parent(s): f7fc919

Update aggregate_server_json.py

Browse files
Files changed (1) hide show
  1. aggregate_server_json.py +9 -8
aggregate_server_json.py CHANGED
@@ -202,14 +202,15 @@ class AggregateNER:
202
  mean_score = 1.0/len(dist) #input is a prob distriubution. so sum is 1
203
  else:
204
  mean_score = 0
205
- sum_deviation = 0
206
- for node in dist:
207
- sum_deviation += (mean_score - node["confidence"])*(mean_score - node["confidence"])
208
- variance = sum_deviation/len(dist)
209
- std_dev = math.sqrt(variance)
210
- threshold = mean_score - std_dev*self.threshold #default is 1 standard deviation from mean
211
- #threshold = mean_score
212
- pick_count = 1
 
213
  for node in dist:
214
  print("conf:",node["confidence"],"threshold:",threshold)
215
  if (node["confidence"] >= threshold):
 
202
  mean_score = 1.0/len(dist) #input is a prob distriubution. so sum is 1
203
  else:
204
  mean_score = 0
205
+ #sum_deviation = 0
206
+ #for node in dist:
207
+ # sum_deviation += (mean_score - node["confidence"])*(mean_score - node["confidence"])
208
+ #variance = sum_deviation/len(dist)
209
+ #std_dev = math.sqrt(variance)
210
+ #print("mean",mean,"std_dev",std_dev)
211
+ #threshold = mean_score - std_dev*self.threshold #default is 1 standard deviation from mean
212
+ threshold = mean_score
213
+ pick_count = 2
214
  for node in dist:
215
  print("conf:",node["confidence"],"threshold:",threshold)
216
  if (node["confidence"] >= threshold):