Closed pavanbaswani closed 1 year ago
Hi! Of course, today I’m going to provide examples for custom NER dataset.
@pavanbaswani You should prepare dicts:
{'instruction': 'Ты решаешь задачу NER. Извлеки из текста слова, относящиеся к каждой из следующих сущностей: Drugname, Drugclass, DI, ADR, Finding.',
'input': 'Это старый-добрый Римантадин, только в сиропе.\n',
'output': 'Drugname: Римантадин\nDrugclass: \nDrugform: сиропе\nDI: \nADR: \nFinding: \n',
'source': '### Задание: Ты решаешь задачу NER. Извлеки из текста слова, относящиеся к каждой из следующих сущностей: Drugname, Drugclass, DI, ADR, Finding.\n### Вход: Это старый-добрый Римантадин, только в сиропе.\n### Ответ: ',
'raw_entities': {'Drugname': ['Римантадин'],
'Drugclass': [],
'Drugform': ['сиропе'],
'DI': [],
'ADR': [],
'Finding': []},
'id': '1_2555494.tsv'}
instruction
- general rule for every sample. You can find it in instruction_ner/flat_utils/instruct_utils.py
input
- text for NER task.output
- automatically generated from raw_entities
.source
- apply MODEL_INPUT_TEMPLATE
from instruction_ner/flat_utils/instruct_utils.py
raw_entities
- dict with parsed named entitiesThus, you should:
input
MODEL_INPUT_TEMPLATE
raw_entities
Feel free to ask any questions
could you please mention the input format to train the models.