WordDropout
- class opennmt.data.WordDropout(dropout)[source]
Randomly drops words in a sequence.
Example
>>> noise = opennmt.data.WordDropout(0.5) >>> words = tf.constant(["a", "b", "c"]) >>> noise(words).numpy() array([b'a', b'b'], dtype=object)
Inherits from:
opennmt.data.Noise