How to use the lineflow.datasets.cnn_dailymail.CnnDailymail function in lineflow

To help you get started, we’ve selected a few lineflow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tofunlp / lineflow / tests / datasets / test_cnn_dailymail.py View on Github external
def test_raises_value_error_with_invalid_split(self):
        with self.assertRaises(ValueError):
            CnnDailymail(split='invalid_split')
github tofunlp / lineflow / tests / datasets / test_cnn_dailymail.py View on Github external
def test_loads_each_split(self):
        train = CnnDailymail(split='train')
        self.assertEqual(len(train), 287_227)
        dev = CnnDailymail(split='dev')
        self.assertEqual(len(dev), 13_368)
        test = CnnDailymail(split='test')
        self.assertEqual(len(test), 11_490)
github tofunlp / lineflow / tests / datasets / test_cnn_dailymail.py View on Github external
def test_loads_each_split(self):
        train = CnnDailymail(split='train')
        self.assertEqual(len(train), 287_227)
        dev = CnnDailymail(split='dev')
        self.assertEqual(len(dev), 13_368)
        test = CnnDailymail(split='test')
        self.assertEqual(len(test), 11_490)
github tofunlp / lineflow / tests / datasets / test_cnn_dailymail.py View on Github external
def test_loads_each_split(self):
        train = CnnDailymail(split='train')
        self.assertEqual(len(train), 287_227)
        dev = CnnDailymail(split='dev')
        self.assertEqual(len(dev), 13_368)
        test = CnnDailymail(split='test')
        self.assertEqual(len(test), 11_490)
github tofunlp / lineflow / lineflow / datasets / cnn_dailymail.py View on Github external
def __init__(self, split: str = 'train') -> None:
        if split not in {'train', 'dev', 'test'}:
            raise ValueError(f"only 'train', 'dev' and 'test' are valid for 'split', but '{split}' is given.")

        raw = cached_get_cnn_dailymail()
        super(CnnDailymail, self).__init__(*raw[split])