From 1ca62b232bf51d1d660f5304a08175db5bb101f3 Mon Sep 17 00:00:00 2001 From: Oleg Sinavski <2086260+olegsinavski@users.noreply.github.com> Date: Wed, 4 Oct 2023 02:47:08 +0100 Subject: [PATCH] Docs: improve similarity search examples (#11298) **Description:** Examples in the "Select by similarity" section were not really highlighting capabilities of similarity search. E.g. "# Input is a measurement, so should select the tall/short example" was still outputting the "mood" example. I tweaked the inputs a bit and fixed the examples (checking that those are indeed what the search outputs). Co-authored-by: Harrison Chase --- .../prompts/example_selectors/similarity.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/snippets/modules/model_io/prompts/example_selectors/similarity.mdx b/docs/snippets/modules/model_io/prompts/example_selectors/similarity.mdx index 87384d54f1..4bd6f5cbb5 100644 --- a/docs/snippets/modules/model_io/prompts/example_selectors/similarity.mdx +++ b/docs/snippets/modules/model_io/prompts/example_selectors/similarity.mdx @@ -73,7 +73,7 @@ print(similar_prompt.format(adjective="worried")) ```python # Input is a measurement, so should select the tall/short example -print(similar_prompt.format(adjective="fat")) +print(similar_prompt.format(adjective="large")) ``` @@ -81,10 +81,10 @@ print(similar_prompt.format(adjective="fat")) ``` Give the antonym of every input - Input: happy - Output: sad + Input: tall + Output: short - Input: fat + Input: large Output: ``` @@ -94,7 +94,7 @@ print(similar_prompt.format(adjective="fat")) ```python # You can add new examples to the SemanticSimilarityExampleSelector as well similar_prompt.example_selector.add_example({"input": "enthusiastic", "output": "apathetic"}) -print(similar_prompt.format(adjective="joyful")) +print(similar_prompt.format(adjective="passionate")) ``` @@ -102,10 +102,10 @@ print(similar_prompt.format(adjective="joyful")) ``` Give the antonym of every input - Input: happy - Output: sad + Input: enthusiastic + Output: apathetic - Input: joyful + Input: passionate Output: ```