ShannonAI / mrc-for-flat-nested-ner

Code for ACL 2020 paper `A Unified MRC Framework for Named Entity Recognition`
662 stars 118 forks source link

Some details in MRCNERDataset #79

Closed smiles724 closed 3 years ago

smiles724 commented 3 years ago

Hi, I am a little confused about why you add one to all ending position indices as end_positions = [x + 1 for x in end_positions]. Can you please give me an explanation?

YuxianMeng commented 3 years ago

@Wufang1997 This is a variable used to store char-level end positions in python style: range(start, end) do not contain end. The variable is further used to compute final start/end labels considering query+context inputs and wordpiece tokenizer.

smiles724 commented 3 years ago

@Wufang1997 This is a variable used to store char-level end positions in python style: range(start, end) do not contain end. The variable is further used to compute final start/end labels considering query+context inputs and wordpiece tokenizer.

Thanks, I also figured it out myself!