Create a Few Shots NER

Hello,
I would like to create a few-shots NER, with T5, BERT or others architectures. Specifically, I would like to create a network that, given a prompt and an input, it’s able to process a request, as GPT-3.
My question/problem is to get a few shots NER that is able to learn what to take from a sentence by seeing only few examples.

Practical example:

prompt: "Find entities in sentence.
Data: {'entity names': ['Rome', 'USA', 'Mark', 'Ferdinando', 'Anna', 'Canada'], 'time entities': ['13 June ', '2020 ', '1 November 2010']};
Sentence: 'the population in Italy is X'
Entities: 'Italy'

... and other N different examples..."

The input can always change in data and sentence:

new_sentence = "Data: {'entity names': [some entities ..], 'numbers': [...]};
Sentence: amazing photo of Mark Valt
Entities: "

And as Network input: prompt + new_sentence.
As output I expect: “Mark Valt”

I tried this code, but here it appears that the network is trained each time.

Thank you.