mtp/machamp/dataset_readers/machamp_universal_reader.py
def text_to_instance2(self, sent_tasks, col_idxs, is_train, dataset, full_data):
        """
        This is a copy of text_to_instance, just meant for read_unsupervised().
        They should definitely be merged in the future #TODO
        """
        task_name = ''
        for item in sent_tasks:
            if item != 'tokens':
                task_name = item
        if task_name == '':
            logger.error('somehow the mlm task-name is not found, it is not allowed to be ' +
                         'called \'tokens\', please rename if this is the case')
        targets = sent_tasks[task_name]
        tokens = sent_tasks['tokens']
        input_field = TextField(tokens, self.token_indexers)
        target_field = SequenceLabelField(targets, input_field, label_namespace='mlm')

        sent_tasks["full_data"] = full_data
        sent_tasks["col_idxs"] = col_idxs
        sent_tasks['is_train'] = is_train

        fields = {'tokens': input_field, task_name: target_field}
        fields['dataset'] = LabelField(dataset, label_namespace='dataset')
        fields["metadata"] = MetadataField(sent_tasks)

        return Instance(fields)

        This is a copy of text_to_instance, just meant for read_unsupervised().
        They should definitely be merged in the future #TODO
        
This is a copy of text_to_instance, just meant for read_unsupervised().
They should definitely be merged in the future #TODO
This is a copy of text_to_instance just meant for read_unsupervised () . They should definitely be merged in the future #TODO
def text_to_instance2(self, sent_tasks, col_idxs, is_train, dataset, full_data):
        task_name = ''
        for item in sent_tasks:
            if item != 'tokens':
                task_name = item
        if task_name == '':
            logger.error('somehow the mlm task-name is not found, it is not allowed to be ' +
                         'called \'tokens\', please rename if this is the case')
        targets = sent_tasks[task_name]
        tokens = sent_tasks['tokens']
        input_field = TextField(tokens, self.token_indexers)
        target_field = SequenceLabelField(targets, input_field, label_namespace='mlm')
        sent_tasks["full_data"] = full_data
        sent_tasks["col_idxs"] = col_idxs
        sent_tasks['is_train'] = is_train
        fields = {'tokens': input_field, task_name: target_field}
        fields['dataset'] = LabelField(dataset, label_namespace='dataset')
        fields["metadata"] = MetadataField(sent_tasks)
        return Instance(fields)
def text_to_instance2 ( self , sent_tasks , col_idxs , is_train , dataset , full_data ) : task_name = '' for item in sent_tasks : if item != 'tokens' : task_name = item if task_name == '' : logger . error ( 'somehow the mlm task-name is not found, it is not allowed to be ' + 'called \'tokens\', please rename if this is the case' ) targets = sent_tasks [ task_name ] tokens = sent_tasks [ 'tokens' ] input_field = TextField ( tokens , self . token_indexers ) target_field = SequenceLabelField ( targets , input_field , label_namespace = 'mlm' ) sent_tasks [ "full_data" ] = full_data sent_tasks [ "col_idxs" ] = col_idxs sent_tasks [ 'is_train' ] = is_train fields = { 'tokens' : input_field , task_name : target_field } fields [ 'dataset' ] = LabelField ( dataset , label_namespace = 'dataset' ) fields [ "metadata" ] = MetadataField ( sent_tasks ) return Instance ( fields )
This is a copy of text_to_instance, just meant for read_unsupervised().
This is a copy of text_to_instance just meant for read_unsupervised () .
"""
        This is a copy of text_to_instance, just meant for read_unsupervised().
        They should definitely be merged in the future #TODO
        """
self
sent_tasks
col_idxs
is_train
dataset
full_data