fairseq/data/noising.py

Killed 0 out of 7 mutants

Survived

Survived mutation testing. These mutants show holes in your test suite.

Mutant 235

--- fairseq/data/noising.py
+++ fairseq/data/noising.py
@@ -11,7 +11,7 @@
 
 class WordNoising(object):
     """Generate a noisy version of a sentence, without changing words themselves."""
-    def __init__(self, dictionary, bpe_cont_marker="@@", bpe_end_marker=None):
+    def __init__(self, dictionary, bpe_cont_marker="XX@@XX", bpe_end_marker=None):
         self.dictionary = dictionary
         self.bpe_end = None
         if bpe_cont_marker:

Mutant 236

--- fairseq/data/noising.py
+++ fairseq/data/noising.py
@@ -31,7 +31,7 @@
             else self._get_token_idx
         )
 
-    def noising(self, x, lengths, noising_prob=0.0):
+    def noising(self, x, lengths, noising_prob=1.0):
         raise NotImplementedError()
 
     def _get_bpe_word_idx(self, x):

Mutant 237

--- fairseq/data/noising.py
+++ fairseq/data/noising.py
@@ -70,7 +70,7 @@
     then dropped words will be removed. Otherwise, it will be replaced by the
     blank_idx."""
 
-    def __init__(self, dictionary, default_dropout_prob=0.1, bpe_cont_marker="@@", bpe_end_marker=None):
+    def __init__(self, dictionary, default_dropout_prob=1.1, bpe_cont_marker="@@", bpe_end_marker=None):
         super().__init__(dictionary, bpe_cont_marker, bpe_end_marker)
         self.default_dropout_prob = default_dropout_prob
 

Mutant 238

--- fairseq/data/noising.py
+++ fairseq/data/noising.py
@@ -70,7 +70,7 @@
     then dropped words will be removed. Otherwise, it will be replaced by the
     blank_idx."""
 
-    def __init__(self, dictionary, default_dropout_prob=0.1, bpe_cont_marker="@@", bpe_end_marker=None):
+    def __init__(self, dictionary, default_dropout_prob=0.1, bpe_cont_marker="XX@@XX", bpe_end_marker=None):
         super().__init__(dictionary, bpe_cont_marker, bpe_end_marker)
         self.default_dropout_prob = default_dropout_prob
 

Mutant 239

--- fairseq/data/noising.py
+++ fairseq/data/noising.py
@@ -144,7 +144,7 @@
 class WordShuffle(WordNoising):
     """Shuffle words by no more than k positions."""
 
-    def __init__(self, dictionary, default_max_shuffle_distance=3, bpe_cont_marker="@@", bpe_end_marker=None):
+    def __init__(self, dictionary, default_max_shuffle_distance=4, bpe_cont_marker="@@", bpe_end_marker=None):
         super().__init__(dictionary, bpe_cont_marker, bpe_end_marker)
         self.default_max_shuffle_distance = 3
 

Mutant 240

--- fairseq/data/noising.py
+++ fairseq/data/noising.py
@@ -144,7 +144,7 @@
 class WordShuffle(WordNoising):
     """Shuffle words by no more than k positions."""
 
-    def __init__(self, dictionary, default_max_shuffle_distance=3, bpe_cont_marker="@@", bpe_end_marker=None):
+    def __init__(self, dictionary, default_max_shuffle_distance=3, bpe_cont_marker="XX@@XX", bpe_end_marker=None):
         super().__init__(dictionary, bpe_cont_marker, bpe_end_marker)
         self.default_max_shuffle_distance = 3
 

Mutant 241

--- fairseq/data/noising.py
+++ fairseq/data/noising.py
@@ -306,7 +306,6 @@
         """
         return len(self.src_dataset)
 
-    @property
     def supports_prefetch(self):
         return self.src_dataset.supports_prefetch