Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX/fix start end positions in nested spans #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion metrics/functional/query_span_f1.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def extract_nested_spans(start_preds, end_preds, match_preds, start_label_mask,
match_label_mask = torch.triu(match_label_mask, 0) # start should be less or equal to end
match_preds = match_label_mask & match_preds
match_pos_pairs = np.transpose(np.nonzero(match_preds.numpy())).tolist()
return [(pos[0], pos[1], pseudo_tag) for pos in match_pos_pairs]
return [(pos[1], pos[2], pseudo_tag) for pos in match_pos_pairs]


def extract_flat_spans(start_pred, end_pred, match_pred, label_mask, pseudo_tag = "TAG"):
Expand Down