def __init__(self, training="aspect"): DataFetcher.download_data(UITABSARestaurant.NAME, None) train_file = join(DATASETS_FOLDER, UITABSARestaurant.NAME, "Train.txt") dev_file = join(DATASETS_FOLDER, UITABSARestaurant.NAME, "Dev.txt") test_file = join(DATASETS_FOLDER, UITABSARestaurant.NAME, "Test.txt") print("Currently training: %s (aspect or polarity)" % training) self.training = training # aspect or polarity self.label_encoder = LabelEncoder() self.train = self._extract_sentences(train_file) self.dev = self._extract_sentences(dev_file) self.test = self._extract_sentences(test_file) self.num_labels = self.label_encoder.vocab_size
def download_data(dataset, url): DataFetcher.download_data(dataset, url)