INNER CODE UNIT · Python

get_labels

hooshvare/parsbert · scripts/utils.py:53

    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')
            else:
                guid = "%s-%s" % (set_type, i)
                text_a = line[idx_text]
                label = line[idx_label]
                examples.append(
                    InputExample(guid=guid, text_a=text_a, text_b=None, label=label))
        return examples

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…