Example selector implements logic for selecting examples to include them in prompts.
This allows us to select examples that are most relevant to the input.
There could be multiple strategies for selecting examples.
For example, one could select examples based on the similarity of the input to the examples. Another strategy could be to select examples based on the diversity of the examples.
Compute ngram overlap score of source and example as sentence_bleu score
from NLTK package.
Use sentence_bleu with method1 smoothing function and auto reweighting.
Return float value between 0.0 and 1.0 inclusive.
https://www.nltk.org/_modules/nltk/translate/bleu_score.html https://aclanthology.org/P02-1040.pdf