From 93dcc47463e53ad3e1611e1abd94fd1f82f0733c Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Tue, 13 Aug 2024 20:53:13 -0400 Subject: [PATCH] docs: Partial integration update for cohere embeddings (#25250) This can be finished after the following issue is resolved: https://github.com/langchain-ai/langchain-cohere/issues/81 Related to: https://github.com/langchain-ai/langchain/issues/24856 ```json [ { "provider": "cohere", "js": true, "local": false, "serializable": false, } ] ``` --------- Co-authored-by: isaac hershenson Co-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com> --- .../integrations/text_embedding/cohere.ipynb | 2239 ++++++++++++++++- 1 file changed, 2204 insertions(+), 35 deletions(-) diff --git a/docs/docs/integrations/text_embedding/cohere.ipynb b/docs/docs/integrations/text_embedding/cohere.ipynb index d13cd450b06a6..4922aaa08c663 100644 --- a/docs/docs/integrations/text_embedding/cohere.ipynb +++ b/docs/docs/integrations/text_embedding/cohere.ipynb @@ -1,105 +1,2279 @@ { "cells": [ + { + "cell_type": "raw", + "id": "afaf8039", + "metadata": {}, + "source": [ + "---\n", + "sidebar_label: Cohere\n", + "---" + ] + }, { "cell_type": "markdown", - "id": "42f76e43", + "id": "9a3d6f34", "metadata": {}, "source": [ - "# Cohere\n", + "# CohereEmbeddings\n", + "\n", + "This will help you get started with Cohere embedding models using LangChain. For detailed documentation on `CohereEmbeddings` features and configuration options, please refer to the [API reference](https://api.python.langchain.com/en/latest/embeddings/langchain_cohere.embeddings.CohereEmbeddings.html).\n", + "\n", + "## Overview\n", + "### Integration details\n", "\n", - "Let's load the Cohere Embedding class." + "import { ItemTable } from \"@theme/FeatureTables\";\n", + "\n", + "\n", + "\n", + "## Setup\n", + "\n", + "To access Cohere embedding models you'll need to create a/an Cohere account, get an API key, and install the `langchain-cohere` integration package.\n", + "\n", + "### Credentials\n", + "\n", + "\n", + "Head to [cohere.com](https://cohere.com) to sign up to Cohere and generate an API key. Once you’ve done this set the COHERE_API_KEY environment variable:" ] }, { "cell_type": "code", "execution_count": 1, - "id": "1bfad19b", + "id": "36521c2a", "metadata": {}, "outputs": [], "source": [ "import getpass\n", "import os\n", "\n", - "os.environ[\"COHERE_API_KEY\"] = getpass.getpass()" + "if not os.getenv(\"COHERE_API_KEY\"):\n", + " os.environ[\"COHERE_API_KEY\"] = getpass.getpass(\"Enter your Cohere API key: \")" + ] + }, + { + "cell_type": "markdown", + "id": "c84fb993", + "metadata": {}, + "source": [ + "If you want to get automated tracing of your model calls you can also set your [LangSmith](https://docs.smith.langchain.com/) API key by uncommenting below:" ] }, { "cell_type": "code", "execution_count": 2, - "id": "6b82f59f", + "id": "39a4953b", "metadata": {}, "outputs": [], "source": [ - "from langchain_cohere import CohereEmbeddings" + "# os.environ[\"LANGCHAIN_TRACING_V2\"] = \"true\"\n", + "# os.environ[\"LANGCHAIN_API_KEY\"] = getpass.getpass(\"Enter your LangSmith API key: \")" + ] + }, + { + "cell_type": "markdown", + "id": "d9664366", + "metadata": {}, + "source": [ + "### Installation\n", + "\n", + "The LangChain Cohere integration lives in the `langchain-cohere` package:" ] }, { "cell_type": "code", "execution_count": 3, - "id": "26895c60", + "id": "64853226", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.2\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython -m pip install --upgrade pip\u001b[0m\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], + "source": [ + "%pip install -qU langchain-cohere" + ] + }, + { + "cell_type": "markdown", + "id": "45dd1724", + "metadata": {}, + "source": [ + "## Instantiation\n", + "\n", + "Now we can instantiate our model object and generate chat completions:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "9ea7a09b", "metadata": {}, "outputs": [], "source": [ + "from langchain_cohere import CohereEmbeddings\n", + "\n", "embeddings = CohereEmbeddings(\n", - " model=\"embed-english-light-v3.0\"\n", - ") # It is mandatory to pass a model parameter to initialize the CohereEmbeddings object" + " model=\"embed-english-v3.0\",\n", + ")" ] }, { "cell_type": "code", - "execution_count": 4, - "id": "eea52814", + "execution_count": 2, + "id": "519790ad-fdb0-4e24-8220-4d3a8fed43a3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[[0.0028572083,\n", + " 0.015930176,\n", + " -0.02935791,\n", + " -0.06213379,\n", + " 0.017105103,\n", + " -0.0024280548,\n", + " -0.043701172,\n", + " 0.0054473877,\n", + " 0.021759033,\n", + " 0.045288086,\n", + " -0.037963867,\n", + " -0.022506714,\n", + " 0.03427124,\n", + " -0.029769897,\n", + " 0.030563354,\n", + " -0.01537323,\n", + " 0.001830101,\n", + " 0.025558472,\n", + " -0.026947021,\n", + " -0.028076172,\n", + " -0.03463745,\n", + " -0.029205322,\n", + " -0.032958984,\n", + " -0.0022850037,\n", + " 0.022888184,\n", + " 0.0096206665,\n", + " -0.02507019,\n", + " -0.028717041,\n", + " -0.002216339,\n", + " -0.027267456,\n", + " -0.011619568,\n", + " 0.025115967,\n", + " 0.032073975,\n", + " 0.005722046,\n", + " -0.004737854,\n", + " 0.031707764,\n", + " -0.034698486,\n", + " -0.018005371,\n", + " -0.0030460358,\n", + " -0.0027198792,\n", + " -0.016723633,\n", + " 0.017730713,\n", + " -0.07244873,\n", + " -0.015914917,\n", + " -0.111816406,\n", + " -0.042144775,\n", + " -0.031829834,\n", + " 0.030212402,\n", + " 0.012664795,\n", + " 0.04498291,\n", + " 0.013641357,\n", + " -0.006713867,\n", + " -0.008171082,\n", + " 0.0647583,\n", + " -0.010322571,\n", + " -0.0022773743,\n", + " -0.017333984,\n", + " -0.014122009,\n", + " -0.0064468384,\n", + " -0.0035114288,\n", + " -0.015625,\n", + " -0.0011920929,\n", + " 0.049682617,\n", + " 0.049957275,\n", + " -0.022613525,\n", + " -0.022033691,\n", + " 0.022354126,\n", + " 0.017303467,\n", + " 0.0065345764,\n", + " -0.032165527,\n", + " -0.0027770996,\n", + " 0.0046157837,\n", + " 0.01914978,\n", + " -0.012039185,\n", + " 0.0011959076,\n", + " -0.028427124,\n", + " 0.04751587,\n", + " 0.037719727,\n", + " -0.01626587,\n", + " -0.0031280518,\n", + " -0.04675293,\n", + " -0.010620117,\n", + " -0.038116455,\n", + " 0.019470215,\n", + " -0.019302368,\n", + " 0.050628662,\n", + " -0.009788513,\n", + " -0.058502197,\n", + " 0.02204895,\n", + " -0.019241333,\n", + " -0.016143799,\n", + " 0.045013428,\n", + " 0.06402588,\n", + " 0.027496338,\n", + " -0.061340332,\n", + " 0.029434204,\n", + " -0.014175415,\n", + " -0.007980347,\n", + " -0.022750854,\n", + " 0.00856781,\n", + " -0.0077056885,\n", + " -0.027923584,\n", + " -0.031555176,\n", + " -0.020980835,\n", + " -0.0079574585,\n", + " 0.042114258,\n", + " -0.02218628,\n", + " -0.0007224083,\n", + " 0.028839111,\n", + " 0.040008545,\n", + " 0.0051116943,\n", + " 0.0335083,\n", + " 0.00012886524,\n", + " 0.016937256,\n", + " -0.019607544,\n", + " 0.025161743,\n", + " 0.031829834,\n", + " 0.003835678,\n", + " -0.009750366,\n", + " 0.0335083,\n", + " 0.047821045,\n", + " 0.0423584,\n", + " 0.022445679,\n", + " -0.03326416,\n", + " -0.032043457,\n", + " -0.008361816,\n", + " -0.03567505,\n", + " -0.05038452,\n", + " 0.032104492,\n", + " -0.047729492,\n", + " -0.0065574646,\n", + " 0.04977417,\n", + " -0.115356445,\n", + " -0.021514893,\n", + " -0.032592773,\n", + " 0.023849487,\n", + " -0.010597229,\n", + " -0.057739258,\n", + " -0.012420654,\n", + " 0.024734497,\n", + " 0.0096206665,\n", + " -0.011932373,\n", + " 0.050445557,\n", + " -0.018997192,\n", + " -0.042877197,\n", + " 0.015220642,\n", + " 0.01259613,\n", + " -0.020736694,\n", + " -0.012184143,\n", + " -0.0101623535,\n", + " -0.041625977,\n", + " -0.046661377,\n", + " 0.025268555,\n", + " 0.026535034,\n", + " -0.022216797,\n", + " 0.04724121,\n", + " -0.048187256,\n", + " 0.015670776,\n", + " -0.02545166,\n", + " 0.01108551,\n", + " -0.00057029724,\n", + " -0.012588501,\n", + " 0.0063934326,\n", + " -0.049591064,\n", + " -0.029418945,\n", + " 0.04067993,\n", + " -0.029342651,\n", + " 0.029449463,\n", + " 0.02180481,\n", + " 0.068725586,\n", + " -0.025939941,\n", + " -0.007461548,\n", + " 0.021820068,\n", + " 0.0184021,\n", + " -0.01424408,\n", + " 0.01576233,\n", + " 0.006378174,\n", + " -0.038208008,\n", + " 0.0390625,\n", + " 0.05770874,\n", + " 0.0029125214,\n", + " -0.030014038,\n", + " -0.015388489,\n", + " 0.074645996,\n", + " -0.033813477,\n", + " -0.016616821,\n", + " 0.004497528,\n", + " -0.021835327,\n", + " 0.01020813,\n", + " 0.0020923615,\n", + " 0.024490356,\n", + " 0.014152527,\n", + " -0.026779175,\n", + " -0.028671265,\n", + " -0.029464722,\n", + " -0.04537964,\n", + " 0.009483337,\n", + " -0.017150879,\n", + " -0.014671326,\n", + " 0.06188965,\n", + " 0.017456055,\n", + " -0.003271103,\n", + " 0.011375427,\n", + " -0.040252686,\n", + " -0.020446777,\n", + " -0.010520935,\n", + " 0.0068130493,\n", + " 0.022018433,\n", + " 0.03704834,\n", + " 0.05050659,\n", + " -0.0079422,\n", + " 0.008102417,\n", + " -0.02268982,\n", + " -0.010353088,\n", + " -0.032104492,\n", + " -0.023254395,\n", + " -0.06097412,\n", + " 0.028457642,\n", + " -0.0079956055,\n", + " 0.06719971,\n", + " 0.023651123,\n", + " -0.02330017,\n", + " 0.00082063675,\n", + " 0.02583313,\n", + " 0.011634827,\n", + " -0.0010271072,\n", + " -0.021743774,\n", + " -0.0060195923,\n", + " 0.013313293,\n", + " -0.0012722015,\n", + " 0.019515991,\n", + " 0.014137268,\n", + " 0.05340576,\n", + " 0.05142212,\n", + " -0.027511597,\n", + " -0.0152282715,\n", + " 0.03086853,\n", + " 0.04046631,\n", + " 0.0066223145,\n", + " 0.0049934387,\n", + " 0.004776001,\n", + " -0.012176514,\n", + " 0.0037765503,\n", + " 0.0206604,\n", + " 0.007041931,\n", + " 0.010635376,\n", + " 0.02557373,\n", + " 0.005443573,\n", + " 0.0075149536,\n", + " -0.0054359436,\n", + " 0.048065186,\n", + " 0.011878967,\n", + " 0.045562744,\n", + " 0.0030612946,\n", + " 0.008171082,\n", + " 0.07159424,\n", + " 0.009086609,\n", + " 0.03265381,\n", + " -0.054229736,\n", + " 0.021362305,\n", + " -0.014671326,\n", + " 0.0007405281,\n", + " -0.034301758,\n", + " -0.0032291412,\n", + " -0.051208496,\n", + " 0.008598328,\n", + " -0.026855469,\n", + " 0.026657104,\n", + " 0.008125305,\n", + " -0.0034675598,\n", + " 0.009170532,\n", + " -0.020706177,\n", + " -0.012878418,\n", + " -0.003124237,\n", + " 0.029266357,\n", + " 0.002571106,\n", + " -0.024658203,\n", + " -0.017227173,\n", + " -0.0034046173,\n", + " -0.024932861,\n", + " -0.007774353,\n", + " 0.026748657,\n", + " 5.364418e-07,\n", + " 0.013626099,\n", + " 0.023513794,\n", + " 0.018692017,\n", + " -0.007419586,\n", + " 0.0039901733,\n", + " 0.0036201477,\n", + " 0.04876709,\n", + " 0.065979004,\n", + " 0.029922485,\n", + " 0.018554688,\n", + " 0.015792847,\n", + " 0.05050659,\n", + " 0.046875,\n", + " 0.04135132,\n", + " 0.005115509,\n", + " 0.007461548,\n", + " -0.020889282,\n", + " 0.02973938,\n", + " 0.050567627,\n", + " 0.0067710876,\n", + " -0.011054993,\n", + " 0.0047302246,\n", + " 0.023254395,\n", + " 0.019577026,\n", + " 0.026550293,\n", + " 0.020141602,\n", + " -0.012237549,\n", + " 0.0027656555,\n", + " 0.0054473877,\n", + " 0.0039253235,\n", + " -0.027023315,\n", + " -0.002872467,\n", + " -0.04724121,\n", + " -0.008872986,\n", + " -0.009727478,\n", + " -0.064941406,\n", + " -0.017730713,\n", + " 0.025024414,\n", + " 0.0026359558,\n", + " -0.057037354,\n", + " -0.0038585663,\n", + " 0.018112183,\n", + " -0.025222778,\n", + " -0.027999878,\n", + " -0.03390503,\n", + " -0.054718018,\n", + " 0.00617218,\n", + " 0.04763794,\n", + " -0.016723633,\n", + " 0.011787415,\n", + " -0.036987305,\n", + " 0.0096206665,\n", + " -0.008079529,\n", + " 0.0017185211,\n", + " -0.03933716,\n", + " -0.024871826,\n", + " 0.019546509,\n", + " 0.015449524,\n", + " 0.013969421,\n", + " 0.05404663,\n", + " -0.03302002,\n", + " -0.055541992,\n", + " -0.0057373047,\n", + " -0.017684937,\n", + " 0.023971558,\n", + " -0.043426514,\n", + " -0.023544312,\n", + " 0.04626465,\n", + " -0.03967285,\n", + " -0.058563232,\n", + " -0.014671326,\n", + " 0.049743652,\n", + " -0.009262085,\n", + " 0.03652954,\n", + " 0.043151855,\n", + " 0.10961914,\n", + " -0.024276733,\n", + " -0.0011787415,\n", + " -0.026504517,\n", + " -0.053894043,\n", + " 0.0069503784,\n", + " 0.02986145,\n", + " -0.008049011,\n", + " -0.0020771027,\n", + " -0.009498596,\n", + " -0.026565552,\n", + " 0.017456055,\n", + " -0.022857666,\n", + " -0.023757935,\n", + " -0.009460449,\n", + " -0.008651733,\n", + " -0.047546387,\n", + " 0.048553467,\n", + " -0.04067993,\n", + " -0.06976318,\n", + " 0.020950317,\n", + " -0.017181396,\n", + " 0.00029063225,\n", + " 0.013786316,\n", + " 0.046844482,\n", + " -0.03201294,\n", + " 0.06427002,\n", + " -0.0062408447,\n", + " -0.006614685,\n", + " 0.0072746277,\n", + " 0.093933105,\n", + " 0.036193848,\n", + " -0.0024547577,\n", + " -0.022262573,\n", + " 0.0040016174,\n", + " 0.008369446,\n", + " -0.03604126,\n", + " -0.0033302307,\n", + " 0.0061950684,\n", + " -0.019958496,\n", + " -0.054595947,\n", + " -0.006969452,\n", + " 0.031555176,\n", + " -0.0026283264,\n", + " -0.041931152,\n", + " -0.004837036,\n", + " -0.07147217,\n", + " 0.021896362,\n", + " -0.01448822,\n", + " -0.031311035,\n", + " 0.026870728,\n", + " 0.04647827,\n", + " -0.050628662,\n", + " 0.10809326,\n", + " -0.04751587,\n", + " 0.037384033,\n", + " -0.013580322,\n", + " 0.0049324036,\n", + " -0.009056091,\n", + " 0.033294678,\n", + " -0.0004901886,\n", + " 0.026550293,\n", + " -0.005870819,\n", + " 0.0047950745,\n", + " -0.022857666,\n", + " 0.007911682,\n", + " -0.011985779,\n", + " 0.05429077,\n", + " -0.012161255,\n", + " 0.03552246,\n", + " 0.034210205,\n", + " -0.038482666,\n", + " -0.039978027,\n", + " -0.029327393,\n", + " -0.019592285,\n", + " -0.026351929,\n", + " -0.04119873,\n", + " 0.008773804,\n", + " -0.018539429,\n", + " 0.042633057,\n", + " 0.0028209686,\n", + " -0.032928467,\n", + " -0.032196045,\n", + " 0.028900146,\n", + " 0.025009155,\n", + " 0.00092315674,\n", + " 0.008300781,\n", + " -0.0067825317,\n", + " 0.04449463,\n", + " -0.022369385,\n", + " -0.030136108,\n", + " 0.031799316,\n", + " -0.04159546,\n", + " -0.005054474,\n", + " -0.028244019,\n", + " 0.034088135,\n", + " -0.03488159,\n", + " 0.066589355,\n", + " 0.02508545,\n", + " 0.0023441315,\n", + " 0.021896362,\n", + " 0.028045654,\n", + " 0.02784729,\n", + " 0.0012083054,\n", + " -0.045043945,\n", + " -0.01737976,\n", + " -0.02053833,\n", + " 0.022903442,\n", + " 0.010765076,\n", + " 0.024810791,\n", + " -0.045166016,\n", + " -0.016555786,\n", + " 0.022659302,\n", + " 0.017669678,\n", + " 0.05178833,\n", + " 0.0010061264,\n", + " 0.053344727,\n", + " 0.03640747,\n", + " -0.07293701,\n", + " -0.038970947,\n", + " -0.018447876,\n", + " 0.05886841,\n", + " 0.008407593,\n", + " 0.0072288513,\n", + " -0.015899658,\n", + " -0.0960083,\n", + " -0.055725098,\n", + " 0.013084412,\n", + " -0.103027344,\n", + " -0.0071792603,\n", + " -0.015197754,\n", + " -0.0045166016,\n", + " -0.07244873,\n", + " 0.0029659271,\n", + " 0.034698486,\n", + " -0.084228516,\n", + " -0.031829834,\n", + " -0.0056037903,\n", + " -0.006160736,\n", + " -0.07281494,\n", + " 0.019699097,\n", + " -0.03527832,\n", + " -0.058929443,\n", + " 0.0211792,\n", + " 0.030014038,\n", + " -0.038513184,\n", + " 0.012329102,\n", + " -0.035125732,\n", + " -0.037017822,\n", + " 0.01927185,\n", + " 0.06976318,\n", + " -0.013053894,\n", + " 0.022598267,\n", + " -0.0043182373,\n", + " 0.06573486,\n", + " 0.03277588,\n", + " -0.028686523,\n", + " 0.05831909,\n", + " -0.007003784,\n", + " 0.051513672,\n", + " -0.01890564,\n", + " -0.010017395,\n", + " 0.039520264,\n", + " 0.05230713,\n", + " 0.022979736,\n", + " -0.0062217712,\n", + " 0.019866943,\n", + " 0.055358887,\n", + " -0.022857666,\n", + " 0.038635254,\n", + " -0.006832123,\n", + " -0.038635254,\n", + " 0.04598999,\n", + " -0.0047035217,\n", + " 0.012420654,\n", + " 0.029449463,\n", + " -0.007286072,\n", + " 0.05682373,\n", + " -0.009811401,\n", + " 0.006099701,\n", + " 0.0053367615,\n", + " -0.031463623,\n", + " 0.007286072,\n", + " 0.008415222,\n", + " -0.0090408325,\n", + " -0.020095825,\n", + " 0.0070877075,\n", + " -0.019561768,\n", + " 0.012832642,\n", + " 0.052520752,\n", + " -0.011459351,\n", + " 0.04360962,\n", + " 0.010063171,\n", + " -0.007484436,\n", + " 0.010253906,\n", + " 0.048583984,\n", + " 0.03781128,\n", + " -0.05908203,\n", + " -0.06384277,\n", + " -0.017150879,\n", + " -0.031402588,\n", + " 0.024490356,\n", + " 0.02218628,\n", + " -0.003982544,\n", + " -0.005794525,\n", + " -0.027740479,\n", + " 0.008972168,\n", + " -0.01953125,\n", + " 0.048675537,\n", + " -0.008239746,\n", + " -0.009422302,\n", + " -0.012069702,\n", + " -0.024505615,\n", + " -0.008514404,\n", + " 0.026885986,\n", + " -0.07513428,\n", + " 0.00573349,\n", + " -0.019805908,\n", + " 0.02407837,\n", + " -0.005882263,\n", + " 0.011581421,\n", + " 0.0035991669,\n", + " -0.016860962,\n", + " 0.026443481,\n", + " -0.006252289,\n", + " 0.011428833,\n", + " -0.0069885254,\n", + " -0.04550171,\n", + " 0.039978027,\n", + " -0.08087158,\n", + " -0.020767212,\n", + " -0.007637024,\n", + " 0.07946777,\n", + " -0.025283813,\n", + " -0.001364708,\n", + " 0.016693115,\n", + " 0.03656006,\n", + " -0.016860962,\n", + " 0.07019043,\n", + " -0.06274414,\n", + " -0.019378662,\n", + " -0.0058021545,\n", + " -0.013786316,\n", + " 0.014953613,\n", + " 0.0093688965,\n", + " -0.012504578,\n", + " -0.05380249,\n", + " 0.052215576,\n", + " 0.016708374,\n", + " 0.038208008,\n", + " 0.01398468,\n", + " -0.0073890686,\n", + " 0.023406982,\n", + " -0.004333496,\n", + " -0.019180298,\n", + " 0.046722412,\n", + " -0.006801605,\n", + " -0.03933716,\n", + " 0.04711914,\n", + " 0.009056091,\n", + " 0.013801575,\n", + " 0.017318726,\n", + " -0.0096588135,\n", + " 0.011734009,\n", + " 0.040618896,\n", + " -0.006893158,\n", + " 0.033355713,\n", + " -0.05581665,\n", + " 0.038848877,\n", + " 0.026657104,\n", + " 0.014122009,\n", + " 0.0055351257,\n", + " -0.0029411316,\n", + " 0.009292603,\n", + " -0.024841309,\n", + " -0.075805664,\n", + " -0.020736694,\n", + " 0.076660156,\n", + " -0.041168213,\n", + " -0.042510986,\n", + " -0.03781128,\n", + " 0.070129395,\n", + " -0.00598526,\n", + " -0.0019512177,\n", + " 0.008598328,\n", + " -0.023513794,\n", + " 0.015365601,\n", + " -0.059906006,\n", + " 0.0061950684,\n", + " 0.016586304,\n", + " -0.019134521,\n", + " -0.017807007,\n", + " -0.028549194,\n", + " 0.02798462,\n", + " 0.029830933,\n", + " -0.011627197,\n", + " 0.041900635,\n", + " -0.023483276,\n", + " -0.002779007,\n", + " 0.06341553,\n", + " -0.02822876,\n", + " -0.025421143,\n", + " 0.00881958,\n", + " 0.0496521,\n", + " -0.01889038,\n", + " -0.008346558,\n", + " 0.03652954,\n", + " -0.0058288574,\n", + " 0.055541992,\n", + " 0.028015137,\n", + " 0.0033550262,\n", + " -0.021881104,\n", + " -0.0053100586,\n", + " 0.006160736,\n", + " -0.003446579,\n", + " -0.005168915,\n", + " -0.022277832,\n", + " 0.030548096,\n", + " 0.020584106,\n", + " 0.012069702,\n", + " 0.0014572144,\n", + " 0.01687622,\n", + " -0.02067566,\n", + " -0.07885742,\n", + " 0.0034484863,\n", + " 0.015075684,\n", + " -0.030303955,\n", + " -0.020553589,\n", + " 0.003414154,\n", + " 0.032836914,\n", + " 0.0015439987,\n", + " -0.009712219,\n", + " -0.082458496,\n", + " -0.040496826,\n", + " -0.0024108887,\n", + " -0.05130005,\n", + " -0.032592773,\n", + " 0.0014181137,\n", + " -0.004875183,\n", + " -0.025970459,\n", + " 0.022262573,\n", + " 0.0046958923,\n", + " 0.05255127,\n", + " -0.032470703,\n", + " 0.013687134,\n", + " -0.021774292,\n", + " 0.0039863586,\n", + " 0.005138397,\n", + " -0.035461426,\n", + " -0.008262634,\n", + " -0.059051514,\n", + " 0.01927185,\n", + " -0.0093688965,\n", + " 0.03604126,\n", + " -0.052215576,\n", + " -0.03366089,\n", + " -0.015571594,\n", + " -0.0024204254,\n", + " 0.026107788,\n", + " -0.0037174225,\n", + " 0.013389587,\n", + " -0.025939941,\n", + " -0.008003235,\n", + " -0.042266846,\n", + " 0.009101868,\n", + " 0.018859863,\n", + " 0.035308838,\n", + " 0.00019907951,\n", + " -0.050872803,\n", + " 0.0079193115,\n", + " -0.0041389465,\n", + " -0.0061798096,\n", + " 0.033111572,\n", + " -0.04034424,\n", + " -0.0029315948,\n", + " -0.0032234192,\n", + " -0.024978638,\n", + " -0.0670166,\n", + " -0.0062217712,\n", + " -0.0015144348,\n", + " -0.030593872,\n", + " 0.031707764,\n", + " -0.017791748,\n", + " -0.003004074,\n", + " 0.03060913,\n", + " 0.030136108,\n", + " -0.00071048737,\n", + " 0.04525757,\n", + " 0.0005903244,\n", + " 0.040893555,\n", + " -0.034057617,\n", + " 0.0069389343,\n", + " -0.013198853,\n", + " -0.013175964,\n", + " -0.007129669,\n", + " 0.020889282,\n", + " -0.028564453,\n", + " 0.00023853779,\n", + " 0.023544312,\n", + " -0.0050582886,\n", + " -0.010261536,\n", + " -0.012283325,\n", + " -0.027053833,\n", + " -0.010604858,\n", + " -0.019546509,\n", + " 0.016921997,\n", + " 0.027877808,\n", + " 0.03643799,\n", + " -0.020263672,\n", + " 0.024932861,\n", + " 0.036071777,\n", + " 0.0041503906,\n", + " 0.061828613,\n", + " 0.021850586,\n", + " 0.014480591,\n", + " -0.02734375,\n", + " -0.03677368,\n", + " 0.037139893,\n", + " 0.0007696152,\n", + " -0.020401001,\n", + " -0.002729416,\n", + " -0.02166748,\n", + " 0.019119263,\n", + " -0.02130127,\n", + " 0.0012197495,\n", + " 0.01260376,\n", + " -0.0131073,\n", + " -0.01473999,\n", + " 0.039733887,\n", + " 0.008926392,\n", + " -0.028961182,\n", + " -0.0059165955,\n", + " -0.009780884,\n", + " 0.07550049,\n", + " 0.004436493,\n", + " 0.016143799,\n", + " 0.059051514,\n", + " 0.0042381287,\n", + " 0.0112838745,\n", + " 0.0040779114,\n", + " 0.024902344,\n", + " -0.025665283,\n", + " 0.020523071,\n", + " -0.018554688,\n", + " 0.028808594,\n", + " 0.010810852,\n", + " -0.029083252,\n", + " 0.019348145,\n", + " -0.026184082,\n", + " 0.047180176,\n", + " 0.018692017,\n", + " 0.02420044,\n", + " 0.01776123,\n", + " -0.02229309,\n", + " -0.03161621,\n", + " 0.020690918,\n", + " 0.020095825,\n", + " 0.05026245,\n", + " 0.052825928,\n", + " -0.027801514,\n", + " 0.038909912,\n", + " -0.028289795,\n", + " -0.011764526,\n", + " 0.07318115,\n", + " 0.03704834,\n", + " -0.04159546,\n", + " -0.035064697,\n", + " 0.048431396,\n", + " 0.031829834,\n", + " -0.039367676,\n", + " 0.008476257,\n", + " 0.023345947,\n", + " 0.035949707,\n", + " -0.0019168854,\n", + " -0.0066719055,\n", + " 0.031585693,\n", + " 0.039245605,\n", + " -0.013580322,\n", + " 0.00655365,\n", + " -0.045928955,\n", + " 0.03161621,\n", + " -0.0041122437,\n", + " 0.021331787,\n", + " -0.015312195,\n", + " 0.03390503,\n", + " 0.030273438,\n", + " -0.034973145,\n", + " 0.038238525,\n", + " 0.015052795,\n", + " -0.013908386,\n", + " 0.026916504,\n", + " 0.007167816,\n", + " 0.07043457,\n", + " 0.010368347,\n", + " -0.021118164,\n", + " -0.008613586,\n", + " 0.045196533,\n", + " 0.0104904175,\n", + " 0.056030273,\n", + " -0.0418396,\n", + " 0.0042495728,\n", + " -0.0012893677,\n", + " 0.011917114,\n", + " 0.035583496,\n", + " 0.002588272,\n", + " -0.023132324,\n", + " 0.041992188,\n", + " 0.022781372,\n", + " -0.030517578,\n", + " 0.006565094,\n", + " -0.037017822,\n", + " 0.03881836,\n", + " 0.038909912,\n", + " 0.006801605,\n", + " -0.008758545,\n", + " 0.012046814,\n", + " -0.017471313,\n", + " 0.027542114,\n", + " 0.00087213516,\n", + " -0.019348145,\n", + " 0.04437256,\n", + " -0.00617218,\n", + " -0.036956787,\n", + " 0.026565552,\n", + " 0.031082153,\n", + " 0.009681702,\n", + " -0.011047363,\n", + " -0.05935669,\n", + " -0.018615723,\n", + " 0.024902344,\n", + " 0.017837524,\n", + " 0.006416321,\n", + " 0.046966553,\n", + " -0.033050537,\n", + " -0.0058403015,\n", + " 0.03149414,\n", + " -0.06011963,\n", + " -0.018081665,\n", + " -0.049926758,\n", + " -0.009986877,\n", + " -0.043060303,\n", + " 0.020874023,\n", + " -0.041168213,\n", + " -0.024429321,\n", + " -0.00038290024,\n", + " -0.047027588,\n", + " 0.0340271,\n", + " -0.00856781,\n", + " 0.01525116,\n", + " -0.00970459,\n", + " -0.0028133392,\n", + " -0.059783936,\n", + " 0.044311523,\n", + " -0.015548706,\n", + " 0.013824463,\n", + " 0.016082764,\n", + " -0.028930664,\n", + " -0.0074882507,\n", + " -0.064941406,\n", + " -0.01739502,\n", + " -0.00065517426,\n", + " 0.005630493,\n", + " -0.052764893,\n", + " -0.005580902,\n", + " -0.0068626404,\n", + " 0.0027008057,\n", + " -0.035064697,\n", + " 0.01689148,\n", + " -0.05895996,\n", + " -0.032287598,\n", + " 0.036621094,\n", + " -0.029159546,\n", + " -0.012275696,\n", + " -0.0028133392,\n", + " 0.028884888,\n", + " 0.02659607,\n", + " 0.04977417,\n", + " -0.026306152,\n", + " 0.034942627,\n", + " -0.008613586,\n", + " -0.0024147034,\n", + " -0.012290955,\n", + " -0.008804321,\n", + " 0.0031795502,\n", + " 0.0025577545,\n", + " -0.00015699863,\n", + " -0.030136108,\n", + " 0.026885986,\n", + " -0.0284729,\n", + " -0.033966064,\n", + " -0.01159668,\n", + " 0.0008702278,\n", + " 0.043914795,\n", + " -0.035186768,\n", + " -0.07171631,\n", + " 0.024627686,\n", + " -0.012756348,\n", + " 0.029571533,\n", + " -0.03881836,\n", + " -0.046447754,\n", + " 0.009559631,\n", + " 0.043304443,\n", + " 0.02243042,\n", + " 0.044677734,\n", + " -0.0068206787,\n", + " -0.008049011,\n", + " -0.06402588,\n", + " 0.015823364,\n", + " -0.027572632,\n", + " -0.00065135956,\n", + " 0.006210327,\n", + " -0.0049858093,\n", + " 0.019973755,\n", + " -0.007888794,\n", + " -0.041900635,\n", + " 0.029434204,\n", + " 0.029953003,\n", + " -0.039245605,\n", + " 0.009498596,\n", + " 0.006980896,\n", + " -0.033111572,\n", + " 0.004558563,\n", + " -0.0065841675,\n", + " 0.04071045,\n", + " 0.014389038,\n", + " 0.041748047,\n", + " -0.016189575,\n", + " 0.041931152,\n", + " -0.033996582,\n", + " -0.02027893,\n", + " 0.031066895,\n", + " -0.01550293,\n", + " -0.051483154,\n", + " 0.0002156496,\n", + " -0.032562256,\n", + " -0.033111572,\n", + " 0.030014038,\n", + " 0.009513855,\n", + " 0.012870789,\n", + " -0.024017334,\n", + " -0.0027999878,\n", + " 0.020828247,\n", + " ...],\n", + " [0.005279541,\n", + " -0.011100769,\n", + " -0.03100586,\n", + " -0.062408447,\n", + " 0.055603027,\n", + " -0.0082473755,\n", + " -0.028884888,\n", + " -0.0073928833,\n", + " 0.0287323,\n", + " 0.005592346,\n", + " -0.02406311,\n", + " 0.046966553,\n", + " -0.0440979,\n", + " -0.014083862,\n", + " 0.00756073,\n", + " 0.004085541,\n", + " -0.010627747,\n", + " 0.0071907043,\n", + " -0.021774292,\n", + " -0.03555298,\n", + " -0.02458191,\n", + " -0.043518066,\n", + " -0.002002716,\n", + " 0.012878418,\n", + " 0.010467529,\n", + " -0.005771637,\n", + " -0.03768921,\n", + " 0.016326904,\n", + " -0.04446411,\n", + " 0.004219055,\n", + " -0.006790161,\n", + " 0.06210327,\n", + " 0.02798462,\n", + " 0.013404846,\n", + " 0.013725281,\n", + " -0.016113281,\n", + " -0.03817749,\n", + " 0.0017538071,\n", + " -0.01626587,\n", + " 0.018157959,\n", + " 0.00090789795,\n", + " 0.009986877,\n", + " -0.0758667,\n", + " -0.029800415,\n", + " -0.10449219,\n", + " -0.022888184,\n", + " -0.046325684,\n", + " 0.00094509125,\n", + " 0.031311035,\n", + " 0.016525269,\n", + " 0.037353516,\n", + " -0.040924072,\n", + " -0.018951416,\n", + " 0.04119873,\n", + " -0.02368164,\n", + " 0.014427185,\n", + " -0.00983429,\n", + " 0.009010315,\n", + " 0.003944397,\n", + " 0.03756714,\n", + " 0.003353119,\n", + " -0.02532959,\n", + " 0.05142212,\n", + " 0.0034103394,\n", + " -0.051208496,\n", + " 0.0064964294,\n", + " 0.013534546,\n", + " 0.016189575,\n", + " 0.03366089,\n", + " -0.012519836,\n", + " -0.026428223,\n", + " 0.019165039,\n", + " 0.006137848,\n", + " -0.027526855,\n", + " 0.0024547577,\n", + " 0.005836487,\n", + " 0.060028076,\n", + " 0.059326172,\n", + " -0.016494751,\n", + " 0.020690918,\n", + " -0.017608643,\n", + " -0.038513184,\n", + " -0.022369385,\n", + " -0.034210205,\n", + " -0.0088272095,\n", + " -0.01676941,\n", + " 0.0068244934,\n", + " -0.032073975,\n", + " 0.009429932,\n", + " -0.06347656,\n", + " -0.022216797,\n", + " 0.058410645,\n", + " -0.036224365,\n", + " 0.01979065,\n", + " -0.033599854,\n", + " 0.01499939,\n", + " -0.0030174255,\n", + " 0.05142212,\n", + " -0.050445557,\n", + " -0.03439331,\n", + " 0.0034809113,\n", + " -0.0035152435,\n", + " -0.04071045,\n", + " 0.008094788,\n", + " -0.002735138,\n", + " 0.02619934,\n", + " -0.004173279,\n", + " -0.0009441376,\n", + " -0.011680603,\n", + " 0.05319214,\n", + " 0.009651184,\n", + " 0.0146102905,\n", + " 0.008483887,\n", + " -0.027160645,\n", + " -0.021194458,\n", + " -0.0020809174,\n", + " -0.023971558,\n", + " 0.03173828,\n", + " 0.034973145,\n", + " 0.021987915,\n", + " -0.0043907166,\n", + " -0.0040359497,\n", + " 0.020645142,\n", + " -0.03866577,\n", + " -0.00082731247,\n", + " 0.009811401,\n", + " -0.024536133,\n", + " -0.009819031,\n", + " 0.004558563,\n", + " -0.0115737915,\n", + " -0.0044517517,\n", + " 0.011886597,\n", + " -0.11450195,\n", + " -0.06903076,\n", + " -0.06323242,\n", + " 0.031341553,\n", + " 0.0010623932,\n", + " -0.018966675,\n", + " -0.03225708,\n", + " 0.044281006,\n", + " -0.013153076,\n", + " -0.022918701,\n", + " 0.00945282,\n", + " -0.02772522,\n", + " -0.012031555,\n", + " 0.0067825317,\n", + " 0.046936035,\n", + " -0.017456055,\n", + " -0.05014038,\n", + " -0.010429382,\n", + " -0.026412964,\n", + " 0.008636475,\n", + " 0.03781128,\n", + " 0.026031494,\n", + " -0.060058594,\n", + " 0.039642334,\n", + " -0.13256836,\n", + " 0.026947021,\n", + " -0.031082153,\n", + " 0.02607727,\n", + " 0.011367798,\n", + " 0.0032539368,\n", + " -0.0022716522,\n", + " -0.04156494,\n", + " 0.052581787,\n", + " 0.005252838,\n", + " -0.07879639,\n", + " 0.04550171,\n", + " 0.027191162,\n", + " 0.029968262,\n", + " -0.020126343,\n", + " -0.0004284382,\n", + " 0.0028247833,\n", + " 0.0008378029,\n", + " -0.017562866,\n", + " 0.0012960434,\n", + " 0.075805664,\n", + " 0.0011138916,\n", + " 0.052459717,\n", + " 0.01889038,\n", + " -0.03640747,\n", + " -0.022644043,\n", + " 0.066467285,\n", + " 0.050964355,\n", + " -0.0021533966,\n", + " -0.025756836,\n", + " 0.025878906,\n", + " -0.013442993,\n", + " 0.02218628,\n", + " 0.032470703,\n", + " -0.03781128,\n", + " -0.007911682,\n", + " -0.03164673,\n", + " -0.0692749,\n", + " -0.02130127,\n", + " -0.011993408,\n", + " 0.023895264,\n", + " 0.021347046,\n", + " -0.01977539,\n", + " 0.040649414,\n", + " -0.0035705566,\n", + " -0.008842468,\n", + " 0.032287598,\n", + " -0.008781433,\n", + " 0.021957397,\n", + " -0.0018177032,\n", + " -0.02041626,\n", + " 0.035491943,\n", + " 0.009185791,\n", + " 0.036010742,\n", + " 0.014892578,\n", + " -0.014091492,\n", + " -0.029006958,\n", + " 0.023712158,\n", + " -0.026611328,\n", + " -0.029464722,\n", + " -0.0025520325,\n", + " 0.0050086975,\n", + " 0.018676758,\n", + " 0.04385376,\n", + " 0.030685425,\n", + " -0.028656006,\n", + " 0.0031833649,\n", + " 0.044921875,\n", + " 0.007019043,\n", + " 0.0051193237,\n", + " -0.025939941,\n", + " -0.024612427,\n", + " 0.005897522,\n", + " 0.017822266,\n", + " 0.02520752,\n", + " 0.009773254,\n", + " 0.036712646,\n", + " 0.0015420914,\n", + " -0.04345703,\n", + " -0.029937744,\n", + " 0.011802673,\n", + " 0.040252686,\n", + " 0.0074539185,\n", + " -0.006290436,\n", + " 0.008590698,\n", + " -0.023956299,\n", + " -0.013343811,\n", + " 0.030456543,\n", + " -0.017547607,\n", + " -0.011016846,\n", + " 0.0076446533,\n", + " 0.008384705,\n", + " 0.03918457,\n", + " 0.021316528,\n", + " 0.068237305,\n", + " 0.017868042,\n", + " 0.08270264,\n", + " -0.012382507,\n", + " 0.0002259016,\n", + " 0.10076904,\n", + " -0.0066184998,\n", + " 0.01448822,\n", + " -0.0087509155,\n", + " 0.023040771,\n", + " -0.04067993,\n", + " 0.014945984,\n", + " -0.01083374,\n", + " 0.014175415,\n", + " -0.05102539,\n", + " 0.019683838,\n", + " -0.01675415,\n", + " 0.0027637482,\n", + " 0.016204834,\n", + " 0.011550903,\n", + " 0.027557373,\n", + " 0.007396698,\n", + " 0.0058250427,\n", + " 0.007896423,\n", + " 0.005756378,\n", + " 0.0011634827,\n", + " 0.011360168,\n", + " -0.018981934,\n", + " 0.01751709,\n", + " -0.027374268,\n", + " -0.05014038,\n", + " -0.012489319,\n", + " 0.018417358,\n", + " 0.022323608,\n", + " 0.00025725365,\n", + " 0.037200928,\n", + " 0.02178955,\n", + " -0.012901306,\n", + " 0.02545166,\n", + " -0.029418945,\n", + " 0.041534424,\n", + " 0.0067749023,\n", + " 0.020965576,\n", + " -0.004383087,\n", + " -0.0129470825,\n", + " -0.006542206,\n", + " 0.07232666,\n", + " 0.07373047,\n", + " -0.034179688,\n", + " 0.034301758,\n", + " -0.012916565,\n", + " 0.030288696,\n", + " 0.022460938,\n", + " -0.054138184,\n", + " 0.004184723,\n", + " 0.050048828,\n", + " -0.002243042,\n", + " 0.0259552,\n", + " -0.03164673,\n", + " -0.03930664,\n", + " -0.018707275,\n", + " 0.028305054,\n", + " -0.015914917,\n", + " -0.052947998,\n", + " 0.0040740967,\n", + " -0.04937744,\n", + " -0.0048103333,\n", + " -0.022827148,\n", + " -0.021453857,\n", + " 0.0019187927,\n", + " 0.017196655,\n", + " -0.014945984,\n", + " -0.07611084,\n", + " -0.023834229,\n", + " 0.0005040169,\n", + " -0.022216797,\n", + " -0.009063721,\n", + " -0.04888916,\n", + " -0.044281006,\n", + " 0.007888794,\n", + " 0.06665039,\n", + " 0.01512146,\n", + " 0.02909851,\n", + " -0.047698975,\n", + " -0.0032539368,\n", + " -0.037597656,\n", + " -0.009361267,\n", + " 0.017120361,\n", + " -0.027191162,\n", + " 0.031707764,\n", + " 0.052124023,\n", + " -0.021530151,\n", + " 0.036834717,\n", + " -0.030151367,\n", + " 0.0023460388,\n", + " -0.039093018,\n", + " 0.0007839203,\n", + " 0.053009033,\n", + " -0.00024044514,\n", + " -0.019012451,\n", + " 0.023605347,\n", + " -0.030838013,\n", + " -0.042755127,\n", + " 0.040405273,\n", + " 0.076660156,\n", + " -0.040039062,\n", + " -0.009277344,\n", + " 0.018325806,\n", + " 0.07476807,\n", + " -0.04876709,\n", + " -0.003921509,\n", + " 0.0033035278,\n", + " -0.04095459,\n", + " -0.04446411,\n", + " -0.003993988,\n", + " -0.014465332,\n", + " 0.009841919,\n", + " -0.009735107,\n", + " -0.011268616,\n", + " 0.06524658,\n", + " -0.019424438,\n", + " -0.028152466,\n", + " 0.008430481,\n", + " 0.007297516,\n", + " -0.022567749,\n", + " 0.012680054,\n", + " 0.009674072,\n", + " -0.04815674,\n", + " -0.018814087,\n", + " -1.7642975e-05,\n", + " -0.017822266,\n", + " 0.023117065,\n", + " 0.0012245178,\n", + " -4.351139e-06,\n", + " 0.055511475,\n", + " 0.002943039,\n", + " -0.026473999,\n", + " -0.0074501038,\n", + " 0.055664062,\n", + " 0.0076560974,\n", + " -0.020141602,\n", + " -0.011505127,\n", + " -0.032196045,\n", + " 0.020446777,\n", + " -0.0071983337,\n", + " 0.022338867,\n", + " 0.0029754639,\n", + " -0.028381348,\n", + " -0.12237549,\n", + " -0.041412354,\n", + " 0.033050537,\n", + " 0.013214111,\n", + " -0.017074585,\n", + " -0.020187378,\n", + " -0.053710938,\n", + " 0.03366089,\n", + " 0.009017944,\n", + " -0.011352539,\n", + " 0.04852295,\n", + " 0.06210327,\n", + " -0.02079773,\n", + " 0.07006836,\n", + " -0.015037537,\n", + " -8.517504e-05,\n", + " -0.006713867,\n", + " 0.015174866,\n", + " -0.055786133,\n", + " 0.034576416,\n", + " -0.012107849,\n", + " -0.0009713173,\n", + " -0.009376526,\n", + " -0.008987427,\n", + " -0.025939941,\n", + " 0.027999878,\n", + " 0.00077581406,\n", + " 0.012870789,\n", + " 0.014297485,\n", + " 0.058135986,\n", + " 0.0011892319,\n", + " -0.03125,\n", + " -0.02017212,\n", + " -0.02532959,\n", + " -0.040161133,\n", + " -0.0002529621,\n", + " -0.026535034,\n", + " -0.019042969,\n", + " -0.033325195,\n", + " 0.019592285,\n", + " -0.016860962,\n", + " -0.014633179,\n", + " -7.7307224e-05,\n", + " -0.02784729,\n", + " 0.0039100647,\n", + " -0.017608643,\n", + " 0.025482178,\n", + " 0.0025234222,\n", + " 0.023529053,\n", + " 0.027313232,\n", + " -0.07019043,\n", + " -0.008880615,\n", + " -0.023010254,\n", + " 0.014953613,\n", + " -0.01890564,\n", + " 0.03366089,\n", + " -0.003692627,\n", + " 0.048339844,\n", + " 0.011009216,\n", + " -0.019210815,\n", + " 0.030929565,\n", + " 0.023849487,\n", + " -0.0034637451,\n", + " 0.01386261,\n", + " -0.054382324,\n", + " -0.012420654,\n", + " 0.017196655,\n", + " 0.007545471,\n", + " 0.034820557,\n", + " 0.0012159348,\n", + " -0.020050049,\n", + " 0.022033691,\n", + " -0.024490356,\n", + " 0.03881836,\n", + " 0.02684021,\n", + " -0.0038280487,\n", + " 0.041381836,\n", + " 0.0647583,\n", + " -0.04537964,\n", + " -0.021499634,\n", + " -0.07122803,\n", + " 0.030227661,\n", + " 0.054748535,\n", + " -0.015464783,\n", + " 0.021026611,\n", + " -0.04852295,\n", + " -0.03314209,\n", + " 0.01260376,\n", + " -0.12261963,\n", + " -0.016571045,\n", + " -0.028305054,\n", + " -0.030914307,\n", + " -0.08746338,\n", + " -0.016921997,\n", + " 0.022720337,\n", + " -0.059753418,\n", + " -0.043884277,\n", + " 0.01927185,\n", + " -0.010215759,\n", + " -0.062805176,\n", + " 0.0011644363,\n", + " -0.02607727,\n", + " -0.092163086,\n", + " 0.023422241,\n", + " 0.022079468,\n", + " -0.010032654,\n", + " 0.02067566,\n", + " -0.009880066,\n", + " -0.03086853,\n", + " 0.00381279,\n", + " 0.048614502,\n", + " -0.0028858185,\n", + " 0.01852417,\n", + " -0.03149414,\n", + " 0.026870728,\n", + " 0.0113220215,\n", + " -0.03363037,\n", + " 0.008125305,\n", + " 0.026504517,\n", + " 0.017456055,\n", + " -0.020401001,\n", + " -0.011642456,\n", + " 0.01108551,\n", + " 0.0140686035,\n", + " 0.03491211,\n", + " -0.007709503,\n", + " 0.00554657,\n", + " 0.01965332,\n", + " 0.0011415482,\n", + " 0.0031032562,\n", + " -0.015640259,\n", + " 0.01133728,\n", + " 0.018737793,\n", + " -0.008956909,\n", + " 0.03567505,\n", + " 0.0039253235,\n", + " 0.02748108,\n", + " 0.042236328,\n", + " -0.031433105,\n", + " 0.014762878,\n", + " 0.040130615,\n", + " -0.03302002,\n", + " -0.023666382,\n", + " -0.034576416,\n", + " -0.0035209656,\n", + " 0.009254456,\n", + " -0.031677246,\n", + " -0.0068511963,\n", + " -0.016494751,\n", + " 0.0062179565,\n", + " -0.045684814,\n", + " -0.012954712,\n", + " 0.010917664,\n", + " 0.0025482178,\n", + " -0.010978699,\n", + " 0.035827637,\n", + " 0.005683899,\n", + " -0.0395813,\n", + " -0.040771484,\n", + " 0.002532959,\n", + " -0.006160736,\n", + " -0.002571106,\n", + " 0.041748047,\n", + " -0.032836914,\n", + " 0.01637268,\n", + " -0.022476196,\n", + " 0.024673462,\n", + " -0.022262573,\n", + " 0.014167786,\n", + " -0.018630981,\n", + " 0.015022278,\n", + " -0.04269409,\n", + " 0.020370483,\n", + " -0.025009155,\n", + " 0.010856628,\n", + " -0.047668457,\n", + " -0.03817749,\n", + " 0.006160736,\n", + " 0.03189087,\n", + " -0.014625549,\n", + " -0.022644043,\n", + " 0.017227173,\n", + " 0.05456543,\n", + " 0.07574463,\n", + " -0.043914795,\n", + " 0.048797607,\n", + " -0.020889282,\n", + " -0.011482239,\n", + " 0.034210205,\n", + " -0.038909912,\n", + " -0.0095825195,\n", + " -0.022094727,\n", + " 0.028564453,\n", + " -0.040618896,\n", + " 0.009567261,\n", + " -0.0287323,\n", + " 0.05419922,\n", + " 0.0027618408,\n", + " 0.07824707,\n", + " -0.0064086914,\n", + " 0.018066406,\n", + " 0.01373291,\n", + " -0.0038394928,\n", + " -0.009391785,\n", + " 0.001376152,\n", + " -0.020431519,\n", + " -0.04788208,\n", + " 0.03942871,\n", + " 0.03353882,\n", + " 0.024749756,\n", + " -0.029891968,\n", + " 7.075071e-05,\n", + " 0.013206482,\n", + " -0.015220642,\n", + " 0.01436615,\n", + " -0.0007843971,\n", + " 0.010482788,\n", + " -0.011756897,\n", + " 0.020904541,\n", + " 0.033966064,\n", + " -0.05291748,\n", + " -0.020309448,\n", + " -0.034088135,\n", + " -0.002986908,\n", + " 0.023834229,\n", + " -0.051239014,\n", + " 0.016281128,\n", + " -0.020385742,\n", + " 0.007888794,\n", + " -0.009223938,\n", + " -0.050842285,\n", + " 0.0032978058,\n", + " -0.053649902,\n", + " 0.027175903,\n", + " -0.04840088,\n", + " -0.04058838,\n", + " -0.0036449432,\n", + " 0.0758667,\n", + " -0.06695557,\n", + " -0.020019531,\n", + " -0.008163452,\n", + " 0.05355835,\n", + " -0.011497498,\n", + " 0.032562256,\n", + " 0.023376465,\n", + " 0.02406311,\n", + " -0.0001347065,\n", + " -0.07342529,\n", + " -0.0016431808,\n", + " 0.02758789,\n", + " -0.034301758,\n", + " 0.016189575,\n", + " -0.023590088,\n", + " 0.044891357,\n", + " 0.012863159,\n", + " 0.0055160522,\n", + " 0.045928955,\n", + " 0.0033550262,\n", + " 0.00025177002,\n", + " 0.009719849,\n", + " -0.02166748,\n", + " -0.06274414,\n", + " -0.022766113,\n", + " 0.023544312,\n", + " -0.017089844,\n", + " 0.0044937134,\n", + " -0.020614624,\n", + " 0.01411438,\n", + " 0.01979065,\n", + " 0.07086182,\n", + " -0.034851074,\n", + " 0.04244995,\n", + " -0.0063972473,\n", + " -0.02293396,\n", + " -0.0524292,\n", + " -0.03262329,\n", + " -0.018722534,\n", + " 0.0015068054,\n", + " 0.01687622,\n", + " 0.027069092,\n", + " -0.021957397,\n", + " -0.027999878,\n", + " 0.008392334,\n", + " -0.028152466,\n", + " 0.011672974,\n", + " 0.025756836,\n", + " -0.037078857,\n", + " -0.011100769,\n", + " -0.011924744,\n", + " -0.006855011,\n", + " 0.009925842,\n", + " -0.014968872,\n", + " -0.030715942,\n", + " -0.0019273758,\n", + " -0.009468079,\n", + " -0.05606079,\n", + " 0.0002861023,\n", + " 0.019454956,\n", + " -0.022216797,\n", + " -0.054901123,\n", + " 0.0053482056,\n", + " -0.009635925,\n", + " 0.016403198,\n", + " -0.0209198,\n", + " 0.019012451,\n", + " -0.038116455,\n", + " 0.03253174,\n", + " 0.008544922,\n", + " -0.0070991516,\n", + " -0.024734497,\n", + " -0.027511597,\n", + " 0.010932922,\n", + " 0.037200928,\n", + " 0.05291748,\n", + " -0.0052833557,\n", + " -0.013504028,\n", + " -0.015235901,\n", + " -0.06359863,\n", + " -0.010223389,\n", + " -0.027893066,\n", + " -0.021820068,\n", + " -0.032562256,\n", + " -0.0082473755,\n", + " -0.031585693,\n", + " 0.025527954,\n", + " 0.0057144165,\n", + " 0.0340271,\n", + " -0.017501831,\n", + " -0.036468506,\n", + " 0.017944336,\n", + " 0.02015686,\n", + " 0.0036945343,\n", + " 0.027572632,\n", + " 0.01676941,\n", + " 0.0058403015,\n", + " -0.010177612,\n", + " 0.01612854,\n", + " -0.038360596,\n", + " 0.011314392,\n", + " 0.033050537,\n", + " -0.022094727,\n", + " -0.024642944,\n", + " -0.07519531,\n", + " 0.00061035156,\n", + " 0.01878357,\n", + " 0.0023899078,\n", + " -0.0035076141,\n", + " 0.029769897,\n", + " 0.00054359436,\n", + " 0.003692627,\n", + " 0.0022525787,\n", + " 0.02796936,\n", + " 0.015899658,\n", + " 0.0021247864,\n", + " -0.010498047,\n", + " 0.028717041,\n", + " -0.0004696846,\n", + " 0.010543823,\n", + " 0.0390625,\n", + " -0.022247314,\n", + " -0.043701172,\n", + " -0.02696228,\n", + " -0.014663696,\n", + " -0.019515991,\n", + " -0.02458191,\n", + " -0.0038776398,\n", + " 0.029846191,\n", + " 0.03970337,\n", + " -0.0146484375,\n", + " -0.013397217,\n", + " 0.025054932,\n", + " -0.014190674,\n", + " 0.041137695,\n", + " 0.030136108,\n", + " 0.013542175,\n", + " -0.01713562,\n", + " -0.034210205,\n", + " 0.0072631836,\n", + " 0.009552002,\n", + " -0.027008057,\n", + " -0.01247406,\n", + " -0.012374878,\n", + " 0.005722046,\n", + " 0.017410278,\n", + " -0.030456543,\n", + " 0.0075531006,\n", + " -0.002691269,\n", + " -0.009925842,\n", + " 0.0725708,\n", + " -0.022735596,\n", + " -0.007232666,\n", + " 0.023803711,\n", + " -0.036071777,\n", + " 0.07525635,\n", + " 0.032592773,\n", + " -0.0032787323,\n", + " 0.041809082,\n", + " 0.008399963,\n", + " 0.034423828,\n", + " 0.005672455,\n", + " 0.06500244,\n", + " -0.012451172,\n", + " 0.02949524,\n", + " -0.020446777,\n", + " 0.005050659,\n", + " -0.022842407,\n", + " -0.036071777,\n", + " 0.0021247864,\n", + " -0.053710938,\n", + " 0.045013428,\n", + " 0.008773804,\n", + " 0.0041046143,\n", + " 0.023422241,\n", + " -0.009674072,\n", + " -0.062194824,\n", + " 0.06210327,\n", + " -0.011688232,\n", + " 0.07336426,\n", + " 0.019210815,\n", + " -0.0049972534,\n", + " -0.026016235,\n", + " -0.036193848,\n", + " -0.00856781,\n", + " 0.04827881,\n", + " 0.020523071,\n", + " -0.021636963,\n", + " -0.004421234,\n", + " 0.039855957,\n", + " 0.010444641,\n", + " -0.0340271,\n", + " 0.016525269,\n", + " -0.0013847351,\n", + " 0.006603241,\n", + " -0.012550354,\n", + " 0.006351471,\n", + " 0.0044784546,\n", + " 0.040039062,\n", + " 0.011253357,\n", + " 0.04043579,\n", + " -0.028259277,\n", + " -0.025741577,\n", + " 0.0138168335,\n", + " -0.0076904297,\n", + " -0.026687622,\n", + " -0.02798462,\n", + " 0.02142334,\n", + " -0.08380127,\n", + " 0.006839752,\n", + " -0.0032138824,\n", + " 0.014266968,\n", + " 0.031158447,\n", + " 0.006149292,\n", + " 0.03439331,\n", + " -0.0066604614,\n", + " -0.07067871,\n", + " -0.023788452,\n", + " 0.04397583,\n", + " 0.019927979,\n", + " 0.0435791,\n", + " -0.040008545,\n", + " 0.001613617,\n", + " -0.0022888184,\n", + " 0.029724121,\n", + " 0.0031337738,\n", + " 0.007347107,\n", + " 0.009056091,\n", + " 0.03805542,\n", + " -0.038604736,\n", + " -0.011405945,\n", + " -0.00096321106,\n", + " -0.0037212372,\n", + " -0.010505676,\n", + " 0.029037476,\n", + " -0.02017212,\n", + " -0.0039100647,\n", + " -0.028915405,\n", + " -0.047546387,\n", + " 0.062438965,\n", + " -0.023330688,\n", + " -0.04067993,\n", + " 0.03225708,\n", + " 0.0063095093,\n", + " -0.0075798035,\n", + " 0.0118255615,\n", + " 0.03201294,\n", + " -0.0058250427,\n", + " -0.0034599304,\n", + " -0.06744385,\n", + " -0.021713257,\n", + " 0.022720337,\n", + " 0.070495605,\n", + " -0.0184021,\n", + " 0.08679199,\n", + " -0.05670166,\n", + " -0.039978027,\n", + " 0.06890869,\n", + " -0.070251465,\n", + " 0.066589355,\n", + " -0.047668457,\n", + " 0.0060920715,\n", + " 0.022766113,\n", + " -0.008110046,\n", + " 0.016784668,\n", + " -0.022521973,\n", + " -0.010276794,\n", + " -0.012863159,\n", + " 0.013885498,\n", + " -0.023834229,\n", + " 0.016098022,\n", + " -0.010757446,\n", + " -0.002008438,\n", + " -0.012191772,\n", + " 0.06518555,\n", + " 0.027694702,\n", + " -0.024124146,\n", + " -0.03982544,\n", + " -0.018554688,\n", + " -0.029785156,\n", + " -0.0625,\n", + " -0.037109375,\n", + " -0.0039634705,\n", + " -0.05441284,\n", + " -0.06463623,\n", + " -0.00415802,\n", + " 0.0024547577,\n", + " -0.014694214,\n", + " 0.0059432983,\n", + " 0.008239746,\n", + " -0.0087509155,\n", + " -0.025146484,\n", + " -0.0013866425,\n", + " 0.005634308,\n", + " 0.020629883,\n", + " -0.006652832,\n", + " 0.0027256012,\n", + " -0.05883789,\n", + " 0.03463745,\n", + " -0.027023315,\n", + " 0.030654907,\n", + " -0.0056533813,\n", + " -0.032562256,\n", + " 0.025131226,\n", + " 0.009689331,\n", + " -0.011421204,\n", + " 0.018920898,\n", + " 0.025253296,\n", + " -0.012718201,\n", + " 0.02609253,\n", + " -0.0038604736,\n", + " -0.023269653,\n", + " -0.034057617,\n", + " -0.009338379,\n", + " 0.036376953,\n", + " -0.018920898,\n", + " -0.05807495,\n", + " -0.0018091202,\n", + " 0.048431396,\n", + " 0.033447266,\n", + " -0.07672119,\n", + " 0.016906738,\n", + " 0.0029792786,\n", + " 0.041656494,\n", + " 0.011108398,\n", + " 0.029663086,\n", + " 0.009124756,\n", + " -0.0015134811,\n", + " -0.0077934265,\n", + " 0.05621338,\n", + " -0.0074310303,\n", + " -0.026611328,\n", + " -0.042816162,\n", + " -0.024902344,\n", + " 0.04434204,\n", + " 0.011238098,\n", + " 0.002494812,\n", + " -0.00598526,\n", + " 0.026382446,\n", + " -0.02420044,\n", + " -0.004787445,\n", + " 0.018951416,\n", + " -0.02519226,\n", + " 0.020004272,\n", + " -0.0003745556,\n", + " 0.021820068,\n", + " 0.0076560974,\n", + " 0.002861023,\n", + " -0.024414062,\n", + " 0.017837524,\n", + " -0.0032653809,\n", + " 0.035614014,\n", + " 0.006061554,\n", + " 0.0027065277,\n", + " -0.012107849,\n", + " 0.08666992,\n", + " -0.035461426,\n", + " -0.050354004,\n", + " 0.0075187683,\n", + " 0.007205963,\n", + " -0.024124146,\n", + " 0.011100769,\n", + " -0.04446411,\n", + " -0.001789093,\n", + " ...]]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "embeddings.embed_documents([\"h\", \"b\"])" + ] + }, + { + "cell_type": "markdown", + "id": "77d271b6", "metadata": {}, - "outputs": [], "source": [ - "text = \"This is a test document.\"" + "## Indexing and Retrieval\n", + "\n", + "Embedding models are often used in retrieval-augmented generation (RAG) flows, both as part of indexing data as well as later retrieving it. For more detailed instructions, please see our RAG tutorials under the [working with external knowledge tutorials](/docs/tutorials/#working-with-external-knowledge).\n", + "\n", + "Below, see how to index and retrieve data using the `embeddings` object we initialized above. In this example, we will index and retrieve a sample document in the `InMemoryVectorStore`." ] }, { "cell_type": "code", - "execution_count": 5, - "id": "fbe167bf", + "execution_count": 3, + "id": "d817716b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'LangChain is the framework for building context-aware reasoning applications'" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Create a vector store with a sample text\n", + "from langchain_core.vectorstores import InMemoryVectorStore\n", + "\n", + "text = \"LangChain is the framework for building context-aware reasoning applications\"\n", + "\n", + "vectorstore = InMemoryVectorStore.from_texts(\n", + " [text],\n", + " embedding=embeddings,\n", + ")\n", + "\n", + "# Use the vectorstore as a retriever\n", + "retriever = vectorstore.as_retriever()\n", + "\n", + "# Retrieve the most similar text\n", + "retrieved_documents = retriever.invoke(\"What is LangChain?\")\n", + "\n", + "# show the retrieved document's content\n", + "retrieved_documents[0].page_content" + ] + }, + { + "cell_type": "markdown", + "id": "e02b9855", + "metadata": {}, + "source": [ + "## Direct Usage\n", + "\n", + "Under the hood, the vectorstore and retriever implementations are calling `embeddings.embed_documents(...)` and `embeddings.embed_query(...)` to create embeddings for the text(s) used in `from_texts` and retrieval `invoke` operations, respectively.\n", + "\n", + "You can directly call these methods to get embeddings for your own use cases.\n", + "\n", + "### Embed single texts\n", + "\n", + "You can embed single texts or documents with `embed_query`:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "0d2befcd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[-0.09338379, 0.0871582, -0.03326416, 0.01953125, 0.07702637, 0.034729004, -0.058380127, -0.031021118, -0.030517578, -0.055999756, 0.050842285, -0.006752014, 0.038391113, -0.0014362335, -0.041137695, -0.008880615, 0.026000977, -0.023010254, 0.05456543, -0.03366089, 0.055633545, 0.028579712, -0.068603516, 0.03970337, -0.06677246, 0.06732178, -0.013053894, -0.0060920715, 0.038116455, 0.057800293, 0.048736572, 0.026855469, 0.009849548, 0.08312988, 0.073791504, 0.01663208, -0.0871582, 0.01802063, -0.0020828247, -0.0031356812, 0.039978027, -0.03164673, 0.009796143, 0.011375427, 0.0068855286, 0.092285156, 0.05218506, -0.060943604, 0.038269043, -0.018218994, -0.04510498, -0.0847168, 0.008300781, -0.060058594, 0.0012111664, 0.05102539, 0.05218506, -0.047210693, -0.051239014, -0.044158936, -0.058166504, 0.07849121, -0.019165039, 0.06451416, 0.024887085, 0.011405945, -0.03768921, -0.018814087, -0.06829834, -0.052825928, -0.019104004, -0.021194458, 0.043518066, 0.07525635, 0.082336426, 0.0037651062, -0.0060310364, -0.03265381, 0.011375427, -0.013847351, -0.07232666, 0.02986145, 0.03866577, -0.029083252, 0.008666992, 0.03845215, 0.045196533, 0.012756348, -0.018051147, 0.032440186, -0.030715942, -0.045440674, -0.11187744, 0.032073975, 0.021972656, -0.044921875, -0.030410767, -0.03668213, 0.12420654, 0.05029297, -0.032989502, -0.049438477, 0.001704216, -0.08074951, 0.00046396255, -0.04107666, 0.020599365, -0.089416504, 0.020477295, -0.038726807, -0.04437256, -0.019256592, 0.048583984, 0.046020508, 0.03741455, -0.037475586, -0.050720215, 0.052856445, -0.10229492, -0.00010281801, 0.058776855, 0.021453857, -0.031051636, 0.01676941, 0.024047852, -0.026306152, 0.15258789, -0.09979248, 0.04888916, 0.045166016, 0.008865356, -0.043914795, -0.032928467, 0.0052757263, 0.06072998, 0.036956787, -0.058013916, 0.053466797, -0.03225708, 0.018371582, -0.0042533875, 0.047943115, 0.06530762, 0.039855957, -0.025360107, 0.047332764, -0.15124512, 0.08325195, 0.016174316, -0.029724121, 0.111816406, -0.05230713, -0.06964111, 0.03060913, -0.04257202, -0.0284729, 0.007843018, -0.03866577, 0.07867432, -0.04446411, 0.028869629, -0.015823364, 0.02659607, 0.085754395, 0.03878784, -0.04232788, 0.017074585, 0.026779175, -0.04284668, -0.017105103, 0.10058594, 0.022323608, -0.007007599, -0.09661865, -0.01322937, -0.004627228, 0.057800293, 0.057159424, -0.033294678, -0.066101074, 0.010910034, 0.033569336, -0.062042236, -0.0072021484, -0.070373535, 0.034729004, -0.07434082, -0.06604004, 0.061401367, 0.09576416, -0.070739746, 0.066833496, -0.019042969, -0.0051994324, -0.07696533, -0.03564453, 0.048614502, -0.048919678, 0.036224365, -0.06652832, 0.03338623, 0.05847168, 0.009414673, -0.035095215, 0.011787415, -0.007675171, -0.057006836, -0.045074463, -0.027999878, -0.049102783, -0.025787354, -0.010101318, -0.000813961, -0.009963989, -0.013343811, 0.04046631, 0.02758789, -0.07086182, 0.09442139, -0.012275696, -0.018936157, -0.011940002, 0.10638428, -0.10913086, 0.05606079, 0.008895874, 0.017089844, 0.019958496, 0.03173828, -0.037322998, 0.019699097, 0.046722412, -0.08959961, 0.059448242, 0.018875122, -0.057495117, -0.039276123, 0.009063721, -0.0178833, 0.032073975, -0.08178711, -0.061431885, 0.05731201, 0.012886047, -0.025360107, 0.04498291, 0.027923584, 0.125, 0.013374329, -0.013069153, -0.031677246, -0.109558105, 0.05731201, -0.03765869, 0.04650879, -0.005706787, 0.021697998, -0.0008239746, 0.030090332, -0.048736572, 0.07940674, -0.017120361, 0.018737793, 0.12011719, -0.03564453, 0.07519531, -0.039611816, -0.014968872, -0.045288086, 0.07702637, 0.010681152, -0.04736328, 0.07623291, 0.008071899, 0.080078125, -0.060516357, 0.043426514, -0.026489258, -0.018188477, 0.049560547, -0.068847656, -0.03387451, -0.09661865, -0.03768921, 0.028549194, 0.036621094, 0.05307007, -0.053894043, 0.0019035339, -0.07788086, -0.010597229, -0.027420044, 0.10900879, 0.019302368, -0.06726074, 0.04937744, 0.05154419, -0.050598145, 0.07562256, -0.05569458, 0.073913574, -0.052337646, -0.0149383545, -0.00037050247, 0.037322998, 0.018478394, -0.03201294, -0.04788208, 0.03062439, -0.055786133, 0.0018081665, 0.029510498, -0.10864258, -0.027374268, 0.040405273, 0.01474762, -0.010726929, -0.086242676, -0.02658081, -0.057159424, -0.0095825195, -0.11804199, -0.014289856, -0.006881714, -0.028533936, 0.005382538, -0.053771973, -0.015853882, 0.0034332275, -0.08441162, -0.028182983, -0.00856781, -0.060394287, -0.036590576, 0.03062439, 0.112854004, -0.008041382, -0.03353882, 0.0181427, -0.03466797, 0.026565552, -0.033813477, 0.0074310303, -0.02017212, -0.047729492, 0.00010108948, -0.032073975, 0.08630371, 0.08557129, -0.0115737915, 0.044067383, 0.062042236, 0.00819397, -0.016082764, 0.01574707, 0.0154418945, 0.06726074, 0.056884766, 0.01210022, 0.048095703, -0.0017309189, 0.018295288, -0.00592041, 0.062286377, 0.040649414, -0.032928467, -0.05392456, -0.13891602, -0.033050537, 0.047973633, -0.07824707, 0.024627686, -0.02923584, 0.09118652, 0.0690918, 0.045837402, -0.06402588, -0.028747559, -0.06542969, -0.08496094, 0.06762695, 0.04220581, 0.059539795, 0.0023174286]\n" + "[-0.022979736, -0.030212402, -0.08886719, -0.08569336, 0.007030487, -0.0010671616, -0.033813477, 0.0\n" ] } ], "source": [ - "query_result = embeddings.embed_query(text)\n", - "print(query_result)" + "single_vector = embeddings.embed_query(text)\n", + "print(str(single_vector)[:100]) # Show the first 100 characters of the vector" + ] + }, + { + "cell_type": "markdown", + "id": "1b5a7d03", + "metadata": {}, + "source": [ + "### Embed multiple texts\n", + "\n", + "You can embed multiple texts with `embed_documents`:" ] }, { "cell_type": "code", - "execution_count": 6, - "id": "38ad3b20", + "execution_count": 5, + "id": "2f4d6e97", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[[-0.072631836, 0.06921387, -0.02658081, 0.022705078, 0.027328491, 0.046905518, -0.01838684, -0.029525757, 0.0041046143, -0.028198242, 0.0496521, 0.026901245, 0.03274536, 0.01574707, -0.081726074, -0.022369385, 0.049591064, 0.06549072, -0.015083313, -0.053863525, 0.098083496, 0.034698486, -0.08557129, -0.0024662018, -0.07519531, 0.03265381, 0.006046295, -0.0060691833, 0.032196045, 0.07537842, 9.024143e-05, -0.00869751, 0.022735596, 0.06329346, 0.068481445, -0.006778717, -0.07885742, 0.049560547, -0.008811951, 0.025253296, 0.050750732, -0.05343628, 0.051361084, -0.02319336, 0.026382446, 0.088378906, 0.03567505, -0.0736084, 0.039215088, -0.020584106, -0.03112793, -0.071777344, 0.018218994, -0.01876831, 0.040863037, 0.080078125, 0.046020508, -0.030792236, -0.011779785, -0.024871826, -0.06652832, 0.04748535, -0.038116455, 0.08453369, 0.08746338, 0.059509277, -0.037628174, -0.045410156, -0.054626465, -0.0036334991, -0.035949707, -0.011070251, 0.054534912, 0.0803833, 0.052734375, 0.06689453, 0.0074310303, 0.018249512, -0.023773193, 0.03845215, -0.113220215, 0.014251709, 0.028289795, -0.03942871, 0.029525757, 0.03036499, 0.035095215, 0.031829834, -0.0015306473, 0.027252197, 0.005088806, -0.035858154, -0.113220215, 0.021606445, 0.012046814, -0.06137085, 0.0057640076, -0.06994629, 0.02532959, 0.016952515, -0.010398865, -0.0066184998, -0.020904541, -0.12030029, 0.0036029816, -0.061553955, 0.023956299, -0.07330322, 0.013053894, -0.009613037, -0.062683105, 0.00013184547, 0.12030029, 0.028167725, 0.048614502, -0.09301758, -0.020324707, 0.022369385, -0.14025879, -0.052764893, 0.07220459, 0.028198242, 0.01499939, -0.029449463, 0.004711151, -0.05947876, 0.1640625, -0.09240723, 0.019500732, -0.0031089783, 0.0032081604, -0.0049934387, -0.01676941, 0.002691269, 0.02848816, 0.013504028, -0.057800293, 0.049041748, -0.022384644, 0.05517578, -0.031982422, 0.055389404, 0.0859375, 0.019866943, -0.052978516, 0.030929565, -0.15979004, 0.068481445, -0.020080566, -0.033477783, 0.07922363, -0.020736694, -0.025680542, 0.054016113, -0.028839111, -0.016189575, 0.03564453, 0.0001078248, 0.06304932, -0.022781372, 0.06555176, 0.010093689, 0.03286743, 0.14111328, -0.008468628, -0.04849243, 0.04525757, 0.065979004, -0.012138367, -0.017044067, 0.059509277, 0.035339355, -0.017807007, -0.027267456, -0.0034656525, -0.02078247, -0.033477783, 0.05041504, -0.043518066, -0.064208984, 0.034942627, -0.009300232, -0.08148193, 0.007774353, -0.03540039, -0.008255005, -0.1060791, -0.0703125, 0.091308594, 0.10095215, -0.081970215, 0.02355957, -0.026382446, -0.0070610046, -0.051208496, -0.014961243, 0.07269287, -0.033721924, 0.017669678, -0.08972168, 0.035339355, 0.03579712, -0.07299805, -0.014144897, -0.008850098, 0.023742676, -0.05847168, -0.07873535, -0.015388489, -0.039642334, -0.028930664, 0.008926392, -0.040283203, -0.02897644, -0.013557434, -0.006088257, 0.024169922, -0.10217285, 0.014526367, 0.007381439, -0.0005607605, -0.058410645, -0.008399963, -0.08001709, 0.05065918, 0.01727295, 0.012191772, -0.016571045, 0.03717041, -0.02607727, 0.060760498, 0.057678223, -0.06585693, 0.059173584, 0.023117065, -0.034118652, -0.03189087, 0.010429382, 0.010368347, -0.011230469, -0.020980835, -0.04019165, 0.048187256, -0.019638062, -0.024414062, -0.0019989014, 0.04336548, 0.117248535, 0.00033903122, -0.0014419556, 0.013946533, -0.11541748, 0.030059814, -0.06500244, 0.05441284, 0.021759033, 0.030380249, 0.080566406, 0.02331543, -0.04586792, 0.037322998, 0.011390686, -0.01374054, 0.1459961, -0.050964355, 0.081970215, -0.061645508, 0.07067871, -0.036956787, 0.060455322, 0.051361084, -0.05831909, 0.05328369, -0.008628845, 0.054534912, -0.047332764, 0.030578613, -0.048828125, -0.018112183, 0.022979736, -0.07318115, -0.0423584, -0.094177246, -0.04071045, 0.054260254, 0.0423584, 0.075805664, -0.06365967, 0.009269714, -0.054779053, -0.007637024, -0.01876831, 0.08453369, 0.058898926, -0.07727051, 0.04360962, 0.010574341, -0.027694702, 0.024917603, -0.0463562, 0.040222168, -0.05496216, -0.048461914, 0.013710022, -0.1038208, 0.027954102, 0.031951904, -0.05618286, 0.0025730133, -0.06549072, -0.049957275, 0.01499939, -0.11090088, -0.009017944, 0.021835327, 0.03503418, 0.058746338, -0.12756348, -0.0345459, -0.04699707, -0.029830933, -0.06726074, 0.010612488, -0.024108887, 0.016464233, 0.013076782, -0.06298828, -0.0657959, -0.0025234222, -0.0625, 0.013420105, 0.05810547, -0.006362915, -0.028625488, 0.06085205, 0.12310791, 0.04751587, -0.027740479, -0.02029419, -0.02293396, 0.048858643, -0.006793976, -0.0061073303, 0.029067993, -0.0076942444, -0.00088596344, -0.007446289, 0.12756348, 0.082092285, -0.0037841797, 0.03866577, 0.040374756, 0.019104004, -0.0345459, 0.019042969, -0.038116455, 0.045410156, 0.062683105, -0.024963379, 0.085632324, 0.005897522, 0.008285522, 0.008811951, 0.026504517, 0.025558472, -0.005554199, -0.017822266, -0.112854004, -0.03768921, -0.00097227097, -0.061401367, 0.050567627, -0.010734558, 0.07220459, 0.03643799, 0.0007662773, -0.020980835, -0.04711914, -0.03488159, -0.09655762, 0.0048561096, 0.028030396, 0.04586792, -0.014915466]]\n" + "[-0.028869629, -0.030410767, -0.099121094, -0.07116699, -0.012748718, -0.0059432983, -0.04360962, 0.\n", + "[-0.047332764, -0.049957275, -0.07458496, -0.034332275, -0.057922363, -0.0112838745, -0.06994629, 0.\n" ] } ], "source": [ - "doc_result = embeddings.embed_documents([text])\n", - "print(doc_result)" + "text2 = (\n", + " \"LangGraph is a library for building stateful, multi-actor applications with LLMs\"\n", + ")\n", + "two_vectors = embeddings.embed_documents([text, text2])\n", + "for vector in two_vectors:\n", + " print(str(vector)[:100]) # Show the first 100 characters of the vector" ] }, { - "cell_type": "code", - "execution_count": null, - "id": "aaad49f8", + "cell_type": "markdown", + "id": "98785c12", "metadata": {}, - "outputs": [], - "source": [] + "source": [ + "## API Reference\n", + "\n", + "For detailed documentation on `CohereEmbeddings` features and configuration options, please refer to the [API reference](https://api.python.langchain.com/en/latest/embeddings/langchain_cohere.embeddings.CohereEmbeddings.html).\n" + ] } ], "metadata": { @@ -118,12 +2292,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" - }, - "vscode": { - "interpreter": { - "hash": "7377c2ccc78bc62c2683122d48c8cd1fb85a53850a1b1fc29736ed39852c9885" - } + "version": "3.11.9" } }, "nbformat": 4,