INNER CODE UNIT · Python

_create_examples

hooshvare/parsbert · scripts/utils.py:57

    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


def _convert_examples_to_features(
        examples: List[InputExample],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…