ajitrajasekharan commited on
Commit
0ebf7a3
·
1 Parent(s): f82ead3

Update aggregate_server_json.py

Browse files
Files changed (1) hide show
  1. aggregate_server_json.py +4 -1
aggregate_server_json.py CHANGED
@@ -248,7 +248,8 @@ class AggregateNER:
248
  n1 = flip_category(orig_cs_entity)
249
  n1["e"] = prefix + n1["e"]
250
  n2 = flip_category(consolidated_entity)
251
- ret_obj["e"] = n1["e"] + "/" + n2["e"]
 
252
  return ret_obj
253
  else:
254
  #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
@@ -262,6 +263,7 @@ class AggregateNER:
262
  n1["e"] = prefix + n1["e"]
263
  n2 = flip_category(orig_ci_entity)
264
  n2["e"] = prefix + n2["e"]
 
265
  ret_obj["e"] = n1["e"] + "/" + n2["e"]
266
  return ret_obj
267
  else:
@@ -302,6 +304,7 @@ class AggregateNER:
302
  n1["e"] = prefix + n1["e"]
303
  n2 = flip_category(orig_cs_entity)
304
  n2["e"] = prefix + n2["e"]
 
305
  ret_obj["e"] = n2["e"] + "/" + n1["e"] #when using single server twice, best to keep cs first
306
  return ret_obj
307
  else:
 
248
  n1 = flip_category(orig_cs_entity)
249
  n1["e"] = prefix + n1["e"]
250
  n2 = flip_category(consolidated_entity)
251
+ print("consolidated != orig cs. P1 case. Emit orig cs first")
252
+ ret_obj["e"] = n1["e"] + "/" + n2["e"] #emit orig cs first
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
 
263
  n1["e"] = prefix + n1["e"]
264
  n2 = flip_category(orig_ci_entity)
265
  n2["e"] = prefix + n2["e"]
266
+ print("consolidated == orig cs. P2 case. Emit orig cs first. Then ci")
267
  ret_obj["e"] = n1["e"] + "/" + n2["e"]
268
  return ret_obj
269
  else:
 
304
  n1["e"] = prefix + n1["e"]
305
  n2 = flip_category(orig_cs_entity)
306
  n2["e"] = prefix + n2["e"]
307
+ print("consolidated == orig cs. P3 case. Emit orig cs first. Then ci")
308
  ret_obj["e"] = n2["e"] + "/" + n1["e"] #when using single server twice, best to keep cs first
309
  return ret_obj
310
  else: