1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00
Files
textattack-nlp-transformer/textattack/datasets/classification/kaggle_fake_news.py
2020-06-17 10:07:05 -04:00

25 lines
676 B
Python

from .classification_dataset import ClassificationDataset
class KaggleFakeNews(ClassificationDataset):
"""
Loads samples from the Kaggle Fake News dataset. https://www.kaggle.com/mrisdal/fake-news
Labels
0: Real Article
1: Fake Article
Args:
offset (int): line to start reading from
shuffle (bool): If True, randomly shuffle loaded data
"""
DATA_PATH = "datasets/classification/fake"
def __init__(self, offset=0, shuffle=False):
""" Loads a full dataset from disk. """
self._load_classification_text_file(
KaggleFakeNews.DATA_PATH, offset=offset, shuffle=shuffle
)