AI English Shift · Lessons / F04
Vectors, embeddings and similarity
向量、嵌入与相似度
Open the interactive lesson · 打开互动课程A search system needs a way to compare a question with documents that may use different words.
搜索系统需要一种方法,把问题与可能采用不同措辞的文档进行比较。
検索システムには、異なる表現が使われている質問と文書を比較する方法が必要です。
For example, a customer may ask how to send an item back while the handbook discusses product returns.
例如,客户可能问如何把商品寄回去,而手册讨论的是商品退货。
たとえば顧客は品物を送り返す方法を質問していても、手引きでは返品という表現が使われているかもしれません。
Exact word matching may miss the connection, although it remains valuable when the question includes a precise code or identifier.
精确的词语匹配可能漏掉这种联系,但当问题包含明确的代码或标识符时,它仍然很有价值。
単語の完全な一致だけでは関連を見落とす可能性がありますが、正確なコードや識別子を含む質問では有用です。
An embedding model converts an input into a vector: an ordered collection of numerical values representing learned features.
嵌入模型把输入转换为向量:一组按顺序排列、用于表示已学习特征的数值。
埋め込みモデルは入力をベクトル、つまり学習した特徴を表す数値を順序付きで並べたものに変換します。
A retrieval system can compare a question vector with document vectors using a selected similarity measure.
检索系统可以使用选定的相似度度量,比较问题向量与文档向量。
検索システムは選択した類似度の尺度を使い、質問のベクトルと文書のベクトルを比較できます。
Cosine similarity, for instance, compares the direction of vectors rather than treating raw length as their only relationship.
例如,余弦相似度比较的是向量的方向,而不是只根据原始长度判断它们的关系。
たとえばコサイン類似度は、ベクトルの長さだけではなく、その向きを比較します。
The individual dimensions usually do not come with simple labels such as kindness, price, or urgency.
各个维度通常不会带有“友善程度”“价格”或“紧急程度”这样的简单标签。
個々の次元には通常、親切さ、価格、緊急性のような単純なラベルは付いていません。
A two-dimensional picture of an embedding space is therefore a visualization of selected relationships, not the full representation used by the system.
因此,用二维图展示嵌入空间,只是把选定的部分关系可视化,并不是系统所用的完整表示。
したがって埋め込み空間を2次元で描いた図は、一部の関係の可視化であり、システムが使う完全な表現ではありません。
Similarity can help find candidate evidence, but it cannot establish whether that evidence is accurate, current, or applicable to a particular customer.
相似度有助于找到候选证据,但不能证明这些证据是否准确、是否最新,或是否适用于某位客户。
類似度は根拠の候補を探すのに役立ちますが、正確性、最新性、特定の顧客への適用可能性は証明できません。
The statements that refunds are allowed and refunds are not allowed share a topic and much of their vocabulary.
“允许退款”和“不允许退款”这两种陈述,讨论同一个主题,也使用了许多相同词语。
返金が認められるという文と、返金が認められないという文は、話題と多くの語彙を共有します。
A system may rank both highly for a refund question even though they lead to opposite decisions.
面对退款问题,系统可能把两者都排在前列,尽管它们会导向相反的决定。
返金についての質問で、相反する判断につながる両方の文が高く順位付けされることがあります。
This is why retrieved passages need dates, document identities, and enough surrounding context to interpret conditions and exceptions.
因此,检索到的段落需要附有日期、文档标识,以及足够的前后文,才能解释其中的条件和例外。
そのため取得した文章には、日付、文書の識別情報、条件や例外を解釈できる周辺の文脈が必要です。
A Japanese question against an English collection creates another requirement: the selected embedding model must work well across those languages.
用日语问题搜索英语文档集合,还会带来另一项要求:选用的嵌入模型必须能够良好地处理这两种语言之间的对应关系。
日本語の質問で英語の文書群を検索する場合、選んだ埋め込みモデルがその言語間で十分に機能するという別の要件が生じます。
Alternatively, a system may translate the question, but the translation becomes another component whose errors must be evaluated.
另一种做法是让系统先翻译问题,但翻译就成了一个额外的组成部分,其错误也需要评估。
代わりに質問を翻訳することもできますが、翻訳は誤りを評価すべき追加の構成要素になります。
Hybrid search combines lexical and semantic evidence, and reranking can apply another comparison to the candidate passages.
混合搜索结合词语匹配与语义方面的证据,而重排序可以对候选段落再进行一轮比较。
ハイブリッド検索は語の一致と意味的な情報を組み合わせ、再ランキングで候補の文章をさらに比較できます。
Neither technique is automatically better for every dataset, so test exact identifiers, paraphrases, negation, and bilingual questions separately.
这两种技术都不会自动在所有数据集上表现更好,因此应分别测试精确标识符、改写表达、否定表达和双语问题。
どちらもすべてのデータで自動的に優れるわけではないため、識別子、言い換え、否定表現、二言語の質問を分けて検証します。
For a learning glossary, explicit concept relationships should complement embeddings so that a related term can explain why it is connected.
对于学习词典,应使用明确的概念关系来补充嵌入表示,让相关术语之间为什么存在联系也能得到解释。
学習用語集では、明示した概念間の関係を埋め込みと組み合わせ、関連語がなぜつながるか説明できるようにします。
Key terms
- Embedding: A learned vector representation of an input, used within models or for tasks such as retrieval.
- Vector: An ordered collection of numbers used to represent features or mathematical quantities.
- Keyword search: Retrieving or ranking documents using lexical matches and related term statistics.
- Semantic search: Retrieval based on learned representations or semantic relationships rather than only word overlap.
- Hybrid search: Combining lexical and semantic retrieval signals to select candidate evidence.
- Reranking: Applying a further relevance assessment to an initial set of retrieved candidates.