Hi, get_pred_ner() functions in your biaffine_ner_model.py
top_spans = [sorted(top_span,reverse=True,key=lambda x:x[3]) for top_span in top_spans]
sent_pred_mentions = [[] for _ in xrange(len(sentences))]
for sid, top_span in enumerate(top_spans):
for ns,ne,t,_ in top_span:
for ts,te,_ in sent_pred_mentions[sid]:
if ns < ts <= ne < te or ts < ns <= te < ne:
#for both nested and flat ner no clash is allowed
break
if is_flat_ner and (ns <= ts <= te <= ne or ts <= ns <= ne <= te):
#for flat ner nested mentions are not allowed
break
else:
sent_pred_mentions[sid].append((ns,ne,t))
According to the alignment of your codes,
"else:
sent_predmentions[sid].append((ns,ne,t))“ is aligned to "for ts,te, in sent_pred_mentions[sid]:". how to understand it ?
"
Hi, get_pred_ner() functions in your biaffine_ner_model.py
According to the alignment of your codes, "else: sent_predmentions[sid].append((ns,ne,t))“ is aligned to "for ts,te, in sent_pred_mentions[sid]:". how to understand it ? "