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 <hw.chase.17@gmail.com>
pull/11278/head^2
Oleg Sinavski 10 months ago committed by GitHub
parent 4adb2b399d
commit 1ca62b232b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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"))
```
<CodeOutputBlock lang="python">
@ -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"))
```
<CodeOutputBlock lang="python">
@ -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:
```

Loading…
Cancel
Save