0
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?

【docker版】LLMベクトル検索をWebアプリで試す

Last updated at Posted at 2025-01-04

nlp4j-web-vectorsearch

The English version of this is here.


ベクトルDBへの文書の格納、ベクトルDBでの文書検索を試すことができるWebアプリです。

キーワード検索の機能もありますので、ベクトル検索の結果と対比することも可能です。

image.png

0. 前提

Docker が動作する環境が必要です。

1. 導入

1-1. Embedding Server の導入と実行

Multilingual-E5-large Embedding Serever (nlp4j-llm-embeddings-e5) の導入をします。

導入

docker pull oyahiroki/nlp4j-llm-embeddings-e5:1.0.0.0

実行(初回はモデルファイルのダウンロードで起動後の処理に5分ほどかかります)

docker run -d --name nlp4j-llm-embeddings-e5 -p 8888:8888 oyahiroki/nlp4j-llm-embeddings-e5:1.0.0.0

実行結果例

>docker pull oyahiroki/nlp4j-web-vectorsearch:1.0.0.0
1.0.0.0: Pulling from oyahiroki/nlp4j-web-vectorsearch
cb57fedf0fd8: Download complete
80338217a4ab: Download complete
d1eecb43db8a: Download complete
b317c36e5a10: Download complete
1a5fd5c7e184: Download complete
b24483e35971: Download complete
5b1aa583d1ef: Download complete
10970da6d1d3: Download complete
90a925ab929a: Download complete
57bd701990a7: Download complete
7d9a34308537: Download complete
7478e0ac0f23: Download complete
4c7deb2ac32b: Download complete
727d8fc35079: Download complete
4f4fb700ef54: Already exists
edf7dd409191: Download complete
350cf53fd52a: Download complete
Digest: sha256:9640f3cd726ee2c04d9d422727ecafe59e55c253e6778e0948eabbc85845f762
Status: Downloaded newer image for oyahiroki/nlp4j-web-vectorsearch:1.0.0.0
docker.io/oyahiroki/nlp4j-web-vectorsearch:1.0.0.0

>

詳しくは以下の記事を参照してください

1-2. Webアプリケーションの導入と実行

導入

docker pull oyahiroki/nlp4j-web-vectorsearch:1.0.0.0

実行

docker run -d --name nlp4j-web-vectorsearch -p 8983:8983 -p 8080:8080 oyahiroki/nlp4j-web-vectorsearch:1.0.0.0

ブラウザを開く

http://localhost:8080/nlp4j-web-vectorsearch/

以下のような画面になればOKです。

image.png

イメージについては以下を参照してください

2. 使い方

ベクトルDBへの文書の投入

テキストボックスに適当なテキストを入力し、「POST」を押すと文書として格納されます。

ベクトルDBでのベクトル検索

テキストボックスに適当なテキストを入力し、「Vector Search」を押すとベクトル検索が実行されます。

以下の例では「NY」と「ニューヨーク」がうまい具合にヒットしていることが確認できます。

image.png

その他

nvidia GPU が動作する環境(ドライバ導入済)での動作を前提としていますが、非nvidia環境での動作も確認済みです。


以上.

0
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
0
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?