opennmt.data.WordReplacement

class opennmt.data.WordReplacement(probability, filler='')[source]

Randomly replaces words.

Inherits from: opennmt.data.Noise

__init__(probability, filler='')[source]

Initializes the noise module.

Parameters
  • probability – The probability to replace words.

  • filler – The replacement token.