2

I am trying to use nlpaug to swap some words out but am having issue with it replacing tokens permanently with the [UNK] token. I am using the docs here: https://nlpaug.readthedocs.io/en/latest/augmenter/word/context_word_embs.html

My code an example is as such:

aug = naw.ContextualWordEmbsAug(action='substitute', top_k=10,
                            aug_min=2, aug_max=4, stopwords=stops, batch_size=25)

aug.augment('You deposit the minimum amount (which is Rs 25/-) and buy tickets (Tickets are your entry fee) and start playing the game with others.')

Output

'[UNK] deposit the entire amount ( which is rs 10 / - ) and buy tickets ( tickets are your entry cost ) and start playing the game with ease.'

I have lost you in the sentence and would like to keep this. This happens across a universe of sentences so a simple one case fix will not be the answer here. Any help would be greatly appreciated.

geds133
  • 1,503
  • 5
  • 20
  • 52

0 Answers0