Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_download_fails_with_wrong_title(self):
with self.assertRaises(ValueError):
download_model('do.not.exists.wv')
with self.assertRaises(ValueError):
download_dataset('do.not.exists.zip')
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR):
self.dataset_name = 'europarl.sentiment2'
self.dataset_dir = download_dataset(self.dataset_name, cache_dir=cache_dir, process_func=_unzip_process_func)
self.file_path = os.path.join(cache_dir, self.dataset_name + '.csv')
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR):
self.dataset_name = 'ddt'
self.file_extension = DATASETS[self.dataset_name]['file_extension']
self.dataset_dir = download_dataset('ddt', process_func=_unzip_process_func, cache_dir=cache_dir)
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR, force: bool =False):
self.dataset_name = 'twitter.sentiment'
self.dataset_dir = download_dataset(self.dataset_name, cache_dir=cache_dir, process_func=_twitter_data_process_func)
self.file_path = os.path.join(cache_dir, self.dataset_name + '.csv')
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR):
self.dataset_name = 'europarl.sentiment1'
self.file_extension = DATASETS[self.dataset_name]['file_extension']
self.dataset_dir = download_dataset(self.dataset_name, cache_dir=cache_dir)
self.file_path = os.path.join(self.dataset_dir, self.dataset_name + self.file_extension)
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR):
self.dataset_name1 = 'lcc1.sentiment'
self.file_extension1 = DATASETS[self.dataset_name1]['file_extension']
self.dataset_dir1 = download_dataset(self.dataset_name1, cache_dir=cache_dir)
self.file_path1 = os.path.join(self.dataset_dir1, self.dataset_name1 + self.file_extension1)
self.dataset_name2 = 'lcc2.sentiment'
self.file_extension2 = DATASETS[self.dataset_name2]['file_extension']
self.dataset_dir2 = download_dataset(self.dataset_name2, cache_dir=cache_dir)
self.file_path2 = os.path.join(self.dataset_dir2, self.dataset_name2 + self.file_extension2)
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR):
self.dataset_name = 'wordsim353.da'
self.file_extension = DATASETS[self.dataset_name]['file_extension']
self.dataset_dir = download_dataset(self.dataset_name, process_func=_word_sim_process_func, cache_dir=cache_dir)
self.file_path = os.path.join(self.dataset_dir, self.dataset_name + self.file_extension)
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR):
self.dataset_name = 'dsd'
self.file_extension = DATASETS[self.dataset_name]['file_extension']
self.dataset_dir = download_dataset(self.dataset_name, cache_dir=cache_dir)
self.file_path = os.path.join(self.dataset_dir, self.dataset_name + self.file_extension)
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR):
self.dataset_name = 'wikiann'
self.file_extension = DATASETS[self.dataset_name]['file_extension']
self.dataset_dir = download_dataset(self.dataset_name, process_func=_wikiann_process_func, cache_dir=cache_dir)
def __init__(self, cache_dir: str = DEFAULT_CACHE_DIR):
self.dataset_name1 = 'lcc1.sentiment'
self.file_extension1 = DATASETS[self.dataset_name1]['file_extension']
self.dataset_dir1 = download_dataset(self.dataset_name1, cache_dir=cache_dir)
self.file_path1 = os.path.join(self.dataset_dir1, self.dataset_name1 + self.file_extension1)
self.dataset_name2 = 'lcc2.sentiment'
self.file_extension2 = DATASETS[self.dataset_name2]['file_extension']
self.dataset_dir2 = download_dataset(self.dataset_name2, cache_dir=cache_dir)
self.file_path2 = os.path.join(self.dataset_dir2, self.dataset_name2 + self.file_extension2)