How to create few shot episode-data for training and test from the general custom NER data?

Viewed 9

I am using this library to train few-shot NER model. https://github.com/thunlp/Few-NERD

How can we leverage the script to create episode-data for training and test from the general custom NER data.

Though the module has the code but its a bit complex to go through it make it as utility to do this.

It would be useful to have a simple utility for 2 things:

  1. Generate episode-train/test data from custom data in required format.
  2. Inference script

My data is in this format:


[
{'text': 
'TN: ***************\nYour item was delivered at the front door or porch at 09:18\nam on Jan 15, 1991 in **********.\n
ABCD Tracking ADT® Available\nStatus\n✔ Delivered, Front Door \nJan 25, 1991 at 10:24 am\******************\nGet Updates', 

'spans': [{'start': 17, 'end': 39, 'label': 'TN', 'ngram': '*******************'}, 
        {'start': 142, 'end': 161, 'label': 'Carrier', 'ngram': 'ABCD Tracking ADT®'}, 
        {'start': -1, 'end': 5, 'label': 'seller', 'ngram': 'nannan'}, 
        {'start': -1, 'end': 5, 'label': 'cust', 'ngram': 'nannan'}, 
        {'start': 210, 'end': 233, 'label': 'DOS', 'ngram': '09:18\nam on Jan 15, 1991'}
        ]}
]

Please let me know if anyone has written Inference script and code to generate episode-train/test data?

0 Answers
Related