Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save billpku/2f0a136f79aa4631832369d8d0d38205 to your computer and use it in GitHub Desktop.

Select an option

Save billpku/2f0a136f79aa4631832369d8d0d38205 to your computer and use it in GitHub Desktop.
NER with BERT in Action
# Real token mask is 1,pad token(meaning a place holder for the empty space) is 0
attention_masks = [[int(i>0) for i in ii] for ii in input_ids]
attention_masks[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment