Skip to content
Snippets Groups Projects
Commit 4749e6e2 authored by Joshua Briggs's avatar Joshua Briggs
Browse files

feat: fixed encoders docs to use semantic router v 0.1.0

parent 69b49329
Branches
Tags
No related merge requests found
%% Cell type:markdown id: tags:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/aurelio-labs/semantic-router/blob/main/docs/encoders/fastembed.ipynb) [![Open nbviewer](https://raw.githubusercontent.com/pinecone-io/examples/master/assets/nbviewer-shield.svg)](https://nbviewer.org/github/aurelio-labs/semantic-router/blob/main/docs/encoders/fastembed.ipynb)
%% Cell type:markdown id: tags:
# Using FastEmbedEncoder
%% Cell type:markdown id: tags:
FastEmbed is a _lightweight and fast_ embedding library built for generating embeddings. It can be run locally and supports many open source encoders.
Beyond being a local, open source library, there are two key reasons we might want to run this library over other open source alternatives:
* **Lightweight and Fast**: The library uses an ONNX runtime so there is no heavy PyTorch dependency, supports quantized model weights (smaller memory footprint), is developed for running on CPU, and uses data-parallelism for encoding large datasets.
* **Open-weight models**: FastEmbed supports many open source and open-weight models, included some that outperform popular encoders like OpenAI's Ada-002.
%% Cell type:markdown id: tags:
## Getting Started
%% Cell type:markdown id: tags:
We start by installing semantic-router with the `[fastembed]` flag to include all necessary dependencies for `FastEmbedEncoder`:
%% Cell type:code id: tags:
``` python
!pip install -qU "semantic-router[fastembed]==0.0.20"
!pip install -qU "semantic-router[fastembed]==0.1.0"
```
%% Cell type:markdown id: tags:
We start by defining a dictionary mapping routes to example phrases that should trigger those routes.
%% Cell type:code id: tags:
``` python
from semantic_router import Route
politics = Route(
name="politics",
utterances=[
"isn't politics the best thing ever",
"why don't you tell me about your political opinions",
"don't you just love the president",
"don't you just hate the president",
"they're going to destroy this country!",
"they will save the country!",
],
)
```
%% Cell type:markdown id: tags:
Let's define another for good measure:
%% Cell type:code id: tags:
``` python
chitchat = Route(
name="chitchat",
utterances=[
"how's the weather today?",
"how are things going?",
"lovely weather today",
"the weather is horrendous",
"let's go to the chippy",
],
)
routes = [politics, chitchat]
```
%% Cell type:markdown id: tags:
Now we initialize our embedding model, you can find a list of [all available embedding models here](https://qdrant.github.io/fastembed/examples/Supported_Models/):
%% Cell type:code id: tags:
``` python
from semantic_router.encoders import FastEmbedEncoder
encoder = FastEmbedEncoder(name="BAAI/bge-small-en-v1.5")
```
%% Output
Fetching 5 files: 0%| | 0/5 [00:00<?, ?it/s]c:\Users\Joshu\OneDrive\Documents\Aurelio\agents-course\07-pratical-ai\.venv\Lib\site-packages\huggingface_hub\file_download.py:140: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\Joshu\AppData\Local\Temp\fastembed_cache\models--qdrant--bge-small-en-v1.5-onnx-q. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations.
To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development
warnings.warn(message)
Fetching 5 files: 100%|██████████| 5/5 [00:06<00:00, 1.33s/it]
%% Cell type:markdown id: tags:
_**⚠️ If you see an ImportError, you must install the FastEmbed library. You can do so by installing Semantic Router using `pip install -qU "semantic-router[fastembed]"`.**_
%% Cell type:markdown id: tags:
Now we define the `RouteLayer`. When called, the route layer will consume text (a query) and output the category (`Route`) it belongs to — to initialize a `RouteLayer` we need our `encoder` model and a list of `routes`.
%% Cell type:code id: tags:
``` python
from semantic_router.layer import RouteLayer
from semantic_router.routers import SemanticRouter
rl = RouteLayer(encoder=encoder, routes=routes)
rl = SemanticRouter(encoder=encoder, routes=routes, auto_sync="local")
```
%% Output
2024-01-06 16:53:16 INFO semantic_router.utils.logger Initializing RouteLayer
2025-01-07 15:40:59 - semantic_router.utils.logger - WARNING - base.py:356 - _get_index() - No index provided. Using default LocalIndex.
2025-01-07 15:41:00 - semantic_router.utils.logger - WARNING - local.py:148 - _write_config() - No config is written for LocalIndex.
%% Cell type:markdown id: tags:
Now we can test it:
%% Cell type:code id: tags:
``` python
rl("don't you love politics?")
```
%% Output
RouteChoice(name='politics', function_call=None)
RouteChoice(name='politics', function_call=None, similarity_score=None)
%% Cell type:code id: tags:
``` python
rl("how's the weather today?")
```
%% Output
RouteChoice(name='chitchat', function_call=None)
RouteChoice(name='chitchat', function_call=None, similarity_score=None)
%% Cell type:markdown id: tags:
Both are classified accurately, what if we send a query that is unrelated to our existing `Route` objects?
%% Cell type:code id: tags:
``` python
rl("I'm interested in learning about llama 2")
rl("I'm interested in learning about llama 2 mechanics")
```
%% Output
RouteChoice(name=None, function_call=None)
RouteChoice(name=None, function_call=None, similarity_score=None)
%% Cell type:markdown id: tags:
In this case, we return `None` because no matches were identified.
......
%% Cell type:markdown id: tags:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/aurelio-labs/semantic-router/blob/main/docs/encoders/google.ipynb) [![Open nbviewer](https://raw.githubusercontent.com/pinecone-io/examples/master/assets/nbviewer-shield.svg)](https://nbviewer.org/github/aurelio-labs/semantic-router/blob/main/docs/encoders/google.ipynb)
%% Cell type:markdown id: tags:
# Using GoogleEncoder
%% Cell type:markdown id: tags:
Google's [Pathways Language Model](https://blog.research.google/2022/04/pathways-language-model-palm-scaling-to.html) (PaLM) is a dense decoder-only model that is trained on a large corpus of text data. The hidden states of the model can be used as embeddings for text data, and Google has released versions of those layers for public use. This notebook demonstrates how to use the GoogleEncoder with the Semantic Router.
%% Cell type:markdown id: tags:
## Getting Started
%% Cell type:markdown id: tags:
We start by installing semantic-router. Support for the new `GoogleEncoder` class was added in `semantic-router==0.0.31`.
%% Cell type:code id: tags:
``` python
!pip install -qU "semantic-router[google]"
```
%% Cell type:markdown id: tags:
We start by defining a dictionary mapping routes to example phrases that should trigger those routes.
%% Cell type:code id: tags:
``` python
from semantic_router import Route
politics = Route(
name="politics",
utterances=[
"isn't politics the best thing ever",
"why don't you tell me about your political opinions",
"don't you just love the president",
"don't you just hate the president",
"they're going to destroy this country!",
"they will save the country!",
],
)
```
%% Cell type:markdown id: tags:
Let's define another for good measure:
%% Cell type:code id: tags:
``` python
chitchat = Route(
name="chitchat",
utterances=[
"how's the weather today?",
"how are things going?",
"lovely weather today",
"the weather is horrendous",
"let's go to the chippy",
],
)
routes = [politics, chitchat]
```
%% Cell type:markdown id: tags:
Now we initialize our embedding model. To do this with GoogleEncoder, you'll need to have an active Google Cloud Platform account and a project with the Embeddings API enabled. You can find more information on how to set up a development project in the [Google Cloud documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-text-embeddings).
%% Cell type:code id: tags:
``` python
from semantic_router.encoders import GoogleEncoder
PROJECT_ID = "your-project-id"
LOCATION = "us-central1"
encoder = GoogleEncoder(project_id=PROJECT_ID, location=LOCATION)
```
%% Cell type:markdown id: tags:
Now we define the `RouteLayer`. When called, the route layer will consume text (a query) and output the category (`Route`) it belongs to — to initialize a `RouteLayer` we need our `encoder` model and a list of `routes`.
%% Cell type:code id: tags:
``` python
from semantic_router.layer import RouteLayer
from semantic_router.routers import SemanticRouter
rl = RouteLayer(encoder=encoder, routes=routes)
rl = SemanticRouter(encoder=encoder, routes=routes, auto_sync="local")
```
%% Cell type:markdown id: tags:
Now we can test it:
%% Cell type:code id: tags:
``` python
rl("don't you love politics?")
```
%% Cell type:code id: tags:
``` python
rl("how's the weather today?")
```
%% Cell type:markdown id: tags:
Both are classified accurately, what if we send a query that is unrelated to our existing `Route` objects?
%% Cell type:code id: tags:
``` python
rl("I'm interested in learning about llama 2")
```
%% Cell type:markdown id: tags:
In this case, we return `None` because no matches were identified.
......
%% Cell type:markdown id: tags:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/aurelio-labs/semantic-router/blob/main/docs/encoders/huggingface-endpoint.ipynb) [![Open nbviewer](https://raw.githubusercontent.com/pinecone-io/examples/master/assets/nbviewer-shield.svg)](https://nbviewer.org/github/aurelio-labs/semantic-router/blob/main/docs/encoders/huggingface-endpoint.ipynb)
%% Cell type:markdown id: tags:
# Using Huggingface endpoint
%% Cell type:markdown id: tags:
HuggingFace is a huge ecosystem of open source models. It can be run locally and supports the largest library of encoders.
%% Cell type:markdown id: tags:
## Getting Started
%% Cell type:markdown id: tags:
We start by installing semantic-router.
%% Cell type:code id: tags:
``` python
# !pip install -qU semantic-router==0.0.20
!pip install -qU "semantic-router==0.1.0"
```
%% Cell type:markdown id: tags:
We start by defining a dictionary mapping routes to example phrases that should trigger those routes.
%% Cell type:code id: tags:
``` python
from semantic_router import Route
politics = Route(
name="politics",
utterances=[
"isn't politics the best thing ever",
"why don't you tell me about your political opinions",
"don't you just love the president",
"don't you just hate the president",
"they're going to destroy this country!",
"they will save the country!",
],
)
```
%% Output
d:\Program_Installation\anaconda\envs\testenv\Lib\site-packages\tqdm\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
%% Cell type:markdown id: tags:
Let's define another for good measure:
%% Cell type:code id: tags:
``` python
chitchat = Route(
name="chitchat",
utterances=[
"how's the weather today?",
"how are things going?",
"lovely weather today",
"the weather is horrendous",
"let's go to the chippy",
],
)
routes = [politics, chitchat]
```
%% Cell type:markdown id: tags:
Now we initialize our embedding model, we will use the Huggingface endpoint
%% Cell type:code id: tags:
``` python
import os
from getpass import getpass
from semantic_router.encoders.huggingface import HFEndpointEncoder
huggingface_url = os.getenv("HF_API_URL") or getpass("Enter HuggingFace API URL: ")
huggingface_api_key = os.getenv("HF_API_KEY") or getpass("Enter HuggingFace API Key: ")
encoder = HFEndpointEncoder(
huggingface_url=huggingface_url,
huggingface_api_key=huggingface_api_key,
)
```
%% Output
d:\Program_Installation\anaconda\envs\testenv\Lib\site-packages\tqdm\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
2024-04-14 20:54:07 INFO semantic_router.utils.logger Model Initializing wait for - 26.81s 
%% Cell type:code id: tags:
``` python
encoder("Hey")
```
%% Output
[[-0.351535439491272,
-0.0007503691595047712,
0.22843779623508453,
0.1197630763053894,
-0.9190473556518555,
0.4975742697715759,
0.08101634681224823,
0.05379204452037811,
0.1970519870519638,
-0.0833292305469513,
0.36685681343078613,
0.004698676988482475,
-0.19794942438602448,
-0.33827024698257446,
-0.24040493369102478,
0.3189111649990082,
-0.5002703666687012,
-0.6781224012374878,
-0.2871842384338379,
0.0505770742893219,
-0.03144306689500809,
0.15773507952690125,
-1.278083324432373,
-0.2693241238594055,
-0.11886045336723328,
0.3414249122142792,
0.5203899145126343,
0.6207894682884216,
0.6428499817848206,
0.8519144058227539,
-0.08569950610399246,
0.32095733284950256,
0.38129955530166626,
-0.5376394391059875,
-0.23925058543682098,
-0.975605309009552,
0.14065563678741455,
0.08411094546318054,
0.5871137976646423,
-0.5853262543678284,
-0.16012267768383026,
-0.30777785181999207,
0.32361841201782227,
-0.5167716145515442,
-0.6283416152000427,
-0.040950220078229904,
0.4034270942211151,
-0.5306437015533447,
0.1296883225440979,
-0.8245601654052734,
-0.24195696413516998,
-0.5704426169395447,
0.3505809009075165,
-0.033617936074733734,
0.338241308927536,
0.05172817409038544,
0.1608736217021942,
0.06910604983568192,
-0.6235120892524719,
0.8605656623840332,
0.18825599551200867,
0.26032543182373047,
0.4893842935562134,
-0.28306061029434204,
-0.01022877637296915,
0.2018183022737503,
0.0314965546131134,
-0.40636199712753296,
0.2871060371398926,
-0.5569078326225281,
0.12462319433689117,
0.24766811728477478,
-0.6712727546691895,
-0.34486064314842224,
-0.2843998074531555,
0.2237756997346878,
-0.10615847259759903,
-0.4099731743335724,
-0.4892323613166809,
0.7918497323989868,
0.121148020029068,
0.8321442008018494,
0.3077283203601837,
0.174817755818367,
-0.673957109451294,
-0.10718388855457306,
-0.020176205784082413,
0.44770675897598267,
0.14065337181091309,
0.011919533833861351,
-0.09472586214542389,
0.42185404896736145,
-0.08556605130434036,
-0.003908890299499035,
0.4729606807231903,
1.0341724157333374,
-0.4871886670589447,
0.7629178762435913,
-0.7858189344406128,
0.7404838800430298,
-0.09609171003103256,
0.33085229992866516,
-0.07759019732475281,
0.608190655708313,
-0.7358576655387878,
-0.46256259083747864,
0.17247380316257477,
0.47123825550079346,
-0.07190967351198196,
-0.3706129789352417,
0.6815729141235352,
0.10979508608579636,
0.01968960091471672,
0.3837202191352844,
-0.37777477502822876,
0.296452134847641,
-0.47000813484191895,
0.6567757725715637,
-0.4787653982639313,
0.10389051586389542,
-0.13098134100437164,
0.06771161407232285,
0.9172448515892029,
0.7513774037361145,
-0.3587314188480377,
-0.07944370806217194,
-0.3190295696258545,
0.35680150985717773,
-0.7315585017204285,
-0.2934412658214569,
-0.29015278816223145,
-0.6571040153503418,
0.3849678337574005,
0.37416988611221313,
0.07331178337335587,
0.22313304245471954,
-0.0582025870680809,
0.48670142889022827,
0.5369858145713806,
-0.7363126277923584,
0.408779501914978,
0.08013352751731873,
0.32343122363090515,
1.1921049356460571,
-0.33595478534698486,
0.7817761898040771,
0.09240103513002396,
0.747512936592102,
-0.975735068321228,
-0.46965065598487854,
-0.5060147047042847,
0.315020889043808,
-0.8111321330070496,
0.1700848788022995,
-0.44967469573020935,
0.2730434238910675,
-0.28182634711265564,
-0.11358585953712463,
0.3349793255329132,
0.6125620603561401,
-1.1185657978057861,
-0.23598258197307587,
0.11817905306816101,
0.14007949829101562,
-0.1342378556728363,
0.6637296080589294,
-0.34339287877082825,
0.37832096219062805,
-0.20260536670684814,
-0.42285487055778503,
0.3214675784111023,
0.3772791922092438,
0.13906392455101013,
-0.15471051633358002,
0.1717817336320877,
0.6878579258918762,
0.4495076835155487,
0.42458420991897583,
0.6390083432197571,
-0.18033525347709656,
0.26399803161621094,
-0.2000855803489685,
0.1517951339483261,
0.5062836408615112,
0.16540852189064026,
-0.5752784013748169,
0.3921325206756592,
0.3396417498588562,
-0.5016378164291382,
-0.1977510303258896,
-0.37614500522613525,
-0.0459459163248539,
-0.8561480641365051,
0.41308894753456116,
-0.2559718191623688,
0.33978575468063354,
-1.0577623844146729,
-0.4702085852622986,
-0.15038155019283295,
-0.417285680770874,
-0.10158014297485352,
1.085134506225586,
-0.5067138075828552,
0.3239610493183136,
0.5427021384239197,
-0.4705069065093994,
0.564260721206665,
0.662142813205719,
-0.674139142036438,
-0.05586134269833565,
0.41527360677719116,
0.3268394470214844,
-0.15188544988632202,
0.2864024043083191,
-0.058077551424503326,
0.7025948762893677,
-0.2740480601787567,
0.4234461784362793,
-0.8005895018577576,
0.3397463858127594,
0.5496795773506165,
0.10069300979375839,
0.6318082213401794,
1.220789909362793,
0.12347802519798279,
0.2145691066980362,
0.5473058819770813,
0.58868008852005,
0.5263211131095886,
-0.39429542422294617,
-0.12528102099895477,
0.21609920263290405,
-0.3399151563644409,
0.6400638818740845,
-0.385766863822937,
-0.0837368443608284,
0.19966909289360046,
0.6031802892684937,
0.6655975580215454,
-0.06525135785341263,
0.421434223651886,
-0.11338674277067184,
0.6240838766098022,
0.2370661199092865,
-0.28858521580696106,
0.018270932137966156,
0.16613556444644928,
0.5155487060546875,
-0.7947002649307251,
0.43162399530410767,
-0.2558012008666992,
0.322053998708725,
0.2850834131240845,
0.6699681282043457,
-0.7805972695350647,
-0.0967356339097023,
0.26844969391822815,
0.25309741497039795,
-0.040921133011579514,
-0.2745266258716583,
-0.2656719386577606,
0.7735238671302795,
0.36282986402511597,
0.3531838059425354,
-0.018144357949495316,
0.2762523889541626,
0.292710542678833,
0.7624996900558472,
0.4032532572746277,
-0.47754618525505066,
-0.15234309434890747,
-0.646909236907959,
-0.6886371970176697,
-0.4359741806983948,
-0.3814290761947632,
-0.14441734552383423,
0.8817673921585083,
-0.07520444691181183,
0.2902243137359619,
-0.0363328754901886,
-0.09644324332475662,
-0.2702822685241699,
-0.0903836041688919,
-0.07166784256696701,
0.4520867168903351,
0.7583602070808411,
-0.17694738507270813,
-0.1802419275045395,
0.036734264343976974,
0.5039187073707581,
-0.3738216459751129,
-0.2462330311536789,
-0.16176871955394745,
-0.09859970211982727,
-0.24951350688934326,
-0.2699921429157257,
-0.6594424843788147,
0.051325127482414246,
-0.6931187510490417,
-1.0771921873092651,
0.5300352573394775,
-0.26480865478515625,
-0.21046501398086548,
-0.7360295057296753,
-0.5392773151397705,
0.07280915975570679,
0.3488386273384094,
-0.3438490033149719,
0.9271075129508972,
0.8084055185317993,
-0.43852490186691284,
0.377078652381897,
0.5122473835945129,
0.5148366093635559,
-0.6005906462669373,
0.5307503342628479,
-0.11821816861629486,
0.1444067656993866,
-1.4041671752929688,
-0.14894679188728333,
-0.4679705500602722,
-0.4729899764060974,
-0.3515671491622925,
-1.0960698127746582,
-0.046922557055950165,
0.47342783212661743,
0.7556535601615906,
-1.0950236320495605,
0.2015274316072464,
-0.4315618872642517,
-0.8300988078117371,
-0.18433940410614014,
-0.9175993800163269,
0.9776148796081543,
-0.07103785127401352,
0.16896787285804749,
-0.12059900909662247,
-0.24394500255584717,
0.44257596135139465,
0.2439504861831665,
0.6449788212776184,
-0.9974457025527954,
0.7066627144813538,
0.45798584818840027,
0.4536619782447815,
0.36611127853393555,
0.48572322726249695,
-0.12092026323080063,
-0.5880641341209412,
0.3482988178730011,
0.03320842236280441,
-0.19150950014591217,
0.32792967557907104,
0.14458581805229187,
0.2966439425945282,
0.3636152148246765,
-0.4487185478210449,
0.13955338299274445,
0.07723299413919449,
0.29051685333251953,
0.6939775347709656,
0.22232133150100708,
-0.13401393592357635,
-0.23672369122505188,
-0.19740118086338043,
-0.9358344078063965,
0.30432987213134766,
-0.4772465229034424,
0.28738725185394287,
-0.9792874455451965,
0.33745595812797546,
-0.22576816380023956,
-0.7814821004867554,
0.5664247870445251,
-0.432607501745224,
0.09034114331007004,
0.29543694853782654,
0.1969209611415863,
-0.11263825744390488,
-0.49571752548217773,
0.6815844178199768,
-0.2476591318845749,
-0.084346242249012,
0.13864430785179138,
0.6361597180366516,
0.6096804738044739,
0.31687605381011963,
0.3509639799594879,
-0.45081862807273865,
0.34895265102386475,
0.0014897516230121255,
-0.31649163365364075,
0.8546939492225647,
-0.5078703165054321,
-1.0238487720489502,
-0.35330167412757874,
0.42015737295150757,
0.2236682027578354,
0.6500250101089478,
-0.32474857568740845,
0.6556638479232788,
-0.025438643991947174,
0.8389859795570374,
0.5562865138053894,
0.18280459940433502,
0.08434924483299255,
0.042215943336486816,
0.5467571020126343,
0.1123742163181305,
0.03244837000966072,
-1.0061715841293335,
-0.3085944950580597,
-0.6957574486732483,
0.22116586565971375,
0.382159948348999,
0.22632470726966858,
-0.27501484751701355,
-0.2863302230834961,
0.4582352042198181,
0.5971866846084595,
0.46816304326057434,
-0.13226784765720367,
-0.2464510053396225,
0.46584272384643555,
0.10705604404211044,
-0.351188987493515,
0.12138845771551132,
-0.6085167527198792,
0.3774726986885071,
0.5407528877258301,
0.0064618270844221115,
-0.573912501335144,
0.05149620398879051,
0.23512426018714905,
-0.387866735458374,
-0.48907822370529175,
0.4558003544807434,
0.3432888686656952,
0.9528384208679199,
-0.6374655961990356,
0.34813398122787476,
-0.23865161836147308,
-0.4767013192176819,
0.3049609363079071,
0.4352666735649109,
0.42963385581970215,
0.12873537838459015,
0.8428581953048706,
-0.5732046365737915,
-0.7193275094032288,
0.09657884389162064,
-1.4704506397247314,
0.4931609034538269,
0.43918612599372864,
-0.44628724455833435,
-0.13946163654327393,
-0.22067882120609283,
-0.06430879235267639,
-0.05333731323480606,
-0.8031220436096191,
-0.41270455718040466,
-0.010898495092988014,
0.5054727792739868,
-0.13417154550552368,
-0.09902690351009369,
1.3453506231307983,
-0.4104675054550171,
-0.5713691115379333,
0.5122509002685547,
-0.02970154955983162,
0.0001729759678710252,
-0.34633317589759827,
0.58829665184021,
0.2868087887763977,
0.2541254460811615,
-0.05617895722389221,
0.6807460188865662,
-0.08982411026954651,
-0.7709076404571533,
0.4982278347015381,
-0.37107664346694946,
0.03981844708323479,
-0.25501468777656555,
-0.3640649616718292,
-0.03449568524956703,
-0.867987871170044,
-0.2041328102350235,
0.027860060334205627,
-0.6101935505867004,
0.5620599985122681,
0.2859831154346466,
0.5863463282585144,
-0.4182853102684021,
0.08681090921163559,
0.14754517376422882,
-0.06796219199895859,
-0.27611684799194336,
-0.2342776209115982,
0.19633087515830994,
0.2756378650665283,
0.5625853538513184,
-0.49814656376838684,
-0.401283860206604,
-0.09274519979953766,
-0.38711124658584595,
-0.36291393637657166,
-0.5965020656585693,
0.08162636309862137,
0.0009226799593307078,
0.12532298266887665,
0.27732548117637634,
-0.33255183696746826,
-0.47273731231689453,
0.3618244230747223,
-0.6171136498451233,
0.754910945892334,
-0.033839914947748184,
0.07171781361103058,
-0.16260485351085663,
1.2018041610717773,
0.8110723495483398,
-0.6492946147918701,
-0.29279717803001404,
0.4938250482082367,
0.027557458728551865,
0.5749586224555969,
0.2800053656101227,
0.03805295750498772,
0.16644710302352905,
-0.8560732007026672,
0.1032106801867485,
-0.06021938472986221,
-0.7916827201843262,
-0.6022663712501526,
-0.329144686460495,
-0.9039788842201233,
0.8628774285316467,
0.27277982234954834,
0.4087710380554199,
0.08519420772790909,
-0.49490687251091003,
0.05425240099430084,
0.36529237031936646,
-0.737844705581665,
-0.3061997592449188,
0.12480030208826065,
0.20698219537734985,
0.6797382235527039,
-0.5483785271644592,
0.276843398809433,
-0.04296817258000374,
-0.0498192124068737,
0.18017064034938812,
0.24226133525371552,
-0.39626362919807434,
-0.1816210150718689,
0.3709948658943176,
-0.2237037867307663,
0.12779122591018677,
0.3271578252315521,
-0.11732201278209686,
0.26085489988327026,
-0.6515527963638306,
-0.21465128660202026,
-0.3324236273765564,
-0.5589518547058105,
0.12180844694375992,
0.1852940022945404,
0.5779324173927307,
0.36550113558769226,
-0.11930176615715027,
-0.06511150300502777,
-0.1553603559732437,
0.5276203751564026,
0.3745949864387512,
-0.5842090845108032,
-0.6464338898658752,
-0.38732996582984924,
-0.8451240062713623,
0.32487261295318604,
-0.2058093249797821,
0.13900302350521088,
-0.8028187155723572,
-0.3149273097515106,
0.9239713549613953,
0.2142457515001297,
-0.2100885808467865,
1.455012559890747,
-0.5873098969459534,
0.500898540019989,
0.02715122140944004,
0.563439667224884,
0.18631429970264435,
-0.4562689960002899,
-0.1576705276966095,
-0.5597322583198547,
-0.06370822340250015,
0.24073514342308044,
-0.961319088935852,
-0.17020557820796967,
-0.7333323955535889,
-0.4487285614013672,
0.3572932481765747,
0.03249140828847885,
0.830589771270752,
0.11472773551940918,
-0.539686918258667,
-0.5189257264137268,
0.40835750102996826,
0.3892066180706024,
-0.3863535523414612,
0.2951650619506836,
0.03117988631129265,
-0.40388214588165283,
0.6936691999435425,
-0.2541087567806244,
-0.2086130678653717,
-0.30088797211647034,
0.39943927526474,
-0.11459176987409592,
-0.6543619632720947,
0.6635531187057495,
0.4099794924259186,
-1.076621413230896,
-0.31472936272621155,
-0.09162159264087677,
-0.10547883063554764,
-0.203010693192482,
-0.797065794467926,
-0.21599599719047546,
0.012090904638171196,
0.25781190395355225,
-0.7289014458656311,
0.014427169226109982,
-0.05590129271149635,
0.6503525376319885,
-0.25092804431915283,
0.8132804036140442,
-0.5299649834632874,
-0.18269559741020203,
0.49492546916007996,
-0.4528919458389282,
-0.05405370891094208,
-0.11458656191825867,
0.8546084761619568,
-0.24550120532512665,
0.049994587898254395,
0.5189576745033264,
-0.4165690243244171,
-0.3450049161911011,
0.5662803053855896,
0.08417262136936188,
-0.42365437746047974,
0.12669695913791656,
-0.3068799376487732,
0.7521166801452637,
-0.09769726544618607,
-0.8809972405433655,
0.11703585088253021,
0.5754616260528564,
-0.31427350640296936,
0.0451238639652729,
-0.5953565239906311,
-0.35429322719573975,
0.688956081867218,
0.25111037492752075,
-0.11199289560317993,
-0.33815497159957886,
0.052134666591882706,
-0.5139267444610596,
-0.880919337272644,
-0.9578896760940552,
0.44254070520401,
0.2506037652492523,
0.7118644714355469,
-0.3801298141479492,
0.09831752628087997,
-0.3725154995918274,
0.9608874917030334,
-0.6097050309181213,
0.5317102670669556,
0.18883268535137177,
-0.2739759385585785,
0.0060667130164802074,
-0.7999657988548279,
-0.49761518836021423,
-0.04410175234079361,
0.021492933854460716,
-0.26157134771347046,
0.3662603497505188,
0.07656055688858032,
-0.20391426980495453,
0.23112739622592926,
0.05148652195930481,
0.1546042412519455,
0.21650385856628418,
-1.1717547178268433,
-0.1276608407497406,
0.7806116938591003,
0.7273387312889099,
0.6802674531936646,
0.6182719469070435,
-0.4920237064361572,
0.18753017485141754,
0.47386983036994934,
0.28862181305885315,
-0.3754692077636719,
-0.0561814084649086,
-0.012385806068778038,
-0.6008806824684143,
-0.5645871758460999,
-1.0939054489135742,
-0.46547579765319824,
-0.9732064604759216,
-0.12648724019527435,
0.09849158674478531,
0.3843759596347809,
-0.4629274904727936,
0.17386573553085327,
0.15112851560115814,
0.7017663717269897,
-0.16923131048679352,
0.2237587720155716,
0.2665000557899475,
0.2541508376598358,
0.30873268842697144,
-0.5635056495666504,
0.5241885781288147,
0.2771768271923065,
0.2790517210960388,
-0.539208173751831,
-0.7596209645271301,
0.6352860331535339,
0.2882881462574005,
0.34007710218429565,
-0.474793940782547,
-0.6396011114120483,
-0.2593938708305359,
0.08468469977378845,
-0.24741365015506744,
0.556648850440979,
0.3211875855922699,
-0.4658515453338623,
0.14536313712596893,
-0.39535415172576904,
-0.9148903489112854,
0.4538055956363678,
-0.8095774054527283,
0.060072802007198334,
0.33706173300743103,
0.03795214742422104,
-0.5362184047698975,
-0.2864001989364624,
-1.0039011240005493,
-0.3602775037288666,
-0.7287405729293823,
0.2748887538909912,
-0.07904542237520218,
0.43842989206314087,
0.4292987883090973,
-0.2311275154352188,
-0.7116916179656982,
-0.11643634736537933,
-0.7759585380554199,
0.7385767698287964,
0.04599079489707947,
-0.6884185075759888,
0.2725524604320526,
0.6506152749061584,
0.39920005202293396,
0.09319861978292465,
-0.38983431458473206,
0.5238291025161743,
-0.5580272078514099,
-0.0103628970682621,
-0.38650044798851013,
-0.3914099931716919,
0.22562870383262634,
0.24987107515335083,
-0.5925841927528381,
-0.0284016951918602,
-0.6322098970413208,
0.4557032287120819,
-0.004712618421763182,
-0.6027783155441284,
0.3160114884376526,
0.3637271821498871,
0.3804703950881958,
0.48565515875816345,
0.5258179903030396,
0.8879186511039734,
0.7316209673881531,
0.0416119210422039,
-1.0093135833740234,
0.11492951214313507,
0.8028061985969543,
0.06716805696487427,
0.0019319140119478106,
-0.3770061135292053,
-0.07625972479581833,
0.5457291603088379,
-0.09309566020965576,
-0.01992066018283367,
0.7474305629730225,
0.15377254784107208,
-0.11079899221658707,
0.2939283549785614,
-0.41370704770088196,
0.5233023762702942,
-0.2431264966726303,
0.3325313627719879,
0.5507897734642029,
-0.2349100261926651,
-0.26681745052337646,
0.33428627252578735,
0.20792822539806366,
0.20537535846233368,
-0.23919019103050232,
0.05211174488067627,
-0.029082706198096275,
-0.5170590281486511,
-0.148354634642601,
0.17387090623378754,
0.3997310400009155,
0.6324551105499268,
0.5969943404197693,
-0.1682303249835968,
0.39327800273895264,
-0.10407182574272156,
0.2405574768781662,
0.27164438366889954,
-1.1877676248550415,
0.14967003464698792,
0.155400350689888,
-0.1664905548095703,
-0.8923134207725525,
0.31925272941589355,
-0.6922290921211243,
0.37472066283226013,
0.05517548322677612,
0.03848360478878021,
0.1037290170788765,
-0.5190158486366272,
-0.6224437355995178,
-0.7139700651168823,
0.8266307711601257,
-0.11380338668823242,
0.08344950526952744,
0.5643734931945801,
0.027856847271323204,
-0.019112922251224518,
0.7826627492904663,
-0.4863210618495941,
0.6647438406944275,
0.2020666003227234,
0.9220132231712341,
0.8749033212661743,
0.2835003733634949,
0.9998884201049805,
-0.672473132610321,
-0.32181110978126526,
-0.5558651685714722,
-0.2695208787918091,
-0.7541895508766174,
0.1516842544078827,
-0.4608273208141327,
-0.3914019465446472,
-0.26724764704704285,
0.43134525418281555,
-0.6212441325187683,
0.3745012879371643,
-0.37949445843696594,
-1.119378924369812,
-0.07150902599096298,
-0.5286315679550171,
-0.14950813353061676,
0.1515863537788391,
1.2689299583435059,
1.0098563432693481,
-0.014573409222066402,
-0.09301596879959106,
-0.28702157735824585,
0.44630059599876404,
-0.320136696100235,
-0.3883953094482422,
0.7925869822502136,
-0.4618237614631653,
-1.2889593839645386,
-0.3566947877407074,
-0.6348873376846313,
-0.7300600409507751,
0.09211597591638565,
-0.9467034339904785,
0.16685202717781067,
-0.09806318581104279,
0.26248520612716675,
-0.23755009472370148,
0.5351219773292542,
-0.4853552281856537,
0.7577729821205139,
0.38879889249801636,
0.6300411820411682,
-0.2574041783809662,
0.7323415279388428,
0.09847570210695267,
-0.5526623129844666,
-0.3854880928993225,
-0.7990260720252991,
0.35248231887817383,
-0.4668175280094147,
-0.10290756821632385,
-0.09236554801464081,
-0.258074551820755,
-0.24723400175571442,
-0.6552531719207764,
0.16103433072566986,
0.6218563318252563,
0.24903221428394318,
-0.5528410077095032,
-1.3529237508773804,
0.23143072426319122,
-1.045642614364624,
-0.2803279161453247,
-0.44280824065208435,
0.6601386070251465,
0.03146280348300934,
-0.25061336159706116,
0.1281445175409317,
-0.9006889462471008,
4.462767601013184,
0.5997637510299683,
0.4976256787776947,
-0.4936535358428955,
0.17143943905830383,
0.8772667050361633,
0.285220205783844,
0.9304468631744385,
-0.27842092514038086,
-0.45088550448417664,
0.3779442310333252,
0.1473567634820938,
0.2477225661277771,
0.4404883086681366,
-0.08007366955280304,
0.9077342748641968,
-0.5756711959838867,
0.30554863810539246,
-0.08678336441516876,
-1.0750330686569214,
0.0004209561739116907,
-0.6181638836860657,
0.5358628034591675,
0.17197741568088531,
0.3999564051628113,
-0.3586116135120392,
1.0736268758773804,
-0.5334151387214661,
0.06598101556301117,
-0.2870873808860779,
-0.2306235432624817,
-0.5238915681838989,
-0.4700780510902405,
-0.7910664081573486,
-0.5595477819442749,
0.5381693243980408,
0.43998298048973083,
-0.4397830367088318,
0.15957890450954437,
-0.1641160249710083,
-0.26293277740478516,
-0.12118148803710938,
0.482787162065506,
-0.8770087957382202,
-0.1327838897705078,
0.28636783361434937,
-0.47440096735954285,
0.10034739226102829,
0.28839558362960815,
-0.12855111062526703,
1.0286990404129028,
-0.7193248867988586,
0.21239891648292542,
-0.6174246072769165,
-0.7919260263442993,
-0.03878069669008255,
-0.3190139830112457,
-0.23707982897758484,
-0.5065869688987732,
-0.43810972571372986,
-0.3110460340976715,
-0.2863406836986542,
-0.4253699779510498,
0.3866632580757141,
-0.8151654601097107,
0.4530806839466095,
0.602790117263794,
0.5624902844429016,
-0.4981139302253723,
0.058757226914167404,
0.1600789576768875,
...],
[-0.66383957862854,
-0.2313556671142578,
-0.2595861554145813,
-0.06100668013095856,
-0.6925454139709473,
-0.22522060573101044,
-0.035429272800683975,
-0.04449533298611641,
0.39814653992652893,
0.13439606130123138,
0.29754704236984253,
-0.238642156124115,
0.25147610902786255,
-0.32628288865089417,
-0.49216407537460327,
-0.40720444917678833,
-0.6613724827766418,
-0.3219824731349945,
-0.5070877075195312,
-0.024057071655988693,
0.38390594720840454,
0.4274079203605652,
-1.2975172996520996,
-0.46902188658714294,
-0.35251280665397644,
0.3329623341560364,
0.05530993267893791,
0.22719600796699524,
0.8056514859199524,
0.8747472167015076,
0.03323102369904518,
0.39306214451789856,
0.16607530415058136,
-0.846079409122467,
-0.12165623903274536,
-0.6517881155014038,
-2.3414584575220942e-05,
0.14633579552173615,
-0.825664222240448,
-0.4183889329433441,
0.1627465784549713,
-0.7571935653686523,
0.0036316709592938423,
-0.4105145335197449,
-1.0966694355010986,
-0.41880688071250916,
0.1567099541425705,
-0.7302873730659485,
0.5174612998962402,
-0.8508439064025879,
0.10142526030540466,
-0.2843800485134125,
0.32579779624938965,
0.18766894936561584,
0.0704789087176323,
-0.1186482161283493,
0.30121684074401855,
0.1028139516711235,
-1.063417911529541,
0.4732326865196228,
0.6511643528938293,
-0.10245297849178314,
0.3198312222957611,
-0.6911914348602295,
-0.3321545720100403,
0.4627225399017334,
-0.12581969797611237,
0.4968282878398895,
0.2776549458503723,
0.05307720974087715,
0.10920432209968567,
-0.40448153018951416,
-0.059818610548973083,
-0.04125083237886429,
-0.24878741800785065,
0.02488279901444912,
-0.5569456219673157,
-0.22246843576431274,
-0.29153338074684143,
0.1343427449464798,
-0.1262163370847702,
-0.17975224554538727,
0.3224595785140991,
0.039348285645246506,
-0.4701169431209564,
0.07212565839290619,
-0.3677715063095093,
0.37830060720443726,
0.3132310211658478,
0.2310069352388382,
-0.2397177368402481,
0.7962530255317688,
-0.20806986093521118,
0.07299618422985077,
0.4896806478500366,
0.7884756326675415,
-0.031209291890263557,
0.05247776210308075,
-0.5274895429611206,
-0.11336683481931686,
0.22027435898780823,
0.6983976364135742,
0.053230199962854385,
0.9547304511070251,
-0.23651228845119476,
0.10277893394231796,
0.014033998362720013,
1.041684865951538,
-0.31462642550468445,
-0.6297675967216492,
0.36212003231048584,
-0.012141757644712925,
-0.021185457706451416,
0.4515077769756317,
-0.3030897080898285,
0.7325507998466492,
-0.4467439651489258,
0.5766064524650574,
-0.769917368888855,
-0.13879376649856567,
-0.15103241801261902,
0.40279167890548706,
0.38021376729011536,
-0.4165734052658081,
-0.05714404955506325,
-0.38282668590545654,
-0.49606284499168396,
0.7269167304039001,
-0.6417250037193298,
0.2031887024641037,
-0.49722495675086975,
-0.3438809812068939,
0.8003844022750854,
0.2577022612094879,
0.3948556184768677,
0.9283068776130676,
-0.2774761915206909,
0.9557852149009705,
0.1972631812095642,
-0.3428194522857666,
0.3247833847999573,
0.6235134601593018,
0.24010451138019562,
1.3323333263397217,
0.11255193501710892,
0.7475976347923279,
-0.04500462859869003,
0.0031878864392638206,
-0.43377748131752014,
0.5427476167678833,
0.30915892124176025,
0.06339199095964432,
-0.28885963559150696,
0.8270829916000366,
-0.15219268202781677,
0.3253883123397827,
0.4335705041885376,
-0.07575776427984238,
0.506062924861908,
0.22491300106048584,
0.12009810656309128,
0.5963507294654846,
-0.6599342823028564,
0.8246259093284607,
-0.11227074265480042,
0.31016668677330017,
-0.5566144585609436,
-0.04739649221301079,
-0.28963443636894226,
0.16926006972789764,
0.04322681203484535,
0.6518950462341309,
-0.02876073122024536,
0.15316806733608246,
0.12932568788528442,
0.8276455402374268,
0.4568895697593689,
-0.15531013906002045,
0.945992112159729,
0.3896466791629791,
-0.12119919806718826,
0.5152679681777954,
0.6301158666610718,
1.1760205030441284,
0.03376719355583191,
-0.0809011310338974,
0.2313305288553238,
-0.009871753863990307,
-0.601636528968811,
-0.1795131117105484,
0.1304136961698532,
0.5048069953918457,
-0.06729011982679367,
-0.3121969997882843,
-0.29310178756713867,
0.3514418601989746,
-1.1271324157714844,
-0.09299957752227783,
-0.7083450555801392,
-0.8204821348190308,
-0.42331191897392273,
-0.04339401796460152,
-0.5787737965583801,
0.8930289149284363,
0.36572974920272827,
-0.7476776242256165,
0.5567910075187683,
1.7977360486984253,
-0.02189374901354313,
0.7785289883613586,
0.43605461716651917,
1.3746691942214966,
-0.6201463937759399,
0.1897742599248886,
0.5282841920852661,
-0.32129576802253723,
0.07059669494628906,
1.0405555963516235,
-0.7393519282341003,
0.4615570604801178,
-0.11006764322519302,
0.5464887022972107,
0.5049405097961426,
0.707616925239563,
-0.5412596464157104,
-0.14146843552589417,
0.0989818125963211,
0.9178425669670105,
0.07597102969884872,
0.20396646857261658,
0.02221265435218811,
0.31986862421035767,
-0.10685097426176071,
0.22032785415649414,
0.8232126235961914,
0.14689558744430542,
0.7107570171356201,
0.3264351785182953,
0.5185019373893738,
0.0013305929023772478,
0.18264140188694,
0.37187331914901733,
0.5390960574150085,
-0.13465994596481323,
-0.7617212533950806,
-0.1916431337594986,
-0.16727127134799957,
0.6731497645378113,
-0.7767329812049866,
0.6193000078201294,
-0.42698243260383606,
0.3654089570045471,
0.6835520267486572,
0.395896852016449,
-0.7649313807487488,
-0.42238858342170715,
0.8192903399467468,
0.7838611006736755,
-0.0721166655421257,
-0.5067527294158936,
0.29517635703086853,
-0.36073851585388184,
0.40435370802879333,
0.5425378680229187,
-0.22622635960578918,
0.8533711433410645,
-0.003657616674900055,
0.1506732553243637,
-0.4110838770866394,
-1.0123159885406494,
-0.09841310232877731,
-0.6191126108169556,
-0.786047637462616,
-0.023185061290860176,
-0.16664241254329681,
-0.7477964758872986,
-0.1311689019203186,
-0.04727170243859291,
0.7601009011268616,
-0.21691539883613586,
0.2879783809185028,
-0.5148252844810486,
-0.9074329733848572,
0.015700897201895714,
0.019970141351222992,
1.2790656089782715,
-0.7192351818084717,
0.633094072341919,
-0.2613338828086853,
0.5991172194480896,
-0.5007964968681335,
-0.23982669413089752,
-0.07967814058065414,
-0.6458929777145386,
-0.07101744413375854,
-0.02982148714363575,
-0.15407350659370422,
0.40034782886505127,
-0.32107964158058167,
-0.6922317743301392,
-0.09478769451379776,
0.33118054270744324,
-0.5922290086746216,
-0.2315683513879776,
-0.3633510172367096,
0.9553167223930359,
0.15411309897899628,
-0.17744380235671997,
1.2446421384811401,
0.39525559544563293,
-1.189293384552002,
0.439408540725708,
0.30721813440322876,
0.5662364959716797,
-0.6927391886711121,
-0.26919615268707275,
0.2464495450258255,
0.12598511576652527,
-1.2246264219284058,
-0.23698285222053528,
0.07862170785665512,
0.17724956572055817,
-0.26024624705314636,
-0.7359688878059387,
0.11084423959255219,
0.5328563451766968,
0.025927213951945305,
-1.183160424232483,
0.3631088435649872,
-0.8191152215003967,
-0.755239725112915,
-0.4995143711566925,
-0.06928092241287231,
0.9806907773017883,
0.4832023084163666,
0.2266155183315277,
0.17297831177711487,
0.23857860267162323,
0.7700474262237549,
-0.5227215886116028,
1.5237351655960083,
-1.0372787714004517,
0.42848527431488037,
0.6967135667800903,
-0.5061274170875549,
-0.028543030843138695,
0.6125296354293823,
0.11877332627773285,
-0.24795833230018616,
0.5738652348518372,
0.03585290536284447,
-0.08751246333122253,
0.5911476016044617,
0.14302462339401245,
0.3904249668121338,
-0.08441024273633957,
-0.12650245428085327,
0.04551529139280319,
0.46586257219314575,
0.3084683418273926,
0.2561204433441162,
-0.2515110373497009,
-0.16502408683300018,
0.03153965622186661,
0.1740194708108902,
-0.8661266565322876,
0.3422711491584778,
0.5051333904266357,
-0.29426029324531555,
-1.596143364906311,
0.4108634293079376,
-0.2926933467388153,
-0.6348920464515686,
0.30726951360702515,
-0.17813639342784882,
0.1929423063993454,
0.8914364576339722,
0.12266840040683746,
0.576617419719696,
-1.2714109420776367,
-0.028853025287389755,
-0.549541711807251,
0.19571059942245483,
0.41401880979537964,
0.17110785841941833,
0.41904062032699585,
0.29501330852508545,
0.5240954756736755,
-0.77303546667099,
-0.4904113709926605,
-0.5939957499504089,
-0.11172720044851303,
0.8538534045219421,
-0.20046530663967133,
-0.7861432433128357,
-0.4543113112449646,
1.0110828876495361,
-0.003347388468682766,
0.5784980654716492,
-0.4305913746356964,
0.7264584898948669,
0.7619367241859436,
0.8248848915100098,
0.24710723757743835,
-0.4174598753452301,
-0.5849774479866028,
-0.08136039227247238,
0.6947451233863831,
0.6091447472572327,
-0.2596603035926819,
-0.5273916125297546,
0.02512296661734581,
-0.2914501130580902,
-0.340916246175766,
0.3925054371356964,
0.264009565114975,
-0.5922141671180725,
-0.1410948485136032,
0.3549291789531708,
0.7957888841629028,
-0.49344921112060547,
-0.10658832639455795,
-0.14459018409252167,
0.8777123689651489,
0.5201388001441956,
-0.6812755465507507,
-0.4125320315361023,
-0.5169220566749573,
0.9127803444862366,
0.12648075819015503,
0.15197505056858063,
-0.17171065509319305,
-0.5145682096481323,
-0.3144108057022095,
0.25576066970825195,
-0.2729228138923645,
0.43763890862464905,
-0.6974268555641174,
0.05586937069892883,
-0.3896856904029846,
0.35386428236961365,
0.1315007507801056,
-0.39295321702957153,
-0.18069300055503845,
0.26811668276786804,
0.3929719924926758,
0.44114425778388977,
0.47795361280441284,
-0.8011078238487244,
-0.301805317401886,
0.47754961252212524,
-0.9720356464385986,
1.0676907300949097,
-0.29112306237220764,
0.2620666027069092,
-0.2559487521648407,
-0.30174437165260315,
0.020500365644693375,
0.37328124046325684,
-0.6434176564216614,
-0.3961181342601776,
-0.1455620676279068,
1.1312304735183716,
-0.35954615473747253,
-0.7734612226486206,
0.9958603382110596,
-0.3421874940395355,
-0.3012723922729492,
-0.18579894304275513,
0.13212817907333374,
0.4657566249370575,
-0.16543884575366974,
-0.02276868373155594,
0.15026947855949402,
0.29083219170570374,
-0.9812489151954651,
-0.3071942627429962,
-0.41813355684280396,
-0.8969392776489258,
0.4203145503997803,
-0.24708013236522675,
-0.8105489015579224,
0.19139695167541504,
-0.6527240872383118,
-0.17958854138851166,
-1.3926584720611572,
-0.2781815528869629,
0.11016010493040085,
-0.16614437103271484,
-0.355233371257782,
0.3178675174713135,
0.3770565688610077,
0.877945601940155,
-0.7948293685913086,
0.05235274136066437,
-0.4885311722755432,
-0.25346195697784424,
-0.4479544758796692,
0.45200014114379883,
0.5162225365638733,
0.40498116612434387,
-0.6774299740791321,
-0.4202435612678528,
-0.29834842681884766,
0.08582589030265808,
-0.7950501441955566,
-0.7950786352157593,
0.05144018307328224,
-0.1953907012939453,
0.4306655526161194,
-0.14445535838603973,
0.44681674242019653,
0.1289193481206894,
0.2624998092651367,
0.6209694147109985,
0.6485058665275574,
0.3436071276664734,
-0.17081555724143982,
-0.24998722970485687,
0.8819694519042969,
0.1914956271648407,
-0.39287418127059937,
0.47309058904647827,
0.9233711957931519,
-0.06572650372982025,
0.5558550357818604,
0.803342342376709,
0.1837519109249115,
-0.582427442073822,
-1.229834794998169,
-0.5020425915718079,
-0.395750492811203,
-1.030993938446045,
-1.0110739469528198,
0.10828382521867752,
-0.6424391269683838,
0.3970054090023041,
0.404026061296463,
-0.343421071767807,
-0.19432324171066284,
-1.0158581733703613,
0.6382966637611389,
0.009547857567667961,
-0.16880100965499878,
-0.42210349440574646,
0.08941852301359177,
0.49443307518959045,
0.6834864020347595,
0.030288998037576675,
0.4022229015827179,
-0.027738414704799652,
0.5054395198822021,
0.5111376047134399,
-0.18553893268108368,
-0.8887874484062195,
-0.6932130455970764,
0.2818927466869354,
-0.5914751887321472,
-0.15466520190238953,
0.020885543897747993,
-0.3394120931625366,
0.7122368812561035,
-0.8371968865394592,
-0.7580953240394592,
0.21631324291229248,
-0.3214702010154724,
0.10291893780231476,
-0.1894383281469345,
0.552446186542511,
-0.1661849468946457,
-0.28603285551071167,
-0.3890632390975952,
0.8714359998703003,
0.9080734848976135,
0.06310735642910004,
-0.6783433556556702,
-0.467898428440094,
-0.8733784556388855,
-0.8396478295326233,
0.4398952126502991,
-0.15299327671527863,
-0.48063158988952637,
-0.3609691858291626,
-0.11896490305662155,
0.6504183411598206,
-0.5323073267936707,
0.5937050580978394,
1.3630650043487549,
-1.1628384590148926,
-0.1730543076992035,
0.10342907905578613,
-0.03286043554544449,
0.2443077713251114,
-0.13159123063087463,
0.25179243087768555,
-0.41535839438438416,
-0.24177208542823792,
-0.12448311597108841,
-0.8177970051765442,
-1.1557691097259521,
-1.055833101272583,
0.47295454144477844,
1.278720736503601,
-0.0421457402408123,
1.6001085042953491,
-0.3118591904640198,
-0.501964271068573,
-0.7178589105606079,
0.354057639837265,
0.3875657320022583,
0.2917666733264923,
0.9190394878387451,
0.1699265092611313,
0.34634047746658325,
0.3619774878025055,
0.2515784502029419,
-0.1314840018749237,
0.1969815492630005,
0.21605370938777924,
-0.29424285888671875,
-0.25702616572380066,
0.4314003884792328,
0.9353189468383789,
-1.2694830894470215,
-0.703385055065155,
-0.29298868775367737,
-0.03961457684636116,
-0.6804059147834778,
-0.938069224357605,
0.25681132078170776,
0.34114837646484375,
0.06630713492631912,
-0.20925447344779968,
0.06135372817516327,
-0.0292774997651577,
0.9683889150619507,
-0.1415303349494934,
0.13003411889076233,
-0.28229838609695435,
-0.05650933459401131,
0.6027146577835083,
-0.8527910113334656,
0.8387891054153442,
-1.0144500732421875,
-0.13234733045101166,
0.0887543186545372,
0.2335500866174698,
0.5318927764892578,
0.4429142475128174,
0.4202386736869812,
0.7799946665763855,
-0.2124268263578415,
0.7880118489265442,
0.18811221420764923,
-0.7036977410316467,
0.5910786986351013,
-0.41202467679977417,
-0.8821630477905273,
-0.47416970133781433,
0.33798083662986755,
-0.27297067642211914,
-0.43055376410484314,
-0.6825740933418274,
-0.6926524639129639,
0.8055598139762878,
0.08102894574403763,
-0.4228541851043701,
0.16037718951702118,
-0.15351197123527527,
-0.6214717626571655,
-0.690116286277771,
-0.6669543981552124,
-0.026535583660006523,
-0.3141920864582062,
-0.21991942822933197,
0.08367064595222473,
-0.2654389441013336,
-0.4487183392047882,
0.9583780169487,
0.016767973080277443,
1.1328634023666382,
-0.3838687837123871,
0.7252568602561951,
-0.48928102850914,
-0.8009410500526428,
-0.48309576511383057,
0.38519877195358276,
-0.1801932007074356,
-0.29743966460227966,
-0.004791876766830683,
-0.12718240916728973,
-0.29024428129196167,
0.6991103887557983,
-0.35262465476989746,
0.09094825387001038,
-0.19963504374027252,
-0.00040172284934669733,
0.4298400282859802,
0.2996506989002228,
0.3386493921279907,
0.7650848031044006,
1.060438871383667,
-0.2835727632045746,
0.33754032850265503,
-0.5697928071022034,
-0.11919137090444565,
-0.9314565062522888,
0.3563353717327118,
0.2549656331539154,
0.2109297662973404,
-0.456595778465271,
-0.9328431487083435,
0.016648896038532257,
-0.8451475501060486,
0.5809212923049927,
-0.340518057346344,
0.2827947437763214,
-0.5396698117256165,
-0.6092702746391296,
-0.3723966181278229,
0.6414639949798584,
0.3107134699821472,
-0.007445123046636581,
0.08267766237258911,
0.12798859179019928,
-0.2169492542743683,
-0.559959888458252,
-0.5217579007148743,
0.32909470796585083,
0.7389576435089111,
-0.293349027633667,
-0.6930976510047913,
0.7821656465530396,
-0.47307252883911133,
0.2648174464702606,
-0.2046925574541092,
-0.6862270832061768,
-0.6999277472496033,
-0.4833206534385681,
0.15186196565628052,
0.42044275999069214,
0.4899252653121948,
-0.06878598779439926,
0.564720630645752,
-0.36390984058380127,
-0.8453814387321472,
0.24788610637187958,
-0.7377864122390747,
-0.5077601075172424,
0.06311396509408951,
0.07020704448223114,
0.2193564623594284,
0.08405278623104095,
-1.1775742769241333,
0.0170441847294569,
0.029659995809197426,
0.3503907322883606,
0.8535836338996887,
1.0153495073318481,
-0.008833479136228561,
0.11853634566068649,
0.09241313487291336,
0.49566444754600525,
0.02248520776629448,
0.7640588879585266,
0.03735516965389252,
-1.245429515838623,
0.6849268674850464,
0.12653540074825287,
0.4803661108016968,
0.13430093228816986,
0.07683700323104858,
0.3195377588272095,
-0.2754036784172058,
-0.4229964315891266,
0.894875168800354,
-0.5222072005271912,
-0.1649344265460968,
0.08378858864307404,
-0.29044657945632935,
0.8531003594398499,
-0.31961607933044434,
0.12797744572162628,
0.09183473885059357,
-0.6410958766937256,
-0.43033653497695923,
0.783586859703064,
1.0653300285339355,
0.09725117683410645,
0.17577630281448364,
0.4870966076850891,
0.22959446907043457,
0.12173732370138168,
-0.9747971296310425,
-0.38040193915367126,
0.5408453345298767,
0.3166840672492981,
0.32348302006721497,
0.008488880470395088,
0.5037934184074402,
0.8255049586296082,
-0.37979429960250854,
-0.07706710696220398,
0.7456242442131042,
0.1814427226781845,
0.11373350769281387,
0.17987558245658875,
-0.25761252641677856,
0.3755275309085846,
-0.22634661197662354,
-0.5077285170555115,
0.020015455782413483,
-0.49857011437416077,
0.12688034772872925,
0.5388888716697693,
-0.09130289405584335,
1.0542702674865723,
-0.33117565512657166,
-0.03726742044091225,
-0.9425621032714844,
-0.0979095920920372,
0.19087322056293488,
0.1530478298664093,
0.03234371542930603,
0.1964159458875656,
0.9765700101852417,
0.15222042798995972,
-0.2460227906703949,
0.17485255002975464,
0.7682655453681946,
-0.0398302860558033,
-0.8013843297958374,
-0.1274305135011673,
0.26694756746292114,
0.16433237493038177,
-0.7932276129722595,
-0.7979598045349121,
-1.3931635618209839,
-0.012929664924740791,
-0.8024943470954895,
-0.23012343049049377,
-0.14787796139717102,
-1.3017325401306152,
-0.325692743062973,
-1.2839562892913818,
0.2757335603237152,
-0.2428918182849884,
0.381331205368042,
0.610768735408783,
0.23639538884162903,
0.22997033596038818,
1.157219409942627,
-0.10786467045545578,
0.7831969857215881,
0.7697864770889282,
0.5605380535125732,
-0.026723943650722504,
0.45519131422042847,
0.2872438430786133,
-0.4689868688583374,
-0.09962508827447891,
0.05298158526420593,
-0.05050082504749298,
-0.30865341424942017,
-0.4508135914802551,
-0.8230398893356323,
0.7545114755630493,
0.08302313089370728,
0.15095211565494537,
-0.007315643131732941,
0.35005661845207214,
-0.027802370488643646,
-0.7999009490013123,
-0.18309427797794342,
-0.32965219020843506,
-0.716147243976593,
0.35231006145477295,
0.31334054470062256,
0.9026334285736084,
0.44286203384399414,
-0.06066688150167465,
-0.49386537075042725,
-0.571142852306366,
-0.42108890414237976,
-0.8826929926872253,
0.5461695194244385,
-0.8487135767936707,
-0.5901421904563904,
-0.6019299626350403,
-0.032040100544691086,
-0.457055926322937,
0.4428011476993561,
-0.8541960716247559,
-0.32525351643562317,
0.7125647664070129,
0.45189979672431946,
-0.25928154587745667,
-0.17774581909179688,
-0.26920250058174133,
0.08924514800310135,
0.9944015145301819,
0.7593095302581787,
-0.25938305258750916,
0.3242359459400177,
-0.34961849451065063,
-0.47478827834129333,
-0.06921988725662231,
-0.7078092694282532,
0.7564664483070374,
-0.5934049487113953,
-0.5741901993751526,
-0.44621846079826355,
-0.2329241782426834,
0.06570033729076385,
-0.8043128848075867,
0.3082607686519623,
0.07662681490182877,
0.7903819680213928,
-0.8488594889640808,
-0.9291868209838867,
0.16850176453590393,
-0.2045775055885315,
-0.41875341534614563,
0.05377103015780449,
0.9302248954772949,
0.1590145081281662,
0.21007277071475983,
-0.2307853251695633,
-0.7894681692123413,
4.072210788726807,
1.0314375162124634,
0.7413455843925476,
0.2175021767616272,
0.0460495725274086,
0.7578788995742798,
0.09630119055509567,
0.23811012506484985,
-0.36347854137420654,
-0.2232029289007187,
0.02932274155318737,
0.564838171005249,
0.22863909602165222,
0.12459971755743027,
0.0018232904840260744,
0.8779709935188293,
-0.9465978741645813,
-0.7080463767051697,
0.13964389264583588,
-0.980272114276886,
-0.7497457265853882,
-0.3013603687286377,
0.00335038173943758,
0.46313101053237915,
-0.441183865070343,
-0.3438478708267212,
0.22290784120559692,
-0.4461698830127716,
-0.4505060613155365,
-0.5350180864334106,
0.24498435854911804,
-0.8108664751052856,
-0.37081730365753174,
-0.3678787350654602,
-0.9506158828735352,
0.4547770917415619,
0.2541368305683136,
0.20375360548496246,
-0.5119951367378235,
-0.11197996139526367,
-0.6023352146148682,
-0.11465101689100266,
0.9323827624320984,
-0.4218308925628662,
0.025832125917077065,
0.1128021776676178,
-0.7623777389526367,
0.21882113814353943,
-0.1399582177400589,
-0.9036707878112793,
0.7563123106956482,
-0.7850674986839294,
0.2391638159751892,
-0.22955968976020813,
-1.3679088354110718,
0.316941499710083,
0.4251406788825989,
-0.3749549090862274,
0.13650032877922058,
0.2597576379776001,
0.19974054396152496,
-0.32662948966026306,
-0.2621956765651703,
0.3228282332420349,
-0.4554971754550934,
0.5398443937301636,
1.1019084453582764,
0.7593320608139038,
-0.5765718221664429,
-0.015286562032997608,
-0.2666643261909485,
...],
[0.33337298035621643,
0.02006004936993122,
0.29406389594078064,
0.22592930495738983,
-0.523647665977478,
0.01782163418829441,
1.0595035552978516,
0.5688751935958862,
0.1603807955980301,
0.5898828506469727,
0.3921133875846863,
-0.19194403290748596,
0.12333673238754272,
-0.21691292524337769,
-0.5172141790390015,
-0.40508586168289185,
-0.4508478343486786,
-0.3571659028530121,
-0.7934220433235168,
0.18969739973545074,
0.33381497859954834,
1.0246347188949585,
-1.4730311632156372,
-0.2654559016227722,
0.06955422461032867,
-0.022328363731503487,
-0.30525442957878113,
0.03018275834619999,
0.9212719798088074,
0.6960930824279785,
-0.7049258947372437,
0.15746530890464783,
-0.13638077676296234,
-0.9200529456138611,
-0.7241265773773193,
-0.3133358955383301,
-0.23478315770626068,
-0.5569650530815125,
-0.18596309423446655,
-0.8341456055641174,
0.6043726801872253,
-0.2477843463420868,
0.2233496606349945,
0.006388794630765915,
-0.7756876349449158,
-0.19135569036006927,
-0.15727661550045013,
-1.0014227628707886,
0.11967508494853973,
-0.6124666929244995,
0.10014550387859344,
-0.6715226173400879,
0.11013932526111603,
0.4542386531829834,
0.23326599597930908,
0.45659443736076355,
0.8691902160644531,
0.6686016321182251,
-0.15902860462665558,
0.6661834120750427,
-0.16782929003238678,
0.698865532875061,
-0.2955860495567322,
-1.092231035232544,
-0.015972834080457687,
-0.08321477472782135,
-0.3681206703186035,
-0.9722222089767456,
0.1314198225736618,
0.5400716066360474,
-0.17125047743320465,
0.17715705931186676,
-0.5123180747032166,
-0.6307958364486694,
-0.14410988986492157,
0.36386820673942566,
0.20329363644123077,
0.06463875621557236,
-0.045624300837516785,
0.2660903036594391,
0.25404325127601624,
0.778957724571228,
-0.18303298950195312,
0.2889940142631531,
-1.0060813426971436,
0.12667034566402435,
0.4112265706062317,
0.20197828114032745,
-0.07381415367126465,
0.15803305804729462,
-0.23140500485897064,
0.5384538769721985,
-0.42067664861679077,
0.2042783945798874,
0.5914250612258911,
0.2336941659450531,
-0.011780805885791779,
0.4578266739845276,
-0.11033887416124344,
-0.34844693541526794,
0.5218288898468018,
0.39677658677101135,
-0.08914858102798462,
0.7628657221794128,
-0.7942704558372498,
-0.417886883020401,
0.27624455094337463,
0.32194775342941284,
-0.9515729546546936,
-0.42862173914909363,
0.6025353670120239,
-0.01767631061375141,
0.7204714417457581,
0.589661717414856,
0.19199535250663757,
0.5165079832077026,
0.4547382593154907,
1.0152316093444824,
-0.9116500616073608,
-0.33246293663978577,
-0.12730614840984344,
0.4682310223579407,
0.14057376980781555,
0.5323357582092285,
-0.11350321024656296,
-0.4165663719177246,
-0.27480968832969666,
0.4843340814113617,
-0.2552838921546936,
0.027400460094213486,
-0.10291912406682968,
-0.3142092227935791,
0.45550480484962463,
0.6906976699829102,
0.38145995140075684,
0.013644739054143429,
-0.24501881003379822,
1.0659372806549072,
-0.19132722914218903,
-0.4634144902229309,
0.502338171005249,
0.2830981910228729,
0.23843777179718018,
1.2106139659881592,
0.4136737287044525,
0.2081451267004013,
-0.29765385389328003,
-0.022599218413233757,
-0.6633609533309937,
0.16462424397468567,
-0.2663154602050781,
0.40329116582870483,
-0.17215271294116974,
0.575140655040741,
-0.23595356941223145,
-0.0679195374250412,
0.19809095561504364,
-0.2017083764076233,
0.703376054763794,
-0.208828866481781,
-0.7117382287979126,
-0.2612796127796173,
-0.6522277593612671,
0.19085578620433807,
-0.21375998854637146,
1.1422935724258423,
-0.5978577136993408,
0.22074031829833984,
0.47781744599342346,
0.03307531401515007,
0.04792780056595802,
0.22786223888397217,
-0.08965915441513062,
-0.07457009702920914,
0.46671831607818604,
1.1231400966644287,
0.17039281129837036,
-0.4739528298377991,
0.840653657913208,
0.3046075105667114,
-0.23856320977210999,
0.09542325139045715,
0.2717638611793518,
1.0638378858566284,
0.12824612855911255,
0.29804855585098267,
0.2497713565826416,
-0.009643753059208393,
-0.4064204692840576,
-0.5258654952049255,
-0.3149794638156891,
0.6216298341751099,
-0.6467192769050598,
0.7529037594795227,
-0.49123141169548035,
0.36221134662628174,
-0.2963949143886566,
-0.3134544789791107,
-0.5826051235198975,
-0.9187191128730774,
-0.05792100727558136,
0.7655676007270813,
-0.3502368927001953,
0.06841688603162766,
-0.13598032295703888,
-0.6753174662590027,
0.6113227009773254,
1.1845800876617432,
-0.11031842976808548,
0.9098318219184875,
0.5527685284614563,
0.07846181839704514,
-0.9813363552093506,
0.03474795073270798,
-0.19674032926559448,
0.2612990736961365,
0.026111222803592682,
1.3598994016647339,
-0.5694597363471985,
-0.01169208437204361,
-0.06168972700834274,
0.5088055729866028,
0.27369225025177,
0.8039237856864929,
0.4718610644340515,
-0.6337075233459473,
0.24838368594646454,
1.4119703769683838,
0.09402940422296524,
0.192125141620636,
-0.21149837970733643,
0.47530317306518555,
0.47054359316825867,
1.0105408430099487,
0.8663490414619446,
0.17772014439105988,
1.0881112813949585,
0.800692617893219,
-0.8736886382102966,
0.4604488015174866,
-0.06111627444624901,
-0.013670648448169231,
0.1469733864068985,
-0.3231627941131592,
0.2870139479637146,
0.3730476200580597,
-0.12815532088279724,
0.5387733578681946,
-0.3937036991119385,
0.3282574415206909,
0.20119847357273102,
0.18447081744670868,
0.5136070847511292,
0.4204138219356537,
-1.2623183727264404,
-0.03627987578511238,
-0.29203176498413086,
0.4513552188873291,
-0.020403075963258743,
-0.9387991428375244,
0.5027630925178528,
0.09852858632802963,
0.05215165764093399,
0.02853984758257866,
0.6953203082084656,
0.6391677260398865,
-0.16501042246818542,
0.75384920835495,
-0.3739304542541504,
-0.4510989189147949,
-0.23435468971729279,
-0.6683436036109924,
-0.4364356994628906,
-0.5166194438934326,
-0.6888208389282227,
-0.3339124321937561,
0.8124140501022339,
-0.3124043643474579,
-0.007011388894170523,
0.10305935889482498,
-0.33510252833366394,
-0.5807340145111084,
-1.103222370147705,
0.37464216351509094,
-0.07387460768222809,
0.5051655173301697,
-0.40233567357063293,
-0.23438723385334015,
0.48371580243110657,
0.9854409694671631,
-0.6379954218864441,
-0.8572129011154175,
0.3165505528450012,
-0.12044452130794525,
0.09641540795564651,
-0.09533822536468506,
-0.1602795571088791,
0.047207776457071304,
-0.4326007664203644,
-1.0536208152770996,
0.8120434880256653,
0.4786711037158966,
-0.5882609486579895,
-0.1819901019334793,
-0.45424696803092957,
0.8017213940620422,
0.11142898350954056,
-0.5334643125534058,
0.4755026400089264,
0.8635997176170349,
-0.8725877404212952,
0.16500402987003326,
0.4843764901161194,
0.375041127204895,
-0.7822120785713196,
0.2849026620388031,
-0.0545157715678215,
0.4773695170879364,
-1.026876449584961,
0.1688643991947174,
-0.40855520963668823,
-0.25200167298316956,
-0.2483212649822235,
0.1072358638048172,
-0.5030602216720581,
0.7955505847930908,
0.5659346580505371,
-1.4127376079559326,
0.2981058359146118,
-0.6198479533195496,
-0.5340158939361572,
0.027016988024115562,
-0.10495337098836899,
0.7541730999946594,
-0.37054139375686646,
-0.21316440403461456,
0.5282447934150696,
-0.21311892569065094,
0.6581853628158569,
-0.11338408291339874,
1.4720278978347778,
-0.4457148611545563,
0.29888108372688293,
0.3874196410179138,
0.8064010739326477,
0.1078956201672554,
0.36585867404937744,
-0.18932294845581055,
0.17212094366550446,
0.5691714286804199,
0.1172683984041214,
-0.07920059561729431,
0.01207203883677721,
-0.4906538426876068,
-0.5533738732337952,
0.1900777667760849,
-0.5938198566436768,
0.05791061371564865,
0.529826283454895,
-0.058250825852155685,
0.8037002086639404,
0.2171137034893036,
0.06018542870879173,
-0.42023923993110657,
0.40969744324684143,
-0.4719778299331665,
-0.046741679310798645,
-0.05339540168642998,
-0.1618456393480301,
-0.7888380289077759,
1.0306456089019775,
-0.2553476393222809,
-0.4968341886997223,
0.12717145681381226,
0.47304674983024597,
-0.23739096522331238,
0.6066562533378601,
0.2889617681503296,
0.2079630047082901,
-0.7067514657974243,
0.17450673878192902,
0.5637731552124023,
1.019129991531372,
-0.28278258442878723,
0.5833974480628967,
0.5789215564727783,
-0.14316393435001373,
-0.17400890588760376,
-0.869565486907959,
-0.2673444449901581,
-0.799062967300415,
0.34934860467910767,
0.3961751461029053,
0.022633258253335953,
-1.4608420133590698,
-0.8705185055732727,
0.3428339958190918,
0.4061702787876129,
0.6089838743209839,
-0.5418933629989624,
0.6915159225463867,
1.154362678527832,
0.4530835449695587,
0.9654828310012817,
0.3842657506465912,
0.14391981065273285,
-0.5368731021881104,
0.2777368426322937,
0.23602232336997986,
-0.8527593612670898,
-0.7937656044960022,
-0.5162080526351929,
-0.4528389573097229,
0.18370385468006134,
0.6006118655204773,
0.2790478467941284,
-0.8608324527740479,
-0.29005110263824463,
-0.2544880509376526,
0.1620083600282669,
-0.6014496088027954,
-0.03847014158964157,
-0.6235532760620117,
0.5749123096466064,
0.25629138946533203,
-1.0107581615447998,
0.25732943415641785,
-0.9812096953392029,
0.48953700065612793,
0.43293046951293945,
0.24938367307186127,
-0.41339924931526184,
-0.47098976373672485,
-0.04142199829220772,
-0.1850498467683792,
0.203985795378685,
0.12312035262584686,
0.331148236989975,
0.6974695324897766,
-1.119771957397461,
0.6848002672195435,
0.5144025683403015,
0.16741561889648438,
0.33643102645874023,
0.47946038842201233,
0.21024130284786224,
0.3091551959514618,
0.7789376378059387,
-0.80717933177948,
-0.3515343964099884,
0.20816831290721893,
-1.1832785606384277,
0.32957813143730164,
-0.6137903332710266,
0.29530778527259827,
-0.1956826150417328,
-0.858967661857605,
0.21364042162895203,
0.5025348663330078,
-0.8412559032440186,
-0.37321245670318604,
-0.12380901724100113,
0.19590704143047333,
-0.3227238953113556,
-0.4664977490901947,
1.2543898820877075,
0.4810763895511627,
-0.4362419545650482,
0.6109074950218201,
0.4369519054889679,
-0.16665898263454437,
0.15172532200813293,
0.19131337106227875,
-0.4149361848831177,
0.23100414872169495,
-0.8373755812644958,
0.32446107268333435,
-0.31461361050605774,
-0.6101260781288147,
1.097629189491272,
-0.12076549977064133,
0.19591975212097168,
-0.33004486560821533,
-0.5569248795509338,
-0.16055253148078918,
-1.1408393383026123,
-0.4026479721069336,
0.38586753606796265,
-0.07469676434993744,
0.3253757059574127,
-0.4475138783454895,
0.14933137595653534,
0.20228543877601624,
-0.32332006096839905,
-0.22193846106529236,
-0.49372151494026184,
-0.47194990515708923,
0.7426949143409729,
0.20321024954319,
-0.06921922415494919,
0.6166821718215942,
-0.42217525839805603,
-0.6130588054656982,
0.2502304017543793,
0.27586495876312256,
-0.6323974132537842,
-0.4165205955505371,
-0.09528110176324844,
-0.38591331243515015,
-0.3825629651546478,
-0.05458390340209007,
0.36158621311187744,
-0.6488738656044006,
-0.33502787351608276,
-0.03957970067858696,
0.5453405976295471,
-0.523015558719635,
-0.4035367965698242,
-0.4531565010547638,
0.6744226813316345,
0.5671007037162781,
-1.2616639137268066,
0.3643752932548523,
0.11575832217931747,
-0.6785139441490173,
0.3379829525947571,
-0.09837386757135391,
-0.534118115901947,
-0.5068942308425903,
-0.3973032534122467,
-0.020721128210425377,
-0.6782963275909424,
-0.17098325490951538,
0.3800031542778015,
-0.23224514722824097,
-0.08875378221273422,
0.3050841689109802,
-0.44239193201065063,
0.2886126637458801,
-0.2797392010688782,
-0.48867833614349365,
0.07997419685125351,
-0.1064998134970665,
-0.6894057393074036,
-0.2610807716846466,
-0.08244015276432037,
0.725700855255127,
1.6280871629714966,
-0.34129852056503296,
-0.29829180240631104,
0.2138652354478836,
0.8792173266410828,
0.22503052651882172,
0.49973824620246887,
-0.08723818510770798,
-0.6351423859596252,
0.66599041223526,
-0.06931690126657486,
0.11845126748085022,
0.054412808269262314,
-0.2929384112358093,
0.06840210407972336,
-0.1983087807893753,
-0.12743064761161804,
-0.19372841715812683,
-0.8743732571601868,
-0.16913680732250214,
0.17443998157978058,
0.6963918805122375,
-0.4569453299045563,
-0.33058682084083557,
-0.5040510296821594,
0.4870394170284271,
1.013931393623352,
0.17772573232650757,
-0.859871506690979,
-0.6354172229766846,
-0.7394052147865295,
-1.0134317874908447,
0.21716497838497162,
-0.5441824197769165,
0.07656727731227875,
-0.8050359487533569,
-0.38746634125709534,
0.6108992695808411,
0.025348778814077377,
0.0554591529071331,
1.1192638874053955,
-0.46420106291770935,
-0.09360028058290482,
-0.8145939111709595,
0.5652071833610535,
0.5288896560668945,
-0.47737547755241394,
0.106320321559906,
-0.03591075912117958,
-1.0859755277633667,
0.14692366123199463,
-0.7618046402931213,
-0.8747251033782959,
-0.9018937945365906,
0.34619826078414917,
0.4967249631881714,
-0.3446800112724304,
0.6009508371353149,
-0.5040149092674255,
-0.2535114288330078,
-0.9940255880355835,
0.9777451157569885,
1.0061124563217163,
0.43243682384490967,
0.798133134841919,
-0.16374383866786957,
-0.09608769416809082,
0.8203686475753784,
-0.08175600320100784,
-1.0440312623977661,
0.0528155192732811,
1.4948172569274902,
-0.4558491110801697,
-0.9544349312782288,
0.9710138440132141,
0.7928891181945801,
-0.7367203235626221,
-0.3821394443511963,
0.5050479173660278,
-0.24570345878601074,
-0.5429352521896362,
-0.5734038949012756,
0.4032129943370819,
-0.09947071224451065,
-0.07196611166000366,
0.08138509094715118,
0.08501191437244415,
0.692768394947052,
0.516019880771637,
-0.23890283703804016,
-0.3930414319038391,
-0.32676461338996887,
-0.5023223757743835,
1.117282748222351,
-1.1511528491973877,
0.2514539361000061,
-0.4545832872390747,
0.14742887020111084,
0.5285033583641052,
0.04394351318478584,
1.0828551054000854,
-0.0893108919262886,
-0.16613946855068207,
0.02459716983139515,
-0.060437265783548355,
0.7265113592147827,
-0.04100891575217247,
-0.13135457038879395,
0.5610867738723755,
-0.46130144596099854,
-0.5634089112281799,
-0.3235207200050354,
0.2439909428358078,
-0.37141555547714233,
-0.22560814023017883,
-0.49496787786483765,
0.22981230914592743,
-0.28156283497810364,
0.6008853912353516,
-0.597093939781189,
-0.2577124536037445,
-0.6199463605880737,
-1.0368645191192627,
-0.4652043282985687,
-0.15111424028873444,
0.18776163458824158,
-0.4463488757610321,
0.6040583252906799,
-0.06638869643211365,
-0.34379249811172485,
0.35486629605293274,
0.551963210105896,
-0.06376373767852783,
0.6461917161941528,
-0.5193460583686829,
0.04135504737496376,
-0.4560208022594452,
-0.09819166362285614,
-0.5202165842056274,
0.3710121810436249,
-0.5888710021972656,
0.8580431938171387,
-0.11344252526760101,
0.3706965744495392,
0.032807596027851105,
0.5074489116668701,
0.3968987762928009,
0.4815812408924103,
0.07075202465057373,
-0.6092419624328613,
0.0931212455034256,
0.8402712345123291,
0.41422921419143677,
0.5295222997665405,
0.3915819525718689,
-0.03370828554034233,
0.1485697329044342,
-0.9483530521392822,
-0.5270420908927917,
-0.5873691439628601,
-0.12930329144001007,
0.12210045009851456,
-0.2616996765136719,
-0.9335662722587585,
-1.307065725326538,
-0.05007448419928551,
-0.5319976806640625,
0.10045923292636871,
-0.4464053809642792,
-0.33466365933418274,
-0.1945812702178955,
0.3344098925590515,
0.48698386549949646,
0.7741599678993225,
0.06624109297990799,
0.2849924862384796,
-0.02437439002096653,
0.34459421038627625,
0.48707157373428345,
-0.0011744890362024307,
-0.11979769170284271,
0.12876878678798676,
0.5217507481575012,
-0.5782056450843811,
-0.049100663512945175,
0.5967895984649658,
-0.32750576734542847,
1.295275092124939,
0.23809798061847687,
-0.8720280528068542,
-0.8907445669174194,
0.6736933588981628,
0.5673532485961914,
-0.04438159614801407,
0.35714101791381836,
-0.9200810194015503,
0.03122362680733204,
-0.6224260330200195,
-0.2492886185646057,
0.4913763701915741,
-0.9695414304733276,
-0.16624414920806885,
0.16488976776599884,
-0.5543433427810669,
-0.0014817871851846576,
-0.11340277642011642,
-0.7348063588142395,
-0.13255560398101807,
-0.5947654843330383,
0.6416608691215515,
0.11564739793539047,
0.5187666416168213,
0.13580633699893951,
-0.10638488084077835,
-0.4954569637775421,
-0.3444867730140686,
0.1501612365245819,
0.28334030508995056,
-0.18209415674209595,
-0.7256135940551758,
0.09097934514284134,
0.08745330572128296,
0.2728079557418823,
-0.7380597591400146,
-0.30025893449783325,
0.7116866707801819,
-0.4461795389652252,
-0.01990511454641819,
0.6194266080856323,
-0.18746225535869598,
0.2138487994670868,
-0.14399324357509613,
-0.5129393935203552,
0.7855989933013916,
-0.2378549575805664,
0.22164812684059143,
-0.37670761346817017,
-0.6745481491088867,
-0.5170747637748718,
0.46567031741142273,
1.0807216167449951,
0.9626607894897461,
0.14403720200061798,
0.0271042101085186,
0.44585588574409485,
-0.7525822520256042,
-0.793507993221283,
-0.4639089107513428,
0.3724289834499359,
0.6706063151359558,
0.007857647724449635,
0.07323038578033447,
0.08483569324016571,
0.7494832873344421,
-0.6630513668060303,
-0.6523663401603699,
0.22919443249702454,
-0.6444677114486694,
-0.20680606365203857,
0.31079399585723877,
0.16374602913856506,
0.8246950507164001,
0.24202780425548553,
-0.2570505440235138,
0.06788535416126251,
-0.7197138667106628,
-0.14464499056339264,
0.075093574821949,
-0.35472220182418823,
0.6398672461509705,
-1.0748943090438843,
0.5152992606163025,
-0.4245350956916809,
-0.5303300023078918,
-0.7421443462371826,
0.4181268811225891,
0.17719054222106934,
0.6649417877197266,
0.7067188024520874,
0.17166191339492798,
0.824521541595459,
0.22738133370876312,
0.07140923291444778,
0.4856291711330414,
-0.8680378794670105,
-0.9694925546646118,
-0.2650892734527588,
-0.2923256456851959,
-0.40910470485687256,
-0.791467547416687,
-0.9966763854026794,
0.35533055663108826,
0.28326791524887085,
-0.1573113203048706,
0.4080241918563843,
-0.6599385142326355,
-0.048158757388591766,
-0.8654828071594238,
0.7412445545196533,
-0.059746816754341125,
-0.2391999065876007,
1.013134241104126,
-0.2184017300605774,
0.32816949486732483,
0.8563316464424133,
-0.5475587844848633,
0.4314652979373932,
0.5650091171264648,
0.6654657125473022,
0.37515509128570557,
0.6548658013343811,
0.5707045197486877,
-0.5134177803993225,
-0.3254169523715973,
0.058681562542915344,
-0.014952561818063259,
-1.0734052658081055,
0.19492284953594208,
-0.41136619448661804,
-0.05579788610339165,
-0.42256245017051697,
0.038446128368377686,
-0.4254162907600403,
0.5091780424118042,
0.10499109327793121,
-0.7356489896774292,
-0.38812193274497986,
-0.11899396777153015,
-0.07734769582748413,
0.7848846912384033,
0.517977237701416,
0.9205548167228699,
0.6229963302612305,
0.554986298084259,
-0.4912668466567993,
0.22338858246803284,
0.4977974593639374,
-0.5370557308197021,
0.22506436705589294,
-0.36914753913879395,
-0.6461860537528992,
-0.05157399922609329,
-0.5574749708175659,
-0.1268477439880371,
-0.19992513954639435,
-0.3653377890586853,
-0.6331583261489868,
0.04171421006321907,
0.7474424242973328,
-0.010283359326422215,
0.31586945056915283,
-0.39855462312698364,
0.4816909730434418,
0.9028955698013306,
0.8125403523445129,
-0.8311466574668884,
0.4947796165943146,
0.08468551933765411,
-0.5357757210731506,
-0.20605307817459106,
-0.6768448948860168,
0.5313697457313538,
-0.22020414471626282,
0.21218667924404144,
-0.61190265417099,
-0.28624528646469116,
-0.2993525564670563,
-0.39397233724594116,
-0.5008349418640137,
0.7934759855270386,
0.25255754590034485,
-0.5300459265708923,
-0.8620027899742126,
-0.3550799489021301,
-0.5558770298957825,
-0.1285102367401123,
-0.4108595550060272,
0.8588772416114807,
0.6698674559593201,
0.02788524143397808,
0.6135531663894653,
-1.2352819442749023,
4.117743492126465,
0.5004256963729858,
0.8554301261901855,
-0.24860478937625885,
-0.09161481261253357,
0.5994160771369934,
-0.26748740673065186,
-0.08047442138195038,
-0.29965639114379883,
-0.8341971635818481,
0.08606543391942978,
0.024018365889787674,
0.22074256837368011,
0.04627253860235214,
0.0013079888885840774,
0.5470229387283325,
-0.22071290016174316,
-0.49633893370628357,
0.12132851779460907,
-0.29538801312446594,
-0.1026589497923851,
0.33525869250297546,
-0.0020568848121911287,
-0.06655574589967728,
0.10691098123788834,
-0.26251381635665894,
0.9879724979400635,
-0.39358532428741455,
-0.7269737124443054,
-0.30490443110466003,
-0.38031333684921265,
-0.30638155341148376,
-0.4956100881099701,
0.016653066501021385,
-0.9541082382202148,
0.40978488326072693,
0.1490773856639862,
0.06736554950475693,
-0.7975549101829529,
0.38396647572517395,
-0.3804899752140045,
0.06215175241231918,
0.8273525238037109,
-0.8432930707931519,
-0.05744561553001404,
0.24414527416229248,
-0.6568121910095215,
0.4030216932296753,
0.06649532914161682,
-0.47736960649490356,
0.8090847134590149,
-0.4633845388889313,
0.2599547207355499,
-0.9576112031936646,
-0.7422605156898499,
-0.02015363611280918,
0.20850639045238495,
-0.22161859273910522,
-0.36194825172424316,
0.2561335563659668,
-0.03479013219475746,
-0.35598382353782654,
-0.2267131507396698,
0.5062740445137024,
-0.8605638742446899,
0.3181823790073395,
0.5258446335792542,
-0.03991806507110596,
-0.6525282263755798,
0.28436800837516785,
-0.17757639288902283,
...]]
%% Cell type:markdown id: tags:
Now we define the `RouteLayer`. When called, the route layer will consume text (a query) and output the category (`Route`) it belongs to — to initialize a `RouteLayer` we need our `encoder` model and a list of `routes`.
%% Cell type:code id: tags:
``` python
from semantic_router.layer import RouteLayer
from semantic_router.routers import SemanticRouter
rl = RouteLayer(encoder=encoder, routes=routes)
rl = SemanticRouter(encoder=encoder, routes=routes, auto_sync="local")
```
%% Output
2024-04-14 20:02:32 INFO semantic_router.utils.logger local
%% Cell type:markdown id: tags:
We can check the dimensionality of our vectors by looking at the `index` attribute of the `RouteLayer`.
%% Cell type:code id: tags:
``` python
rl.index
```
%% Output
LocalIndex(index=array([[ 0.37762564, 0.37923592, 0.04006954, ..., 0.2910035 ,
0.14261879, -0.14989774],
[ 0.14489685, -0.47280183, -0.13473961, ..., -0.184137 ,
-0.44280073, -0.96940869],
[ 1.16709912, 0.38906148, 0.24399863, ..., 0.03619115,
-0.00167309, 0.50425595],
...,
[-0.64046752, 0.45156148, -0.27317011, ..., -0.64851284,
-0.10258984, 0.15441738],
[-0.11908327, 0.4233726 , -0.29102552, ..., -0.69622546,
0.27602831, 0.2030668 ],
[-0.06046702, -0.18556708, -0.45608515, ..., -0.86009502,
-0.01424424, -0.489003 ]]), routes=array(['politics', 'politics', 'politics', 'politics', 'politics',
'politics', 'chitchat', 'chitchat', 'chitchat', 'chitchat',
'chitchat'], dtype='<U8'), utterances=array(["isn't politics the best thing ever",
"why don't you tell me about your political opinions",
"don't you just love the president",
"don't you just hate the president",
"they're going to destroy this country!",
'they will save the country!', "how's the weather today?",
'how are things going?', 'lovely weather today',
'the weather is horrendous', "let's go to the chippy"],
dtype='<U51'), dimensions=None, type='local')
%% Cell type:markdown id: tags:
We do have 1024-dimensional vectors. Now let's test them:
%% Cell type:code id: tags:
``` python
rl("tell me about your political opinions?")
```
%% Output
RouteChoice(name='politics', function_call=None, similarity_score=None)
%% Cell type:code id: tags:
``` python
rl("how's the weather today?")
```
%% Output
RouteChoice(name='chitchat', function_call=None, similarity_score=None)
%% Cell type:markdown id: tags:
Both are classified accurately, what if we send a query that is unrelated to our existing `Route` objects?
%% Cell type:code id: tags:
``` python
rl("I'm interested in learning about llama 2")
```
%% Output
RouteChoice(name=None, function_call=None, similarity_score=None)
%% Cell type:markdown id: tags:
In this case, we return `None` because no matches were identified. We always recommend optimizing your `RouteLayer` for optimal performance, you can see how in [this notebook](https://github.com/aurelio-labs/semantic-router/blob/main/docs/06-threshold-optimization.ipynb).
%% Cell type:markdown id: tags:
---
......
%% Cell type:markdown id: tags:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/aurelio-labs/semantic-router/blob/main/docs/encoders/huggingface.ipynb) [![Open nbviewer](https://raw.githubusercontent.com/pinecone-io/examples/master/assets/nbviewer-shield.svg)](https://nbviewer.org/github/aurelio-labs/semantic-router/blob/main/docs/encoders/huggingface.ipynb)
%% Cell type:markdown id: tags:
# Using HuggingFaceEncoder
%% Cell type:markdown id: tags:
HuggingFace is a huge ecosystem of open source models. It can be run locally and supports the largest library of encoders.
%% Cell type:markdown id: tags:
## Getting Started
%% Cell type:markdown id: tags:
We start by installing semantic-router with the `[local]` flag to include all necessary dependencies for `HuggingFaceEncoder`:
%% Cell type:code id: tags:
``` python
!pip install -qU "semantic-router[local]==0.0.20"
!pip install -qU "semantic-router[local]==0.1.0"
```
%% Cell type:markdown id: tags:
We start by defining a dictionary mapping routes to example phrases that should trigger those routes.
%% Cell type:code id: tags:
``` python
from semantic_router import Route
politics = Route(
name="politics",
utterances=[
"isn't politics the best thing ever",
"why don't you tell me about your political opinions",
"don't you just love the president",
"don't you just hate the president",
"they're going to destroy this country!",
"they will save the country!",
],
)
```
%% Output
d:\Program_Installation\anaconda\envs\testenv\Lib\site-packages\tqdm\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
%% Cell type:markdown id: tags:
_**⚠️ If you see an ImportError, you must install local dependencies. You can do so by installing Semantic Router using `pip install -qU "semantic-router[local]"`.**_
%% Cell type:markdown id: tags:
Let's define another for good measure:
%% Cell type:code id: tags:
``` python
chitchat = Route(
name="chitchat",
utterances=[
"how's the weather today?",
"how are things going?",
"lovely weather today",
"the weather is horrendous",
"let's go to the chippy",
],
)
routes = [politics, chitchat]
```
%% Cell type:markdown id: tags:
Now we initialize our embedding model.
%% Cell type:code id: tags:
``` python
from semantic_router.encoders import HuggingFaceEncoder
encoder = HuggingFaceEncoder()
```
%% Output
tokenizer_config.json: 100%|██████████| 350/350 [00:00<?, ?B/s]
vocab.txt: 100%|██████████| 232k/232k [00:00<00:00, 950kB/s]
tokenizer.json: 100%|██████████| 466k/466k [00:00<00:00, 630kB/s]
special_tokens_map.json: 100%|██████████| 112/112 [00:00<?, ?B/s]
config.json: 100%|██████████| 612/612 [00:00<?, ?B/s]
model.safetensors: 100%|██████████| 90.9M/90.9M [00:03<00:00, 25.8MB/s]
%% Cell type:code id: tags:
``` python
encoder(["hey"])
```
%% Output
[[-0.11423865705728531,
0.013737470842897892,
0.05483824759721756,
0.02612205408513546,
0.03366684541106224,
-0.0807342678308487,
0.1294635385274887,
0.03305264189839363,
-0.02904639206826687,
-0.04729180410504341,
-0.01743963174521923,
0.010834690183401108,
-0.013411852531135082,
-0.002171672647818923,
0.01874753087759018,
0.00762708717957139,
0.025326967239379883,
-0.10684280842542648,
-0.09309743344783783,
0.06578213721513748,
0.03600294888019562,
0.030101895332336426,
0.010903903283178806,
-0.014277834445238113,
-0.05480341985821724,
-0.046608816832304,
0.03811933100223541,
0.09334418922662735,
-0.08844338357448578,
-0.00015365486615337431,
-0.05805235356092453,
0.040658798068761826,
0.03602350875735283,
-0.00012040344881825149,
0.0014777182368561625,
-0.01575486548244953,
-0.0839557945728302,
-0.1172216534614563,
0.02088264748454094,
0.03227342665195465,
-0.01875143311917782,
-0.006739516742527485,
-0.013505082577466965,
0.07939152419567108,
0.03261948749423027,
-0.021357867866754532,
-0.026340456679463387,
0.02579592913389206,
0.018229736015200615,
-0.003337700152769685,
-0.03188186511397362,
-0.07872839272022247,
-0.04228793457150459,
0.012792701832950115,
0.14339058101177216,
0.09618547558784485,
0.018152154982089996,
-0.0530053973197937,
0.09879206120967865,
-0.0907149612903595,
-0.08342350274324417,
0.012273512780666351,
-0.0819632038474083,
-0.05105786770582199,
0.014089709147810936,
-0.01016179844737053,
-0.03907155245542526,
-0.019414644688367844,
-0.046597715467214584,
-0.031130781397223473,
-0.019644174724817276,
-0.016959073022007942,
-0.03439386188983917,
-0.06818914413452148,
0.037960320711135864,
-0.027920439839363098,
0.03703640401363373,
0.013515403494238853,
0.001978617860004306,
-0.00359722669236362,
0.025217901915311813,
-0.09175395220518112,
-0.05270292982459068,
0.0339379645884037,
-0.009566015563905239,
-0.09692132472991943,
0.0827004685997963,
-0.003031309926882386,
-0.014253348112106323,
0.01019090786576271,
-0.09519690275192261,
-0.0002853995538316667,
0.042065463960170746,
-0.05857514962553978,
-0.03812193498015404,
-0.06450342386960983,
0.06234588846564293,
0.035958241671323776,
-0.09367603063583374,
0.25373566150665283,
0.016129741445183754,
0.07738282531499863,
0.031760625541210175,
0.02651532180607319,
-0.038190484046936035,
0.026544027030467987,
-0.0876961499452591,
0.07003381103277206,
-0.030265210196375847,
-0.016104521229863167,
0.04457677900791168,
0.00757654057815671,
0.014453830197453499,
0.04364680498838425,
0.1351340413093567,
0.06684476137161255,
0.06541601568460464,
0.02084515616297722,
-0.008347414433956146,
-0.07750769704580307,
-0.0319858118891716,
-0.03544182702898979,
-0.001698172534815967,
-0.021968062967061996,
0.09773769229650497,
-0.02362070232629776,
0.022215133532881737,
-5.968164449355239e-33,
0.054632093757390976,
0.00846831128001213,
-0.011441917158663273,
0.13195011019706726,
0.01962447725236416,
-0.04277697578072548,
-0.05078886076807976,
0.021259799599647522,
-0.04665791988372803,
0.01371921319514513,
0.0699634850025177,
0.03471170365810394,
-0.056665170937776566,
0.009710577316582203,
0.008900151588022709,
0.04218043386936188,
-0.03082343190908432,
-0.003828516462817788,
-0.009247229434549809,
0.010788359679281712,
-0.030083660036325455,
-0.047238800674676895,
0.017595993354916573,
0.0810183510184288,
0.004849777091294527,
-0.036722999066114426,
0.035562388598918915,
-0.068642258644104,
0.05170796439051628,
0.010919257067143917,
-0.009729581885039806,
0.009294673800468445,
0.03926905244588852,
0.06409227102994919,
-0.010028756223618984,
-0.023192133754491806,
0.07778891175985336,
-0.0003171116695739329,
-0.031507618725299835,
0.03035464882850647,
-0.020111646503210068,
0.024977393448352814,
0.02069445326924324,
-0.03973761200904846,
0.06862123310565948,
0.08910191804170609,
-0.02524728514254093,
0.009801230393350124,
0.02022949978709221,
-0.004629763774573803,
-0.06564957648515701,
0.05281716212630272,
-0.09382486343383789,
-0.007978985086083412,
-0.07739488780498505,
-0.04856621101498604,
-0.015814466401934624,
-0.01335339155048132,
0.05370025709271431,
0.03840520977973938,
0.025062285363674164,
0.02736000530421734,
-0.03568736091256142,
-0.03636045753955841,
-0.1445392668247223,
-0.05933190882205963,
0.03519044816493988,
0.013504653237760067,
0.024751951918005943,
-0.04175782948732376,
-0.009688134305179119,
0.010052510537207127,
0.005975383333861828,
0.009347953833639622,
0.012808509171009064,
-0.0017119830008596182,
0.08629827201366425,
0.007543443702161312,
0.01831595040857792,
-0.029061343520879745,
0.09248100966215134,
-0.008599715307354927,
0.00978198740631342,
-0.05404217913746834,
0.029240770265460014,
0.035454150289297104,
-0.02278723753988743,
-0.096394382417202,
-0.015356332994997501,
-0.02890510857105255,
-0.09170844405889511,
0.060586266219615936,
0.03915942832827568,
0.002108626300469041,
-0.007839742116630077,
4.4580682029652795e-33,
0.06484320014715195,
0.09692490845918655,
-0.02026134543120861,
0.009838089346885681,
-0.05348040536046028,
-0.004755859263241291,
-0.005625511985272169,
0.11271227151155472,
-0.1243550255894661,
0.002774117747321725,
0.004616657737642527,
-0.061961520463228226,
-0.016888946294784546,
0.021102236583828926,
0.03668638691306114,
-0.010692193172872066,
0.08665463328361511,
-0.030606906861066818,
-0.10806894302368164,
-0.044540874660015106,
-0.0013643245911225677,
-0.04080400615930557,
-0.006068442016839981,
0.016468241810798645,
0.00019835171406157315,
0.02686193212866783,
-0.050506819039583206,
0.04688209667801857,
-0.05142483115196228,
0.0071433898992836475,
0.07447455823421478,
0.02418288215994835,
-0.04474595561623573,
-0.04281294718384743,
0.029996385797858238,
0.046952422708272934,
-0.013240410946309566,
-0.07489501684904099,
0.02129260264337063,
-0.06636284291744232,
-0.0923016369342804,
-0.020468896254897118,
-0.012797920033335686,
0.052056651562452316,
0.0018882454605773091,
-0.005012952722609043,
0.032687779515981674,
0.023257508873939514,
-0.06360457837581635,
0.027944521978497505,
-0.0820653885602951,
-0.05012356862425804,
0.007555392105132341,
0.02247454971075058,
-0.014787756837904453,
-0.013764528557658195,
-0.008079699240624905,
0.043655943125486374,
-0.03173394128680229,
-0.010333573445677757,
-0.004562370479106903,
0.0429571270942688,
0.06618060916662216,
0.08465901762247086,
-0.008432728238403797,
0.05195068567991257,
-0.06404972821474075,
-0.02680053561925888,
-0.06115908920764923,
-0.005285811144858599,
0.024630464613437653,
0.0508127361536026,
-0.02946154959499836,
0.00315065192990005,
0.027983715757727623,
0.0004941211664117873,
0.0973694920539856,
-0.00445805536583066,
0.02243778668344021,
0.05700451508164406,
0.023384707048535347,
0.0002657742297742516,
-0.006948730908334255,
0.028135964646935463,
0.05755734071135521,
-0.0035311044193804264,
0.02564452774822712,
0.06911254674196243,
0.0001439160987501964,
-0.0690045952796936,
0.023919526487588882,
0.0243697427213192,
0.0016542165540158749,
0.00436467956751585,
-0.003900913055986166,
-1.4984452789690295e-08,
0.005736040882766247,
0.07273048162460327,
-0.04237211495637894,
0.07735995203256607,
0.045224644243717194,
0.11730047315359116,
-0.015441788360476494,
-0.006769617088139057,
0.011812692508101463,
0.042124193161726,
0.101394422352314,
0.0897025316953659,
-0.03517512232065201,
0.023409757763147354,
0.05634652450680733,
0.06467470526695251,
-0.05817856639623642,
0.007569451350718737,
-0.0726981908082962,
-0.058578263968229294,
-0.01871626265347004,
0.039866991341114044,
0.011542759835720062,
-0.036801159381866455,
-0.006841242779046297,
-0.04151619225740433,
0.011084156110882759,
0.033770542591810226,
-0.004958425648510456,
-0.025353027507662773,
-0.02028714120388031,
0.14283043146133423,
-0.02753743715584278,
0.036813028156757355,
0.026038523763418198,
-0.04208604618906975,
0.0035880794748663902,
-0.012132312171161175,
0.0464431531727314,
-0.00905541516840458,
-0.06408620625734329,
0.024333177134394646,
-0.003940224181860685,
-0.02544635906815529,
-0.017610585317015648,
-0.0488358810544014,
0.027587853372097015,
-0.07398281246423721,
0.053129442036151886,
-0.0954415500164032,
0.00758804427459836,
0.0036420796532183886,
0.06142501160502434,
0.03770154342055321,
0.1305655688047409,
-0.01286567933857441,
0.03425038605928421,
-0.013945942744612694,
0.022425182163715363,
-0.02659265510737896,
0.06289114058017731,
0.05313219130039215,
0.07984637469053268,
-0.012213138863444328]]
%% Cell type:markdown id: tags:
Now we define the `RouteLayer`. When called, the route layer will consume text (a query) and output the category (`Route`) it belongs to — to initialize a `RouteLayer` we need our `encoder` model and a list of `routes`.
%% Cell type:code id: tags:
``` python
from semantic_router.layer import RouteLayer
from semantic_router.routers import SemanticRouter
rl = RouteLayer(encoder=encoder, routes=routes)
rl = SemanticRouter(encoder=encoder, routes=routes, auto_sync="local")
```
%% Output
2024-04-14 18:15:59 INFO semantic_router.utils.logger local
%% Cell type:code id: tags:
``` python
rl.index
```
%% Output
LocalIndex(index=array([[-0.00864941, 0.02088905, 0.04548961, ..., -0.00787578,
0.0252752 , 0.01958269],
[ 0.10101052, -0.05990515, 0.01437028, ..., -0.00809868,
0.03701495, -0.01487793],
[ 0.01996296, -0.03627442, 0.15291646, ..., 0.06719883,
0.08079942, -0.03931363],
...,
[-0.01322144, 0.11396162, 0.14592913, ..., -0.01772162,
-0.09720093, 0.05921701],
[ 0.02863792, 0.09272329, 0.10989423, ..., -0.00030185,
-0.10717052, 0.04849005],
[-0.03355407, -0.04666358, -0.05054352, ..., 0.04337099,
0.10585055, -0.06144635]]), routes=array(['politics', 'politics', 'politics', 'politics', 'politics',
'politics', 'chitchat', 'chitchat', 'chitchat', 'chitchat',
'chitchat'], dtype='<U8'), utterances=array(["isn't politics the best thing ever",
"why don't you tell me about your political opinions",
"don't you just love the president",
"don't you just hate the president",
"they're going to destroy this country!",
'they will save the country!', "how's the weather today?",
'how are things going?', 'lovely weather today',
'the weather is horrendous', "let's go to the chippy"],
dtype='<U51'), dimensions=None, type='local')
%% Cell type:markdown id: tags:
Now we can test it:
%% Cell type:code id: tags:
``` python
rl("don't you love politics?")
```
%% Output
vector [ 7.46806897e-03 -3.49807888e-02 8.88827071e-02 -3.65814343e-02
9.69796628e-02 -3.88786122e-02 1.91174150e-02 -2.44899071e-03
2.94564646e-02 2.73508448e-02 -1.19639039e-01 3.17963734e-02
2.52084807e-03 2.75214389e-03 -1.46908767e-03 3.32778133e-02
-8.00867677e-02 -4.17326577e-03 -2.38617379e-02 1.46567017e-01
-1.49368718e-01 4.26295139e-02 4.98373099e-02 1.65512003e-02
1.98207237e-02 -2.43026596e-02 -1.81025621e-02 -2.04044133e-02
-6.39620274e-02 -4.54164632e-02 -7.70635204e-03 1.11671137e-02
-1.09083969e-02 6.57793432e-02 3.92031223e-02 7.03004422e-03
5.31722419e-02 2.29947194e-02 3.18085887e-02 -1.34273348e-02
7.80912861e-03 1.41071444e-02 -2.45402344e-02 -5.35607934e-02
-5.93818501e-02 -2.74034124e-03 3.07757724e-02 4.67852596e-03
7.82168582e-02 -7.07853511e-02 1.20290471e-02 3.36084664e-02
3.86536419e-02 4.40022983e-02 7.18170255e-02 -1.54885557e-02
3.44607979e-02 4.96295393e-02 -4.19351831e-02 9.97676980e-05
-2.87968363e-03 2.87525635e-02 -3.27512138e-02 2.99615487e-02
-3.11616343e-03 3.99692096e-02 -4.20988211e-03 -1.40505536e-02
-3.85094695e-02 1.77390687e-02 -2.16467027e-02 6.61753565e-02
8.33685175e-02 -4.78239059e-02 -4.70590405e-02 -3.43491174e-02
3.80785204e-03 8.20114464e-02 4.13801894e-02 -9.00606439e-03
5.69840260e-02 -5.47169484e-02 1.96720269e-02 5.77765107e-02
1.66462716e-02 -1.10149585e-01 -5.24689816e-02 5.18206228e-03
-3.89118999e-04 -3.44066173e-02 -3.78542580e-02 1.00882528e-02
2.04983242e-02 -9.67855193e-03 -2.84724031e-02 -8.81512761e-02
4.77903932e-02 3.23785283e-02 -9.37398747e-02 8.25569853e-02
-7.05434531e-02 -4.01798189e-02 -8.01931471e-02 5.74426539e-02
-3.66569799e-03 -4.87772673e-02 -1.32716194e-01 1.70647614e-02
-2.05865130e-02 -2.54293457e-02 -3.49317975e-02 5.63595593e-02
9.65489000e-02 -3.81795168e-02 6.41789660e-02 -5.97803183e-02
4.79376912e-02 -6.73008412e-02 1.29452450e-02 7.47889131e-02
-3.50754783e-02 -3.92399095e-02 -8.27630535e-02 6.69496059e-02
5.43073602e-02 -1.05082624e-01 2.50374246e-03 -8.70677792e-33
-6.24993332e-02 -5.26585393e-02 -2.67148105e-04 8.23840424e-02
-9.20600966e-02 1.09337494e-01 -6.93592848e-03 -6.77209422e-02
2.31854827e-03 2.61983182e-02 -5.97448759e-02 1.39414638e-01
4.36192639e-02 -4.00043800e-02 4.44744304e-02 4.79639479e-04
-9.06227157e-02 -4.08852892e-03 -4.63285781e-02 -3.02307531e-02
-5.81271201e-02 8.55818465e-02 3.42825167e-02 5.44268265e-02
1.04459964e-01 3.67966965e-02 8.17925632e-02 -4.86575179e-02
6.59503713e-02 4.70023975e-02 -2.52449065e-02 -3.77716720e-02
-4.33016196e-02 3.54233049e-02 -3.84103656e-02 -3.85655760e-04
-2.19709128e-02 2.32433695e-02 3.99560183e-02 -3.96165997e-02
8.89946595e-02 3.30114514e-02 -6.53322786e-03 4.37131003e-02
-2.58748494e-02 -4.89604287e-03 5.74647598e-02 1.34270790e-03
-4.75572189e-03 -2.29260828e-02 -2.30850674e-05 4.61842045e-02
9.64455009e-02 -1.34467948e-02 5.43327220e-02 -4.99240905e-02
-6.38680682e-02 -3.99457924e-02 -2.31168065e-02 -6.60235286e-02
-4.51665260e-02 -1.06092729e-02 5.11268247e-03 -1.63481403e-02
4.48726676e-02 4.88157338e-03 -1.21778011e-01 4.07235548e-02
1.23663016e-01 2.09960677e-02 8.85758456e-03 -2.57863365e-02
-1.25853419e-01 -3.04767899e-02 -4.83227335e-02 2.13521179e-02
7.65490755e-02 -1.62383765e-02 -4.12127823e-02 -3.46125327e-02
3.35594527e-02 -2.75545437e-02 1.48337394e-01 -2.41062324e-02
4.78513241e-02 -2.57437732e-02 6.86436594e-02 -3.65344249e-02
9.58712995e-02 -7.33761489e-02 -6.54934272e-02 -7.58369714e-02
2.16469876e-02 2.11787838e-02 -1.32356793e-01 7.74216946e-33
-5.21602631e-02 -1.12684049e-01 3.75458039e-02 2.14454755e-02
-1.59239266e-02 -2.00403482e-02 2.00451282e-03 -7.60207623e-02
6.17395993e-03 9.82744992e-02 -5.70474076e-05 -5.46450354e-02
-8.58346745e-03 3.54736857e-02 9.09018740e-02 -7.34343156e-02
5.37787378e-02 2.34990641e-02 -7.36654252e-02 -2.96295825e-02
-4.20701243e-02 4.01046425e-02 -1.05566114e-01 8.53969455e-02
-9.78117287e-02 3.11244652e-02 -8.60458147e-03 -5.80112636e-02
8.06473009e-03 2.32330374e-02 1.29305897e-02 -1.45072332e-02
-6.42017797e-02 -1.80655587e-02 -3.71037386e-02 7.91664515e-03
-2.76426841e-02 -4.71186750e-02 3.25874314e-02 -2.59979051e-02
-2.75685731e-02 -5.33751510e-02 2.11490206e-02 2.41934936e-02
-7.74724558e-02 -5.48699610e-02 -3.02678696e-03 2.51382738e-02
7.51809077e-03 -1.04018506e-02 -5.87963313e-02 4.60062809e-02
3.05394977e-02 -2.98662260e-02 4.60343696e-02 -2.43270658e-02
-1.80021673e-02 8.80592465e-02 -3.52736451e-02 3.42088193e-02
-1.84306744e-02 1.83841325e-02 -1.26974359e-02 -5.30652609e-03
1.65736768e-02 -1.89048573e-02 -2.92793736e-02 -7.48898089e-02
9.58707631e-02 4.02442832e-03 2.81538311e-02 -5.81194721e-02
-9.39897671e-02 3.95648554e-02 1.23225600e-02 5.75946681e-02
1.96183030e-03 6.95726126e-02 -2.68521514e-02 2.91528199e-02
2.64277216e-02 -1.06734969e-02 1.18107386e-02 -7.41961002e-02
2.32443679e-02 5.63910119e-02 -2.35880818e-02 6.71420619e-02
-2.24174298e-02 5.93297668e-02 5.77776693e-02 3.75099629e-02
5.69688855e-03 -2.56761108e-02 6.62673786e-02 -1.96984313e-08
3.92213389e-02 1.70475300e-02 4.09772508e-02 -6.42266218e-03
-6.23241104e-02 -4.91327532e-02 -1.97951663e-02 -4.40760069e-02
-2.72826254e-02 -1.60910953e-02 1.15375720e-01 4.63905372e-02
-6.51486441e-02 -1.31851183e-02 7.16804564e-02 1.75282490e-02
6.10029511e-02 2.75316294e-02 -1.92716401e-02 -2.04059891e-02
-1.46359978e-02 4.85771447e-02 -1.65706128e-02 8.66604224e-02
2.96872873e-02 6.26259074e-02 2.56345142e-02 -3.19722369e-02
8.13637450e-02 -3.31001319e-02 1.27992919e-02 3.62702198e-02
-6.38388470e-02 4.30489294e-02 5.40841487e-04 -3.80511861e-03
4.21091588e-03 -1.12978499e-02 -7.65859755e-03 -7.39676924e-03
-1.59889944e-02 1.02662235e-01 5.57321496e-02 -2.99020577e-02
-6.92943633e-02 1.64305847e-02 -1.08625945e-02 2.04215292e-02
8.24088156e-02 1.39690740e-02 -2.41274685e-02 7.50095770e-02
8.87042657e-03 1.05826482e-02 9.90147814e-02 -2.97501963e-02
3.43261287e-02 2.33199596e-02 3.74692902e-02 -8.54534374e-05
3.10892314e-02 3.17056179e-02 4.35627997e-02 -3.98492068e-02]
RouteChoice(name='politics', function_call=None, similarity_score=None)
%% Cell type:code id: tags:
``` python
rl("how's the weather today?")
```
%% Output
RouteChoice(name='chitchat', function_call=None)
%% Cell type:markdown id: tags:
Both are classified accurately, what if we send a query that is unrelated to our existing `Route` objects?
%% Cell type:code id: tags:
``` python
rl("I'm interested in learning about llama 2")
```
%% Output
RouteChoice(name=None, function_call=None)
%% Cell type:markdown id: tags:
In this case, we return `None` because no matches were identified.
......
%% Cell type:markdown id: tags:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/aurelio-labs/semantic-router/blob/main/docs/encoders/openai-embed-3.ipynb) [![Open nbviewer](https://raw.githubusercontent.com/pinecone-io/examples/master/assets/nbviewer-shield.svg)](https://nbviewer.org/github/aurelio-labs/semantic-router/blob/main/docs/encoders/openai-embed-3.ipynb)
%% Cell type:markdown id: tags:
# Using OpenAI Embed 3 Models
%% Cell type:markdown id: tags:
The 3rd generation embedding models from OpenAI (`text-embedding-3-small` and `text-embedding-3-large`) can both be used with our `OpenAIEncoder` and usage is primarily the same as with the 2nd generation `text-embedding-ada-002`. However, there is a new `dimensions` parameter — which we will discuss below.
%% Cell type:markdown id: tags:
## Getting Started
%% Cell type:markdown id: tags:
We start by installing semantic-router. Support for the new `dimensions` parameter was added in `semantic-router==0.0.19` and `openai==1.10.0`.
%% Cell type:code id: tags:
``` python
!pip install -qU semantic-router==0.0.20
!pip install -qU semantic-router==0.1.0
```
%% Cell type:markdown id: tags:
We start by defining a dictionary mapping routes to example phrases that should trigger those routes.
%% Cell type:code id: tags:
``` python
from semantic_router import Route
politics = Route(
name="politics",
utterances=[
"isn't politics the best thing ever",
"why don't you tell me about your political opinions",
"don't you just love the president",
"don't you just hate the president",
"they're going to destroy this country!",
"they will save the country!",
],
)
```
%% Output
/Users/jamesbriggs/opt/anaconda3/envs/decision-layer/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
%% Cell type:markdown id: tags:
Let's define another for good measure:
%% Cell type:code id: tags:
``` python
chitchat = Route(
name="chitchat",
utterances=[
"how's the weather today?",
"how are things going?",
"lovely weather today",
"the weather is horrendous",
"let's go to the chippy",
],
)
routes = [politics, chitchat]
```
%% Cell type:markdown id: tags:
Now we initialize our embedding model, we will use the `-3-large` model alongside a `dimensions` value of `256`. This will produce _tiny_ 256-dimensional vectors that — according to OpenAI — outperform the 1536-dimensional vectors produced by `text-embedding-ada-002`.
%% Cell type:code id: tags:
``` python
import os
from getpass import getpass
from semantic_router.encoders import OpenAIEncoder
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY") or getpass(
"Enter OpenAI API Key: "
)
encoder = OpenAIEncoder(
name="text-embedding-3-large", score_threshold=0.5, dimensions=256
)
```
%% Cell type:markdown id: tags:
Now we define the `RouteLayer`. When called, the route layer will consume text (a query) and output the category (`Route`) it belongs to — to initialize a `RouteLayer` we need our `encoder` model and a list of `routes`.
%% Cell type:code id: tags:
``` python
from semantic_router.layer import RouteLayer
from semantic_router.routers import SemanticRouter
rl = RouteLayer(encoder=encoder, routes=routes)
rl = SemanticRouter(encoder=encoder, routes=routes, auto_sync="local")
```
%% Output
2024-01-28 12:40:08 INFO semantic_router.utils.logger Initializing RouteLayer
2025-01-07 12:31:20 - semantic_router.utils.logger - WARNING - base.py:356 - _get_index() - No index provided. Using default LocalIndex.
2025-01-07 12:31:20 - httpx - INFO - _client.py:1025 - _send_single_request() - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
2025-01-07 12:31:21 - httpx - INFO - _client.py:1025 - _send_single_request() - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
2025-01-07 12:31:21 - semantic_router.utils.logger - WARNING - local.py:148 - _write_config() - No config is written for LocalIndex.
%% Cell type:markdown id: tags:
We can check the dimensionality of our vectors by looking at the `index` attribute of the `RouteLayer`.
%% Cell type:code id: tags:
``` python
rl.index.shape
rl.index.dimensions
```
%% Output
(11, 256)
256
%% Cell type:markdown id: tags:
We do have 256-dimensional vectors. Now let's test them:
%% Cell type:code id: tags:
``` python
rl("don't you love politics?")
```
%% Output
RouteChoice(name='politics', function_call=None, similarity_score=None, trigger=None)
2025-01-07 12:32:01 - httpx - INFO - _client.py:1025 - _send_single_request() - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
RouteChoice(name='politics', function_call=None, similarity_score=None)
%% Cell type:code id: tags:
``` python
rl("how's the weather today?")
```
%% Output
RouteChoice(name='chitchat', function_call=None, similarity_score=None, trigger=None)
2025-01-07 12:32:05 - httpx - INFO - _client.py:1025 - _send_single_request() - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
RouteChoice(name='chitchat', function_call=None, similarity_score=None)
%% Cell type:markdown id: tags:
Both are classified accurately, what if we send a query that is unrelated to our existing `Route` objects?
%% Cell type:code id: tags:
``` python
rl("I'm interested in learning about llama 2")
```
%% Output
RouteChoice(name=None, function_call=None, similarity_score=None, trigger=None)
2025-01-07 12:32:08 - httpx - INFO - _client.py:1025 - _send_single_request() - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
RouteChoice(name=None, function_call=None, similarity_score=None)
%% Cell type:markdown id: tags:
In this case, we return `None` because no matches were identified. We always recommend optimizing your `RouteLayer` for optimal performance, you can see how in [this notebook](https://github.com/aurelio-labs/semantic-router/blob/main/docs/06-threshold-optimization.ipynb).
%% Cell type:markdown id: tags:
---
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment