Module¶
deepke.name_entity_re.few_shot.module.datasets module¶
- class deepke.name_entity_re.few_shot.module.datasets.ConllNERProcessor(data_path, mapping, bart_name, learn_weights)[source]¶
Bases:
object
- load_from_file(mode='train')[source]¶
load conll ner from file
- Parameters
mode (str, optional) – train/test/dev. Defaults to ‘train’.
- Returns
outputs (dict) raw_words: [‘EU’, ‘rejects’, ‘German’, ‘call’, ‘to’, ‘boycott’, ‘British’, ‘lamb’, ‘.’] raw_targets: [‘B-ORG’, ‘O’, ‘B-MISC’, ‘O’, ‘O’, ‘O’, ‘B-MISC’, ‘O’, ‘O’] entities: [[‘EU’], [‘German’], [‘British’]] entity_tags: [‘org’, ‘misc’, ‘misc’] entity_spans: [[0, 1], [2, 3], [6, 7]]