Spaces:
Runtime error
Runtime error
ajitrajasekharan
commited on
Commit
·
d27ec71
1
Parent(s):
2d63695
Update aggregate_server_json.py
Browse files- aggregate_server_json.py +2 -4
aggregate_server_json.py
CHANGED
@@ -80,10 +80,7 @@ class AggregateNER:
|
|
80 |
server_index = 0 if (s1_entity in servers_arr[0]["precedence"]) else 1
|
81 |
if (s1_entity != "O"):
|
82 |
print("Both servers agree on prediction for term:",results[0]["ner"][pos_index]["term"],":",s1_entity)
|
83 |
-
|
84 |
-
#This is an override for single server response being ensembles to pick two predictions.
|
85 |
-
picked_server_index,cross_prediction_count = self.pick_single_server_if_possible(results,term_index,servers_arr)
|
86 |
-
return picked_server_index,span_count1,cross_prediction_count
|
87 |
else:
|
88 |
print("Servers do not agree on prediction for term:",results[0]["ner"][pos_index]["term"],":",s1_entity,s2_entity)
|
89 |
if (s2_entity == "O"):
|
@@ -230,6 +227,7 @@ class AggregateNER:
|
|
230 |
return False
|
231 |
|
232 |
def gen_resolved_entity(self,results,server_index,pivot_index,run_index,cross_prediction_count,servers_arr):
|
|
|
233 |
if (cross_prediction_count == 1 or cross_prediction_count == -1):
|
234 |
#This is the case where we are emitting just one server prediction. In this case, if CS and consolidated dont match, emit both
|
235 |
if (pivot_index in results[server_index]["orig_cs_prediction_details"]):
|
|
|
80 |
server_index = 0 if (s1_entity in servers_arr[0]["precedence"]) else 1
|
81 |
if (s1_entity != "O"):
|
82 |
print("Both servers agree on prediction for term:",results[0]["ner"][pos_index]["term"],":",s1_entity)
|
83 |
+
return server_index,span_count1,-1
|
|
|
|
|
|
|
84 |
else:
|
85 |
print("Servers do not agree on prediction for term:",results[0]["ner"][pos_index]["term"],":",s1_entity,s2_entity)
|
86 |
if (s2_entity == "O"):
|
|
|
227 |
return False
|
228 |
|
229 |
def gen_resolved_entity(self,results,server_index,pivot_index,run_index,cross_prediction_count,servers_arr):
|
230 |
+
print("In gen resolved entity")
|
231 |
if (cross_prediction_count == 1 or cross_prediction_count == -1):
|
232 |
#This is the case where we are emitting just one server prediction. In this case, if CS and consolidated dont match, emit both
|
233 |
if (pivot_index in results[server_index]["orig_cs_prediction_details"]):
|