fairseq/data/noising.py
Killed 0 out of 7 mutantsSurvived
Survived mutation testing. These mutants show holes in your test suite.Mutant 2309
--- 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 2310
--- 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 2311
--- 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 2312
--- 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 2313
--- 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 2314
--- 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 2315
--- 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