# Understanding and Applying Text Embeddings with...

**URL:** https://dlai.staged-by-discourse.com/c/short-course-q-a/understanding-and-applying-text-embeddings-with-ve/375.md

[Latest](https://dlai.staged-by-discourse.com/latest.md) · [Categories](https://dlai.staged-by-discourse.com/categories.md) · [Tags](https://dlai.staged-by-discourse.com/tags.md)

---

## [Lab sessions output not displayed](https://dlai.staged-by-discourse.com/t/lab-sessions-output-not-displayed/892889)

<div class="topic-metadata">

**Author:** [@JAMES\_T](https://dlai.staged-by-discourse.com/u/JAMES_T)\
**Replies:** 2\
**Last updated:** [June 16, 2026, 8:40pm UTC](https://dlai.staged-by-discourse.com/t/lab-sessions-output-not-displayed/892889 "2026-06-16T20:40:48Z")

</div>

The notebook for Lesson 5 uses vertexai.language\_models.TextGenerationModel.from\_pretrained("text-bison@001"). Since the Bison text model family appears retired on Vertex AI, in my lab session, cells run, but no output i…

---

## [JSONDecodeError: Extra data: line 1 column 5 (char 4)](https://dlai.staged-by-discourse.com/t/jsondecodeerror-extra-data-line-1-column-5-char-4/882858)

<div class="topic-metadata">

**Author:** [@fuad47](https://dlai.staged-by-discourse.com/u/fuad47)\
**Replies:** 3\
**Last updated:** [January 28, 2026, 8:56pm UTC](https://dlai.staged-by-discourse.com/t/jsondecodeerror-extra-data-line-1-column-5-char-4/882858 "2026-01-28T20:56:25Z")

</div>

embedding = embedding\_model.get\_embeddings(\[“life”\]) trying to run this cell but gives error.

---

## [L5-text-generation error](https://dlai.staged-by-discourse.com/t/l5-text-generation-error/865345)

<div class="topic-metadata">

**Author:** [@matt-s](https://dlai.staged-by-discourse.com/u/matt-s)\
**Replies:** 2\
**Last updated:** [December 4, 2025, 10:18pm UTC](https://dlai.staged-by-discourse.com/t/l5-text-generation-error/865345 "2025-12-04T22:18:57Z")

</div>

I am getting an error when trying to predict using the TextGenerationModel text-bison as demonstrated in the lab. I tried switching the model to text-bison-002 and other model versions listed in the PaLM Model Garden he…

---

## [Error when trying to run the code cell](https://dlai.staged-by-discourse.com/t/error-when-trying-to-run-the-code-cell/872916)

<div class="topic-metadata">

**Author:** [@amalanfadil123](https://dlai.staged-by-discourse.com/u/amalanfadil123)\
**Replies:** 1\
**Last updated:** [September 10, 2025, 11:29am UTC](https://dlai.staged-by-discourse.com/t/error-when-trying-to-run-the-code-cell/872916 "2025-09-10T11:29:25Z")

</div>

Im getting an error like this when i try to run a cell code that contains embedding, --------------------------------------------------------------------------- JSONDecodeError Traceback (most …

---

## [L1-Embeddings-api-intro Error](https://dlai.staged-by-discourse.com/t/l1-embeddings-api-intro-error/865282)

<div class="topic-metadata">

**Author:** [@matt-s](https://dlai.staged-by-discourse.com/u/matt-s)\
**Replies:** 2\
**Last updated:** [August 2, 2025, 4:16pm UTC](https://dlai.staged-by-discourse.com/t/l1-embeddings-api-intro-error/865282 "2025-08-02T16:16:32Z")

</div>

Running in browser, jupyter cell 7 results in an error: embedding = embedding\_model.get\_embeddings(\["life"\]) --------------------------------------------------------------------------- JSONDecodeError …

---

## [Issues in visualising the embeddings code in lecture 3](https://dlai.staged-by-discourse.com/t/issues-in-visualising-the-embeddings-code-in-lecture-3/817446)

<div class="topic-metadata">

**Author:** [@ammad03](https://dlai.staged-by-discourse.com/u/ammad03)\
**Replies:** 0\
**Last updated:** [May 18, 2025, 5:14pm UTC](https://dlai.staged-by-discourse.com/t/issues-in-visualising-the-embeddings-code-in-lecture-3/817446 "2025-05-18T17:14:01Z")

</div>

Hi, I have been working my way around to get the interactive graph for embeddings in Lecture 3. when I execute this code: import matplotlib.pyplot as plt import mplcursors %matplotlib ipympl from utils import plot\_2…

---

## [Code issue in Getting Started with Text Emdeddings](https://dlai.staged-by-discourse.com/t/code-issue-in-getting-started-with-text-emdeddings/812314)

<div class="topic-metadata">

**Author:** [@jaswanth.15](https://dlai.staged-by-discourse.com/u/jaswanth.15)\
**Replies:** 2\
**Last updated:** [May 10, 2025, 4:10am UTC](https://dlai.staged-by-discourse.com/t/code-issue-in-getting-started-with-text-emdeddings/812314 "2025-05-10T04:10:36Z")

</div>

The issue is if you run the following code in the Video embedding\_model = TextEmbeddingModel.from\_pretrained( “textembedding-gecko@001”) It would run but while generating the embeddings for the sentence it might throw…

---

## [Word Embedding: Visual embedding code issue](https://dlai.staged-by-discourse.com/t/word-embedding-visual-embedding-code-issue/794324)

<div class="topic-metadata">

**Author:** [@ammad03](https://dlai.staged-by-discourse.com/u/ammad03)\
**Replies:** 0\
**Last updated:** [April 1, 2025, 3:00pm UTC](https://dlai.staged-by-discourse.com/t/word-embedding-visual-embedding-code-issue/794324 "2025-04-01T15:00:01Z")

</div>

on executing this code embeddings = for input\_text in input\_text\_lst\_news: emb = embedding\_model.get\_embeddings( \[input\_text\])\[0\].values embeddings.append(emb) embeddings\_array = np.array(embeddings) I get the fol…

---

## [Not able to import methods from utils package](https://dlai.staged-by-discourse.com/t/not-able-to-import-methods-from-utils-package/467414)

<div class="topic-metadata">

**Author:** [@Navneet808](https://dlai.staged-by-discourse.com/u/Navneet808)\
**Replies:** 6\
**Last updated:** [February 6, 2025, 10:03am UTC](https://dlai.staged-by-discourse.com/t/not-able-to-import-methods-from-utils-package/467414 "2025-02-06T10:03:12Z")

</div>

Hi, I am not able to import the authenticate method from the utils package. Faced this issue in cohere course as well where I had to import some method from the utils package only.

---

## [Issue running Bison-@001 Model on my own Vertex AI set-up](https://dlai.staged-by-discourse.com/t/issue-running-bison-001-model-on-my-own-vertex-ai-set-up/750049)

<div class="topic-metadata">

**Author:** [@Guillaume\_Autier](https://dlai.staged-by-discourse.com/u/Guillaume_Autier)\
**Replies:** 1\
**Last updated:** [January 22, 2025, 1:07am UTC](https://dlai.staged-by-discourse.com/t/issue-running-bison-001-model-on-my-own-vertex-ai-set-up/750049 "2025-01-22T01:07:25Z")

</div>

Hi team and all, I am trying to run the L6 notebook on my own environment. I set-up google cloud, Vertex AI, API and after some iteration, everything is running well. Except when I go to the step where we take the closes…

---

## [Problem using Jupyter notebook for "Understanding and Applying Text Embeddings"](https://dlai.staged-by-discourse.com/t/problem-using-jupyter-notebook-for-understanding-and-applying-text-embeddings/675136)

<div class="topic-metadata">

**Author:** [@dguerri](https://dlai.staged-by-discourse.com/u/dguerri)\
**Replies:** 7\
**Last updated:** [September 6, 2024, 8:21pm UTC](https://dlai.staged-by-discourse.com/t/problem-using-jupyter-notebook-for-understanding-and-applying-text-embeddings/675136 "2024-09-06T20:21:16Z")

</div>

Hello, I keep getting the word ‘message’ instead of the embeddings. I suspect I hit some quota, can someone help debugging?

---

## [How can I install the utils package?](https://dlai.staged-by-discourse.com/t/how-can-i-install-the-utils-package/438606)

<div class="topic-metadata">

**Author:** [@sanimesa](https://dlai.staged-by-discourse.com/u/sanimesa)\
**Replies:** 16\
**Last updated:** [September 3, 2024, 1:57pm UTC](https://dlai.staged-by-discourse.com/t/how-can-i-install-the-utils-package/438606 "2024-09-03T13:57:00Z")

</div>

I am running the examples in google colab, but unable to figure out the utils package. I was able to authenticate using google\_auth.authenticate\_user(), however stuck at the below: from utils import plot\_2D Thanks.

---

## [Visualizing Embeddings - not building](https://dlai.staged-by-discourse.com/t/visualizing-embeddings-not-building/643267)

<div class="topic-metadata">

**Author:** [@sudeeprk](https://dlai.staged-by-discourse.com/u/sudeeprk)\
**Replies:** 4\
**Last updated:** [June 29, 2024, 12:55am UTC](https://dlai.staged-by-discourse.com/t/visualizing-embeddings-not-building/643267 "2024-06-29T00:55:40Z")

</div>

I see error while trying the example tutorial given as part of the course “Understanding and applying text embeddings-\>Visualizing Embeddings”. Could you please help with this? JSONDecodeError …

---

## [ValueError: could not convert string to float: 'message' - Q&A](https://dlai.staged-by-discourse.com/t/valueerror-could-not-convert-string-to-float-message-q-a/443681)

<div class="topic-metadata">

**Author:** [@indiaj27](https://dlai.staged-by-discourse.com/u/indiaj27)\
**Replies:** 26\
**Last updated:** [May 28, 2024, 6:49am UTC](https://dlai.staged-by-discourse.com/t/valueerror-could-not-convert-string-to-float-message-q-a/443681 "2024-05-28T06:49:23Z")

</div>

Hi I’m trying to run the notebook for the exercise on Building a Q&A system, but I get a value error halfway down ValueError: could not convert string to float: ‘message’ It happens when I run the code: query = \['H…

---

## [Dataset for Stack Overflow questions and answers from BigQuery](https://dlai.staged-by-discourse.com/t/dataset-for-stack-overflow-questions-and-answers-from-bigquery/518338)

<div class="topic-metadata">

**Author:** [@Sujan\_Chandra\_Roy](https://dlai.staged-by-discourse.com/u/Sujan_Chandra_Roy)\
**Replies:** 9\
**Last updated:** [May 19, 2024, 5:02pm UTC](https://dlai.staged-by-discourse.com/t/dataset-for-stack-overflow-questions-and-answers-from-bigquery/518338 "2024-05-19T17:02:52Z")

</div>

Hello, Could you please let me know how can I download the dataset of Stack Overflow questions and answers from BigQuery? I would like to use this dataset locally.

---

## [Google Cloud Paid Account required](https://dlai.staged-by-discourse.com/t/google-cloud-paid-account-required/461516)

<div class="topic-metadata">

**Author:** [@Mike\_Walker](https://dlai.staged-by-discourse.com/u/Mike_Walker)\
**Replies:** 3\
**Last updated:** [May 19, 2024, 4:56pm UTC](https://dlai.staged-by-discourse.com/t/google-cloud-paid-account-required/461516 "2024-05-19T16:56:11Z")

</div>

This course has value as a survey of what vendors, such as Google has to offer. Access to google cloud to use the vertex AI is not a free service. I would have liked a course on subject of embedding and embedding techniq…

---

## [How to do Search and Summarization using Vertex-AI](https://dlai.staged-by-discourse.com/t/how-to-do-search-and-summarization-using-vertex-ai/439513)

<div class="topic-metadata">

**Author:** [@anandece4u](https://dlai.staged-by-discourse.com/u/anandece4u)\
**Replies:** 2\
**Last updated:** [May 19, 2024, 4:34pm UTC](https://dlai.staged-by-discourse.com/t/how-to-do-search-and-summarization-using-vertex-ai/439513 "2024-05-19T16:34:24Z")

</div>

How can we do search and summarization using Vertex-AI. For example, I have a pdf for product manuals, and I want to build LLM model to answer the user query related to product based on the content of product manuals pdf…

---

## [Text embeddings](https://dlai.staged-by-discourse.com/t/text-embeddings/569167)

<div class="topic-metadata">

**Author:** [@Manish\_Kamble](https://dlai.staged-by-discourse.com/u/Manish_Kamble)\
**Replies:** 4\
**Last updated:** [March 29, 2024, 11:09pm UTC](https://dlai.staged-by-discourse.com/t/text-embeddings/569167 "2024-03-29T23:09:15Z")

</div>

What are some other ways to create text embeddings? I am trying with LLM’s but chatgpt comes with added cost, huggingface models are two large and I dont have sufficient memory to run those models. Is there any other w…

---

## [Model.get\_embeddings(input\_text) for anomaly detection is not creating embeddings](https://dlai.staged-by-discourse.com/t/model-get-embeddings-input-text-for-anomaly-detection-is-not-creating-embeddings/585148)

<div class="topic-metadata">

**Author:** [@Samy\_Palaniappan](https://dlai.staged-by-discourse.com/u/Samy_Palaniappan)\
**Replies:** 1\
**Last updated:** [March 29, 2024, 10:52pm UTC](https://dlai.staged-by-discourse.com/t/model-get-embeddings-input-text-for-anomaly-detection-is-not-creating-embeddings/585148 "2024-03-29T22:52:40Z")

</div>

This is from the course: Understanding and Applying Text Embeddings. Lesson 4. Anomaly Detection section in the notebook. For some reason, the model.get\_embeddings(\[input\_text\])\[0\].values is returning a string “detail” …

---

## [Unable to retrieve text embedding from Vertex AI API](https://dlai.staged-by-discourse.com/t/unable-to-retrieve-text-embedding-from-vertex-ai-api/569959)

<div class="topic-metadata">

**Author:** [@RaghavanK](https://dlai.staged-by-discourse.com/u/RaghavanK)\
**Replies:** 0\
**Last updated:** [February 12, 2024, 8:12am UTC](https://dlai.staged-by-discourse.com/t/unable-to-retrieve-text-embedding-from-vertex-ai-api/569959 "2024-02-12T08:12:00Z")

</div>

I am trying to run Jupyter Notebook - “L1-Embeddings-api-intro”. Not sure why, I am unable to retrieve the text embedding for the word “life” as provided in cell #7 and #8 of the notebook. When I run cell #8, it returns …

---

## [Lesson 4: Applications of Embeddings](https://dlai.staged-by-discourse.com/t/lesson-4-applications-of-embeddings/566482)

<div class="topic-metadata">

**Author:** [@Manish\_Kamble](https://dlai.staged-by-discourse.com/u/Manish_Kamble)\
**Replies:** 1\
**Last updated:** [February 6, 2024, 2:42pm UTC](https://dlai.staged-by-discourse.com/t/lesson-4-applications-of-embeddings/566482 "2024-02-06T14:42:22Z")

</div>

from utils import encode\_text\_to\_embedding\_batched I am trying to run this helper function which is created for getting embedding on entire dataset but its not working…

---

## [What is the use of weights in 'Embedding' layer in Keras library](https://dlai.staged-by-discourse.com/t/what-is-the-use-of-weights-in-embedding-layer-in-keras-library/519217)

<div class="topic-metadata">

**Author:** [@nitulkukadia](https://dlai.staged-by-discourse.com/u/nitulkukadia)\
**Replies:** 1\
**Last updated:** [December 15, 2023, 9:13am UTC](https://dlai.staged-by-discourse.com/t/what-is-the-use-of-weights-in-embedding-layer-in-keras-library/519217 "2023-12-15T09:13:34Z")

</div>

How index 3 is converted to 2 dimensional vector here using weights of the layer. import numpy as np from keras.models import Sequential from keras.layers import Embedding model = Sequential() model.add(Embedding(5, 2,…

---

## [有些字幕的显示与视频的播放稍微有些不匹配](https://dlai.staged-by-discourse.com/t/topic/501620)

<div class="topic-metadata">

**Author:** [@gegewu](https://dlai.staged-by-discourse.com/u/gegewu)\
**Replies:** 0\
**Last updated:** [November 23, 2023, 12:50am UTC](https://dlai.staged-by-discourse.com/t/topic/501620 "2023-11-23T00:50:11Z")

</div>

短课程非常棒！学习了很多知识，非常感谢！ 因为我个人英语水平不高，非常依赖视频的英文字幕（如果能提供中文字幕那就更棒了），可是有些视频，字幕的显示时机与视频的播放进度并不一致，有些字幕会出现的快一些或慢一些，稍微有点影响观看学习的流畅程度（不过这也不是什么大问题）。 主要还是想表达一下感激之情，再次感谢deeplearning.ai，特别是吴恩达老师，您非常有亲和力，也非常专业！谢谢！

---

## [I wan to combine power of GPT-3.5-turbo model and text embedding](https://dlai.staged-by-discourse.com/t/i-wan-to-combine-power-of-gpt-3-5-turbo-model-and-text-embedding/474602)

<div class="topic-metadata">

**Author:** [@balaksara](https://dlai.staged-by-discourse.com/u/balaksara)\
**Replies:** 0\
**Last updated:** [October 21, 2023, 5:26pm UTC](https://dlai.staged-by-discourse.com/t/i-wan-to-combine-power-of-gpt-3-5-turbo-model-and-text-embedding/474602 "2023-10-21T17:26:02Z")

</div>

I wan to combine power of GPT-3.5-turbo model and text embedding. E.g I have large PHP code base, I want to analyze the code and find bugs. I can do it with direct GPT-3.5-trubo model directly with openAI. But it slow, …

---

## [Lesson 5: Text Generation with Vertex AI](https://dlai.staged-by-discourse.com/t/lesson-5-text-generation-with-vertex-ai/453296)

<div class="topic-metadata">

**Author:** [@Yiyi](https://dlai.staged-by-discourse.com/u/Yiyi)\
**Replies:** 8\
**Last updated:** [October 2, 2023, 11:53am UTC](https://dlai.staged-by-discourse.com/t/lesson-5-text-generation-with-vertex-ai/453296 "2023-10-02T11:53:03Z")

</div>

In lesson 5, I have not changed any source code, but the error happened in the picture when executing source code. Any one can help? Thanks

---

## [Lesson 6: Semantic Search, Building a Q&A System](https://dlai.staged-by-discourse.com/t/lesson-6-semantic-search-building-a-q-a-system/453368)

<div class="topic-metadata">

**Author:** [@Yiyi](https://dlai.staged-by-discourse.com/u/Yiyi)\
**Replies:** 1\
**Last updated:** [September 23, 2023, 5:30pm UTC](https://dlai.staged-by-discourse.com/t/lesson-6-semantic-search-building-a-q-a-system/453368 "2023-09-23T17:30:10Z")

</div>

In ‘Semantic Search’ module, when executing ‘cos\_sim\_array = cosine\_similarity(\[query\_embedding\], list(so\_database.embeddings.values))’, error happened in the picture. Anyone can help? Thanks

---

## [Unable to run notebook](https://dlai.staged-by-discourse.com/t/unable-to-run-notebook/443832)

<div class="topic-metadata">

**Author:** [@Ichiro](https://dlai.staged-by-discourse.com/u/Ichiro)\
**Replies:** 29\
**Last updated:** [September 17, 2023, 10:28am UTC](https://dlai.staged-by-discourse.com/t/unable-to-run-notebook/443832 "2023-09-17T10:28:05Z")

</div>

I’m trying to run the notebook for Lesson 6, and getting this error. Is this a known issue?

---

## [Optional Notebook -Setting up Google Cloud?](https://dlai.staged-by-discourse.com/t/optional-notebook-setting-up-google-cloud/446748)

<div class="topic-metadata">

**Author:** [@Martin\_Pollard](https://dlai.staged-by-discourse.com/u/Martin_Pollard)\
**Replies:** 1\
**Last updated:** [September 16, 2023, 6:08pm UTC](https://dlai.staged-by-discourse.com/t/optional-notebook-setting-up-google-cloud/446748 "2023-09-16T18:08:31Z")

</div>

Hi guys, Sorry, but I was trying to set this up to run locally and it appears a lot of the steps have changed at Google’s end. For example, downloading the JSON with the credentials is discouraged (or no longer possible…

---

## [Is the source code of the course available for download?](https://dlai.staged-by-discourse.com/t/is-the-source-code-of-the-course-available-for-download/443984)

<div class="topic-metadata">

**Author:** [@hevangel](https://dlai.staged-by-discourse.com/u/hevangel)\
**Replies:** 2\
**Last updated:** [September 15, 2023, 9:04pm UTC](https://dlai.staged-by-discourse.com/t/is-the-source-code-of-the-course-available-for-download/443984 "2023-09-15T21:04:11Z")

</div>

Hi, Is the source code of course is available for download in github? Thanks. Horace

---

## [VertexAI not completing the text generation , stops in between](https://dlai.staged-by-discourse.com/t/vertexai-not-completing-the-text-generation-stops-in-between/445053)

<div class="topic-metadata">

**Author:** [@Saurabh\_Patel1](https://dlai.staged-by-discourse.com/u/Saurabh_Patel1)\
**Replies:** 0\
**Last updated:** [September 14, 2023, 7:43am UTC](https://dlai.staged-by-discourse.com/t/vertexai-not-completing-the-text-generation-stops-in-between/445053 "2023-09-14T07:43:47Z")

</div>

When i write a prompt in vertex AI to generate text for the question answer purpose using the textgeneration model bison@001, its do not generate the whole text , it stops in between . What can be the reason for it to st…

[Next page](https://dlai.staged-by-discourse.com/c/short-course-q-a/understanding-and-applying-text-embeddings-with-ve/375.md?page=1)
