嵌入是指以數值表示文字、圖像或影片,藉此掌握輸入內容之間的關係。機器學習模型 (尤其是生成式 AI 模型) 適合用來建立嵌入,方法是識別大型資料集中的模式。應用程式可使用嵌入項目處理及生成語言,辨識內容特有的複雜含意和語意關係。
Google Distributed Cloud (GDC) 氣隙隔離的 Vertex AI 支援英文和多語言文字輸入的 Text Embedding API。文字嵌入技術會將文字轉換為浮點數陣列 (稱為向量),這些向量旨在擷取文字的意義。嵌入陣列的長度稱為向量的維度。
舉例來說,一段文字可能以含有數百個維度的向量表示。接著,應用程式可以計算兩段文字向量表示法之間的數值距離,判斷物件之間的相似度。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Text embeddings overview\n\n| **Important:** This content applies to version 1.14.4 and later.\n\nEmbeddings are numerical representations of text, images, or videos that capture\nrelationships between inputs. Machine learning models, especially\nGenerative AI models, are suited for creating embeddings by identifying\npatterns within large datasets. Applications can use embeddings to process and\nproduce language, recognizing complex meanings and semantic relationships\nspecific to your content.\n\nVertex AI on Google Distributed Cloud (GDC) air-gapped supports\nText Embedding APIs for English and multilingual textual input.\nText Embedding works by converting text into arrays of floating-point\nnumbers called vectors. These vectors are designed to capture the meaning of the\ntext. The length of the embedding array is called the vector's dimensionality.\nFor example, one passage of text might be represented by a vector containing\nhundreds of dimensions. Then, by calculating the numerical distance between the\nvector representations of two pieces of text, an application can determine the\nsimilarity between the objects.\n| **Note:** Only text is supported as an input type for embeddings on GDC.\n\nFor a list of supported models, see\n[Embeddings models](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/genai/genai-models#embeddings-models).\n\nFor a list of supported multilingual languages, see\n[Supported text embedding languages](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/genai/supported-text-languages).\n\nText embeddings use cases\n-------------------------\n\nSome common use cases for text embeddings include:\n\n- **Semantic search**: Search text ranked by semantic similarity.\n- **Classification**: Return the class of items with attributes similar to the given text.\n- **Clustering**: Cluster items whose text attributes are similar to the given text.\n- **Outlier detection**: Return items where text attributes are least related to the given text.\n- **Conversational interface**: Cluster groups of sentences that can lead to similar responses, like in a conversation-level embedding space.\n\n### Example use case: Develop a book recommendation chatbot\n\nIf you want to develop a book recommendation chatbot, the first thing to do is\nto use a deep neural network (DNN) to convert each book into an embedding\nvector, where one embedding vector represents one book. You can feed the book\ntitle or text content as input to the DNN. Alternatively, you can use both of\nthese inputs together, along with any other metadata describing the book, such\nas the genre.\n\nThe embeddings in this example could include thousands of book titles with\nsummaries and their genre. It might have representations for books like\n*Wuthering Heights* by Emily Brontë and *Persuasion* by Jane Austen that are\nsimilar to each other (small distance between numerical representation). In\ncontrast, the numerical representation of the book *The Great Gatsby* by F.\nScott Fitzgerald would be further, as the time period, genre, and summary are\nless similar.\n\nThe inputs are the main influence on the orientation of the embedding space. For\nexample, if we only had book title inputs, then two books with similar titles\nbut very different summaries could be close together. However, if we include the\ntitle and summary, then these same books are less similar (further away) in the\nembedding space.\n\nWorking with Generative AI, this book-suggestion chatbot could summarize,\nsuggest, and show you books that you might like (or dislike) based on your\nquery.\n\nWhat's next\n-----------\n\n- Learn how to [get text embeddings](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/genai/get-text-embeddings)."]]