fairseq/tasks/cross_lingual_lm.py
Killed 1 out of 27 mutantsSurvived
Survived mutation testing. These mutants show holes in your test suite.Mutant 245
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -24,7 +24,7 @@
from fairseq.tasks import FairseqTask, register_task
from fairseq import utils
-logger = logging.getLogger(__name__)
+logger = None
@register_task('cross_lingual_lm')
Mutant 246
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -27,7 +27,7 @@
logger = logging.getLogger(__name__)
-@register_task('cross_lingual_lm')
+@register_task('XXcross_lingual_lmXX')
class CrossLingualLMTask(FairseqTask):
"""
Task for training cross-lingual language models.
Mutant 247
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -26,8 +26,6 @@
logger = logging.getLogger(__name__)
-
-@register_task('cross_lingual_lm')
class CrossLingualLMTask(FairseqTask):
"""
Task for training cross-lingual language models.
Mutant 248
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -38,7 +38,6 @@
dictionary (Dictionary): the dictionary for the input of the task
"""
- @staticmethod
def add_args(parser):
"""Add task-specific arguments to the parser."""
parser.add_argument('data', help='colon separated path to data directories list, \
Mutant 249
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -41,7 +41,7 @@
@staticmethod
def add_args(parser):
"""Add task-specific arguments to the parser."""
- parser.add_argument('data', help='colon separated path to data directories list, \
+ parser.add_argument('XXdataXX', help='colon separated path to data directories list, \
will be iterated upon during epochs in round-robin manner')
parser.add_argument('--tokens-per-sample', default=512, type=int,
help='max number of total tokens over all segments'
Mutant 250
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -41,8 +41,8 @@
@staticmethod
def add_args(parser):
"""Add task-specific arguments to the parser."""
- parser.add_argument('data', help='colon separated path to data directories list, \
- will be iterated upon during epochs in round-robin manner')
+ parser.add_argument('data', help='XXcolon separated path to data directories list, \
+ will be iterated upon during epochs in round-robin mannerXX')
parser.add_argument('--tokens-per-sample', default=512, type=int,
help='max number of total tokens over all segments'
' per sample')
Mutant 251
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -43,7 +43,7 @@
"""Add task-specific arguments to the parser."""
parser.add_argument('data', help='colon separated path to data directories list, \
will be iterated upon during epochs in round-robin manner')
- parser.add_argument('--tokens-per-sample', default=512, type=int,
+ parser.add_argument('XX--tokens-per-sampleXX', default=512, type=int,
help='max number of total tokens over all segments'
' per sample')
parser.add_argument('--monolingual-langs', default='en', type=str,
Mutant 252
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -43,7 +43,7 @@
"""Add task-specific arguments to the parser."""
parser.add_argument('data', help='colon separated path to data directories list, \
will be iterated upon during epochs in round-robin manner')
- parser.add_argument('--tokens-per-sample', default=512, type=int,
+ parser.add_argument('--tokens-per-sample', default=513, type=int,
help='max number of total tokens over all segments'
' per sample')
parser.add_argument('--monolingual-langs', default='en', type=str,
Mutant 253
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -44,7 +44,7 @@
parser.add_argument('data', help='colon separated path to data directories list, \
will be iterated upon during epochs in round-robin manner')
parser.add_argument('--tokens-per-sample', default=512, type=int,
- help='max number of total tokens over all segments'
+ help='XXmax number of total tokens over all segmentsXX'
' per sample')
parser.add_argument('--monolingual-langs', default='en', type=str,
help='comma separated list of languages for which we'
Mutant 254
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -46,7 +46,7 @@
parser.add_argument('--tokens-per-sample', default=512, type=int,
help='max number of total tokens over all segments'
' per sample')
- parser.add_argument('--monolingual-langs', default='en', type=str,
+ parser.add_argument('XX--monolingual-langsXX', default='en', type=str,
help='comma separated list of languages for which we'
' want to train XLM on')
parser.add_argument('--shuffle', action='store_true',
Mutant 255
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -46,7 +46,7 @@
parser.add_argument('--tokens-per-sample', default=512, type=int,
help='max number of total tokens over all segments'
' per sample')
- parser.add_argument('--monolingual-langs', default='en', type=str,
+ parser.add_argument('--monolingual-langs', default='XXenXX', type=str,
help='comma separated list of languages for which we'
' want to train XLM on')
parser.add_argument('--shuffle', action='store_true',
Mutant 256
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -47,7 +47,7 @@
help='max number of total tokens over all segments'
' per sample')
parser.add_argument('--monolingual-langs', default='en', type=str,
- help='comma separated list of languages for which we'
+ help='XXcomma separated list of languages for which weXX'
' want to train XLM on')
parser.add_argument('--shuffle', action='store_true',
help='shuffle each monolingual dataset while'
Mutant 257
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -49,7 +49,7 @@
parser.add_argument('--monolingual-langs', default='en', type=str,
help='comma separated list of languages for which we'
' want to train XLM on')
- parser.add_argument('--shuffle', action='store_true',
+ parser.add_argument('XX--shuffleXX', action='store_true',
help='shuffle each monolingual dataset while'
' training')
Mutant 259
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -50,7 +50,7 @@
help='comma separated list of languages for which we'
' want to train XLM on')
parser.add_argument('--shuffle', action='store_true',
- help='shuffle each monolingual dataset while'
+ help='XXshuffle each monolingual dataset whileXX'
' training')
def __init__(self, args, dictionary):
Mutant 260
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -74,7 +74,6 @@
lang2id[lang] = id
return lang2id
- @classmethod
def load_dictionary(cls, filename):
return MaskedLMDictionary.load(filename)
Mutant 261
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -78,7 +78,6 @@
def load_dictionary(cls, filename):
return MaskedLMDictionary.load(filename)
- @classmethod
def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8):
d = MaskedLMDictionary()
for filename in filenames:
Mutant 262
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -79,7 +79,7 @@
return MaskedLMDictionary.load(filename)
@classmethod
- def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8):
+ def build_dictionary(cls, filenames, workers=2, threshold=-1, nwords=-1, padding_factor=8):
d = MaskedLMDictionary()
for filename in filenames:
Dictionary.add_file_to_dictionary(filename, d, tokenizer.tokenize_line, workers)
Mutant 263
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -79,7 +79,7 @@
return MaskedLMDictionary.load(filename)
@classmethod
- def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8):
+ def build_dictionary(cls, filenames, workers=1, threshold=+1, nwords=-1, padding_factor=8):
d = MaskedLMDictionary()
for filename in filenames:
Dictionary.add_file_to_dictionary(filename, d, tokenizer.tokenize_line, workers)
Mutant 264
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -79,7 +79,7 @@
return MaskedLMDictionary.load(filename)
@classmethod
- def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8):
+ def build_dictionary(cls, filenames, workers=1, threshold=-2, nwords=-1, padding_factor=8):
d = MaskedLMDictionary()
for filename in filenames:
Dictionary.add_file_to_dictionary(filename, d, tokenizer.tokenize_line, workers)
Mutant 265
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -79,7 +79,7 @@
return MaskedLMDictionary.load(filename)
@classmethod
- def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8):
+ def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=+1, padding_factor=8):
d = MaskedLMDictionary()
for filename in filenames:
Dictionary.add_file_to_dictionary(filename, d, tokenizer.tokenize_line, workers)
Mutant 266
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -79,7 +79,7 @@
return MaskedLMDictionary.load(filename)
@classmethod
- def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8):
+ def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-2, padding_factor=8):
d = MaskedLMDictionary()
for filename in filenames:
Dictionary.add_file_to_dictionary(filename, d, tokenizer.tokenize_line, workers)
Mutant 267
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -79,7 +79,7 @@
return MaskedLMDictionary.load(filename)
@classmethod
- def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8):
+ def build_dictionary(cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=9):
d = MaskedLMDictionary()
for filename in filenames:
Dictionary.add_file_to_dictionary(filename, d, tokenizer.tokenize_line, workers)
Mutant 268
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -86,7 +86,6 @@
d.finalize(threshold=threshold, nwords=nwords, padding_factor=padding_factor)
return d
- @property
def target_dictionary(self):
return self.dictionary
Mutant 269
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -90,7 +90,6 @@
def target_dictionary(self):
return self.dictionary
- @classmethod
def setup_task(cls, args, **kwargs):
"""Setup the task."""
dictionary = MaskedLMDictionary.load(os.path.join(args.data, 'dict.txt'))
Mutant 270
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -136,7 +136,7 @@
return dataset, sizes
- def load_dataset(self, split, epoch=1, combine=False, **kwargs):
+ def load_dataset(self, split, epoch=2, combine=False, **kwargs):
"""Load a given dataset split.
Args:
Mutant 271
--- fairseq/tasks/cross_lingual_lm.py
+++ fairseq/tasks/cross_lingual_lm.py
@@ -136,7 +136,7 @@
return dataset, sizes
- def load_dataset(self, split, epoch=1, combine=False, **kwargs):
+ def load_dataset(self, split, epoch=1, combine=True, **kwargs):
"""Load a given dataset split.
Args: