Ask a question to get started
Enter to sendā¢Shift+Enter new line
NGramOverlapExampleSelector()
BaseExampleSelector
BaseModel
A list of the examples that the prompt template expects.
Prompt template used to format the examples.
Threshold at which algorithm stops. Set to -1.0 by default.
For negative threshold: select_examples sorts examples by ngram_overlap_score, but excludes none. For threshold greater than 1.0: select_examples excludes all examples, and returns an empty list. For threshold equal to 0.0: select_examples sorts examples by ngram_overlap_score, and excludes examples with no ngram overlap with input.
Check that valid dependencies exist.
Add new example to list.
Return list of examples sorted by ngram_overlap_score with input.
Descending order. Excludes any examples with ngram_overlap_score less than or equal to threshold.
Select and order examples based on ngram overlap score (sentence_bleu score from NLTK package).
sentence_bleu
https://www.nltk.org/_modules/nltk/translate/bleu_score.html https://aclanthology.org/P02-1040.pdf