Skip to content

Instantly share code, notes, and snippets.

@Nithilaa
Created July 31, 2021 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nithilaa/64effa955b7bc1aacda95b826c19129c to your computer and use it in GitHub Desktop.
Save Nithilaa/64effa955b7bc1aacda95b826c19129c to your computer and use it in GitHub Desktop.
TOPK=20 #default=100
ACT = 'insert' #"substitute"
aug_bert = naw.ContextualWordEmbsAug(
model_path='distilbert-base-uncased',
#device='cuda',
action=ACT, top_k=TOPK)
print("Original:")
print(test_sentence)
print("Augmented Text:")
for ii in range(5):
augmented_text = aug_bert.augment(test_sentence)
print(augmented_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment