コード例 #1
0
    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
コード例 #2
0
ファイル: cli.py プロジェクト: nguyendong07/underthesea
def download_data(dataset, url):
    DataFetcher.download_data(dataset, url)