INNER CODE UNIT · Python

get_test_examples

hooshvare/parsbert · scripts/utils.py:46

    def get_test_examples(self, data_dir):
        """Gets a collection of :class:`InputExample` for the test set."""
        return self._create_examples(self._read_tsv(os.path.join(data_dir, "test.tsv")), "test")

    def set_labels(self, labels):
        self._labels = labels

    def get_labels(self):
        """Gets the list of labels for this data set."""
        return list(self._labels)

    def _create_examples(self, lines, set_type):
        """Creates examples for the training and dev sets."""
        examples = []
        for (i, line) in enumerate(lines):
            if i == 0:
                idx_text = line.index('text')
                idx_label = line.index('label')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…