example_selectors#

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.

Classes

example_selectors.ngram_overlap.NGramOverlapExampleSelector

Select and order examples based on ngram overlap score (sentence_bleu score from NLTK package).

Functions

example_selectors.ngram_overlap.ngram_overlap_score(...)

Compute ngram overlap score of source and example as sentence_bleu score from NLTK package.