<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Aura – embeddings</title>
    <link>/tags/embeddings/</link>
    <description>Recent content in embeddings on Aura</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    
	  <atom:link href="/tags/embeddings/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: </title>
      <link>/docs/experiences-builder/development-use-cases/nlp-uc-development/nlp-pipeline-components-catalog/nlp-stages/openai-embeddings/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/experiences-builder/development-use-cases/nlp-uc-development/nlp-pipeline-components-catalog/nlp-stages/openai-embeddings/</guid>
      <description>
        
        
        &lt;h1 id=&#34;openai-embeddings-recognizer-stage&#34;&gt;OpenAI embeddings recognizer stage&lt;/h1&gt;
&lt;h2 id=&#34;what-is-openai-embeddings-recognizer&#34;&gt;What is OpenAI embeddings recognizer?&lt;/h2&gt;
&lt;p&gt;OpenAI embeddings is a stage capable of recognizing the user&amp;rsquo;s statement and finding the one that most resembles it.
This stage allows using &lt;strong&gt;semantic search technology&lt;/strong&gt; based on OpenAI capabilities, thus improving clearly Aura recognition capabilities.&lt;/p&gt;
&lt;p&gt;This semantic search uses embeddings, which are real-valued vectors of numbers that represent the meaning and the context of tokens (in the case of Aura, text blocks) in such a way that words with similar meaning are expected to have similar vector representation. Embeddings work with concepts rather than with keywords. The information structured in these vectors allows OpenAI algorithms to make an optimized semantic recognition of the input texts.&lt;/p&gt;
&lt;p&gt;To do so, it is necessary to use the embeddings method of &lt;a href=&#34;https://platform.openai.com/docs/introduction&#34;&gt;OpenAI&lt;/a&gt;, a Microsoft service in charge of working with Machine Learning models and to use the &lt;a href=&#34;https://qdrant.tech&#34;&gt;Qdrant&lt;/a&gt; database to be able to feed all the frequently asked questions (FAQs).&lt;/p&gt;
&lt;p&gt;The user&amp;rsquo;s utterance recognition through OpenAI embeddings has two major steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Training&lt;/strong&gt;: Sets of structured questions and answers are extracted from data sources such as FAQs; afterwards, the OpenAI embeddings process is performed on those questions and, finally, the Qdrant knowledge base is fed with all of them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Matching&lt;/strong&gt;: Once the knowledge base has been loaded, it is necessary to publish it. This enables an endpoint to the Qdrant knowledge base, which can be used in the client application. This endpoint accepts a user&amp;rsquo;s question, performs the OpenAI embedding process and queries within Qdrant responding with the best answer from the knowledge base, along with a confidence score of the match.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;#x1f4c4; To obtain more information regarding OpenAI and Qdrant, please read the &lt;a href=&#34;https://platform.openai.com/docs/introduction&#34;&gt;OpenAI documentation&lt;/a&gt;, &lt;a href=&#34;https://qdrant.tech/documentation/&#34;&gt;Qdrant documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;#x26a0;&amp;#xfe0f; &lt;strong&gt;In the current release, this stage must not compete in parallel with other NLP recognition stages (CLU, Exact match, etc.) in the pipeline, in the way that the scores of each stage are compared.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#x26a0;&amp;#xfe0f; &lt;strong&gt;In order to use the OpenAI embeddings stage, it has to be previously enabled in the aurak8s installer, following the guidelines in the document &lt;a href=&#34;../../docs/deployment/installer/#enableopenai&#34;&gt;Enable OpenAI deployment&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In terms of time, obtaining the embeddings through OpenAI and storing them in the Qdrant database is fast. Note that when training from the package, embeddings are not recalculated.&lt;/p&gt;
&lt;p&gt;&amp;#x26a0;&amp;#xfe0f; &lt;strong&gt;In order to use the OpenAI embeddings stage, OpenAI has to be previously enabled in the aurak8s installer, following the guidelines in the document &lt;a href=&#34;../../docs/deployment/installer/#enableopenai&#34;&gt;Enable OpenAI deployment&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;On the other hand, if new training files are uploaded to Azure, all the embeddings are recalculated.&lt;/p&gt;
&lt;h2 id=&#34;path&#34;&gt;Path&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auracog_pipelines&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;stage_wrappers&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;recognizer_wrapper&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;openai_embeddings_wrapper&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;OpenaiEmbeddingsRecognizerWrapper&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;files&#34;&gt;Files&lt;/h2&gt;
&lt;p&gt;For OpenAI embeddings recognizer, two kinds of files are required: training and testing ones:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On one hand, &lt;strong&gt;training&lt;/strong&gt; files placed in folder:&lt;br&gt;
&lt;em&gt;aura-nlpdata-[country_code]/data/[language]/[channel]/openai-embeddings/training/&lt;/em&gt; with extension &lt;code&gt;.xlsx&lt;/code&gt; or &lt;code&gt;.xls&lt;/code&gt; are used for training.&lt;/li&gt;
&lt;li&gt;On the other hand, &lt;strong&gt;test files&lt;/strong&gt; placed in folder:&lt;br&gt;
&lt;em&gt;aura-nlpdata-[country_code]/data/[language]/[channel]/openai-embeddings/test/&lt;/em&gt; with extension &lt;code&gt;.xlsx&lt;/code&gt; or &lt;code&gt;.xls&lt;/code&gt; are used for testing.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;This stage requires the following configuration in the &lt;a href=&#34;../../docs/experiences-builder/development-use-cases/nlp-uc-development/uc-development-process/#2-configure-your-nlp-model&#34;&gt;&lt;code&gt;nlp.json&lt;/code&gt;&lt;/a&gt; file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;es-es&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;mp&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;openai_embeddings_recognizer&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;openai&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;model_base&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;text-embedding-ada-002&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;model_version&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;2&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;subscription_key&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;KEY1&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;KEY2&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;deployment_name&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;DEPLOYMENT_MODEL_NAME&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;search_params&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;knn&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;1&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;exact&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;false&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;distance&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Cosine&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;database&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;qdrant&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;dataset_name&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;DATASET_NAME&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;intent_template&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;intent.embeddings&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;entity_label_template&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;embeddings&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;entity_type_template&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;faq&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;score_factor&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The associated fields are defined below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;openai_embeddings_recognizer&lt;/code&gt;: This field is used to configure the OpenAI embeddings recognizer stage.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;openai&lt;/code&gt;: Specifies the OpenAI model to be used. This variable supports the following values:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;model_base&lt;/code&gt;: Base model to be used. Check azure documentation to know more about values supported.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;model_version&lt;/code&gt;: Version of the model to be used.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;subscription_key&lt;/code&gt;: This value is replace automatically in training process.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deployment_name&lt;/code&gt;: This value is replace automatically in training process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;search_params&lt;/code&gt;: Specifies the parameters to be used in the database search process.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;knn&lt;/code&gt;: Number of nearest neighbors to return.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;exact&lt;/code&gt;: If set to &lt;code&gt;true&lt;/code&gt;, will perform exact search, which will be slower but more accurate.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;distance&lt;/code&gt;: Type of distance to calculate between vectors. This variable supports the following values: Cosine, Euclid, Dot.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;database&lt;/code&gt;: Database to be used. This variable supports the following values: qdrant.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dataset_name&lt;/code&gt;: Dataset to be used. This value will change automatically.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;intent_template&lt;/code&gt;: Intent name to return the response.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;entity_label_template&lt;/code&gt;: Entity label to return the response.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;entity_type_template&lt;/code&gt;: Entity type to return the response.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;score_factor&lt;/code&gt;: Parameter used to weight the score of the response returned by OpenAI to be used during the winning response selection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
  </channel>
</rss>
