【日本語LLM】Ollamaで利用可能な日本語対応embeddingモデル【Ruri】
はじめに
少しおバカさんのローカルのLLM(Large Language Model)を利用する上で、重要になる技術がRAG(Retrieval-Augmented Generation)です。具体的な手法はさまざまですが、LLM推論時の辞書のような役割をします。
ローカルLLMをGUIで利用できる(Ollama)Open WebUIでは、RAGを利用できますが、利用するためには本体LLM以外に「embeddingモデル」「rerankerモデル」が必要になります。
しかし、ローカルで利用できる日本語対応モデルが少ないのが現状です。
最近Ollamaライブラリに、日本語専用のembeddingモデルが(たぶん初めて)登録されたので紹介と動作レビューしたいと思います。
【PR】Open WebUIの詳細な導入方法や使い方は下記事で紹介しています。
Ruri
Ollamaライブラリに登録されたこちらのkun432氏のモデルを利用します。
説明文に記載のhuggingfaceのページはこちら、名古屋大学研究室のモデルですね。
論文はこちら、
Open WebUIの設定
埋め込みモデルエンジンをOllamaにして、埋め込みモデルを「kun432/cl-nagoya-ruri-large:latest」にします。
ブリッジ検索をオンにして、モデルの再ランキング欄に「cl-nagoya/ruri-reranker-large」と入力して、ダウンロードアイコンをクリックします。←動作しないようです(Embeddingモデルのみの動作です)
日本語pdfを扱う場合はTikaがおすすめです。(別途導入が必要です)
実行
ブリッジ検索(rerankerモデル)が利用出来ないので、Ruri embeddingモデルのみでの動作です。
LLMはMistral社とNVIDIA社開発のMistral-nemo(12B)の日本語チューニング版を利用します。※ Ollamaで利用可能なモデルがないため、仕方なく自分で量子化しました
まとめ
embeddingモデルだけでも、十分に実用レベルで抽出できていると思います。
この記事が気に入ったらサポートをしてみませんか?