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.

Revisions

  1. billpku created this gist Jul 30, 2019.
    3 changes: 3 additions & 0 deletions NER with BERT in Action- set embedding2
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # 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];