1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SAP HANA CloudのVECTOR_EMBEDDING Functionを使ってみる

Posted at

はじめに

SAP HANA CloudでEmbedding(テキストをベクトルに変換したもの)を生成できる機能が2024 Q4にリリースされました。

従来はSAP AI Coreや外部のLLMを使ってEmbeddingを取得していましたが、HANA Cloudの中でできるようになったということです。PALを使う必要があると勘違いしていたのでトライアル環境では試せないと思っていたのですが、Natural Language Processingを有効化するだけでできました。

前提

HANA Cloudの設定でNatural Language Processing (NLP)を有効化します。

image.png

VECTOR_EMBEDDINGを取得

以下のクエリを実行します。

SELECT VECTOR_EMBEDDING('Hello world!','DOCUMENT','SAP_NEB.20240715') FROM DUMMY;

Embeddingが返ってきます。
image.png

シンタックス

VECTOR_EMBEDDING(<text>, <text-type>, <model-and-version>)

<text> : Embeddingを生成する対象のテキスト
<text-type> : テキストの種類。 DOCUMENTまたはQUERYを指定
<model-and-version> : Embeddingを生成するためのモデルとバージョンを指定

サポートされるモデルおよびバージョンは以下のヘルプに記載があります。現時点ではSAP_NEB.20240715のみで、このモデルではドイツ語、英語、スペイン語、スペイン語、ポルトガル語がサポートされています。
https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-vector-engine-guide/vector-embedding-function-vector

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?