Spaces:
Runtime error
Runtime error
Commit
·
03e519a
1
Parent(s):
d27ec71
Update aggregate_server_json.py
Browse files- aggregate_server_json.py +2 -1
aggregate_server_json.py
CHANGED
@@ -227,7 +227,6 @@ class AggregateNER:
|
|
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"]):
|
@@ -254,6 +253,7 @@ class AggregateNER:
|
|
254 |
return ret_obj
|
255 |
else:
|
256 |
#if we come here consolidated is same as cs prediction. So we try to either use ci or the second cs prediction if ci is out of domain
|
|
|
257 |
if (m1 != m1_ci):
|
258 |
#CS and CI are not same
|
259 |
if (is_ci_included):
|
@@ -291,6 +291,7 @@ class AggregateNER:
|
|
291 |
return flip_category(results[server_index]["ner"][run_index])
|
292 |
else:
|
293 |
#here cs and ci are same. So use two consecutive cs predictions if meaningful
|
|
|
294 |
if (len(results[server_index]["orig_cs_prediction_details"][pivot_index]['cs_distribution']) >= 2):
|
295 |
ret_arr = self.get_predictions_above_threshold(results[server_index]["orig_cs_prediction_details"][pivot_index])
|
296 |
orig_cs_second_entity = results[server_index]["orig_cs_prediction_details"][pivot_index]['cs_distribution'][1]
|
|
|
227 |
return False
|
228 |
|
229 |
def gen_resolved_entity(self,results,server_index,pivot_index,run_index,cross_prediction_count,servers_arr):
|
|
|
230 |
if (cross_prediction_count == 1 or cross_prediction_count == -1):
|
231 |
#This is the case where we are emitting just one server prediction. In this case, if CS and consolidated dont match, emit both
|
232 |
if (pivot_index in results[server_index]["orig_cs_prediction_details"]):
|
|
|
253 |
return ret_obj
|
254 |
else:
|
255 |
#if we come here consolidated is same as cs prediction. So we try to either use ci or the second cs prediction if ci is out of domain
|
256 |
+
print("***** here 1")
|
257 |
if (m1 != m1_ci):
|
258 |
#CS and CI are not same
|
259 |
if (is_ci_included):
|
|
|
291 |
return flip_category(results[server_index]["ner"][run_index])
|
292 |
else:
|
293 |
#here cs and ci are same. So use two consecutive cs predictions if meaningful
|
294 |
+
print("***** here 2")
|
295 |
if (len(results[server_index]["orig_cs_prediction_details"][pivot_index]['cs_distribution']) >= 2):
|
296 |
ret_arr = self.get_predictions_above_threshold(results[server_index]["orig_cs_prediction_details"][pivot_index])
|
297 |
orig_cs_second_entity = results[server_index]["orig_cs_prediction_details"][pivot_index]['cs_distribution'][1]
|