You are currently viewing 独自の AI チャットボットを作成して、すべてのドキュメントとのチャットを支援します

独自の AI チャットボットを作成して、すべてのドキュメントとのチャットを支援します

文書内の情報を検索する場合、その文書の内容を読んで理解するのに多くの時間がかかります。あなたを助けるチャットボットがあれば素晴らしいでしょう。チャットボットにドキュメントを渡すだけで、あとは何でも質問できます。また、チャットボットは完全にローカルで実行されるため、データが公開されることを心配する必要もありません。特に、コードを 1 行も記述する必要はありません。

することが

AI モデルを操作するには、Ollama をインストールする必要があります。これは、LLM モデルをローカルで実行するように設計された AI ツールです。Ollama は、MacOS、Windows、Linux までの複数のプラットフォームをサポートしています。OpenAI、Google などの外部プロバイダーに依存せずに AI の力を活用できます。

すべてのテキスト

Ollama は、LLM と簡単に対話できる API を提供します。ここからOllama をダウンロードしてインストールできます。Ollama には、さまざまな目的に適した、選択できる無料のモデルも多数用意されています。ここでモデルを検索できます。実際の経験を積むと、モデルmistralまたはllama2通常のモデルを使用した方が良い結果が得られます。これで、次のようにモデルを実行して操作できるようになります。

ollama run mistral

最初の実行では、Ollama はモデルをコンピューターにダウンロードする必要がありますが、これには時間がかかる場合があります。ダウンロードが成功すると、コマンド ライン ウィンドウにリダイレクトされ、モデルとチャットできます。

すべてのテキスト

したがって、独自のチャットボットをローカルで実行することができます。ただし、ドキュメントとチャットできるようにするという最初の目標を達成するには、Ollama の API に接続し、ファイル ストレージと処理機能を提供する別のアプリケーションが必要になります。多くのオプションがありますが、最も人気のあるのはprivateGPTですが、より多くのオプションを備えた別のアプリケーションとしてAnythingLLMがあります。

なんでもLLM

AnythingLLM は、あらゆるドキュメントとのチャットに役立つオープン ソース アプリケーションです。外部プロバイダーのモデルに接続したり、Ollama と組み合わせたりできます。

すべてのテキスト

AnythingLLM は LangChain を使用してドキュメントを処理します。多くの手順を経て、ドキュメントの主要なコンテンツがベクター形式に変換され、Vectorstore に保存されます。その後、取得を通じてドキュメントとチャットできるようになります。このプロセスの詳細については、こちらをご覧ください。

  • AnythingLLM をデバイスにクローンします。
git clone https://github.com/Mintplex-Labs/anything-llm anything-llm
  • アプリケーションのセットアップ:
cd anything-llm

yarn setup

yarnマシンにインストールされていることを確認してください。

  • バックエンドサーバーを実行します。
yarn dev:server
  • フロントエンドサーバーを実行します。
yarn dev:frontend
  • コレクターを実行します。
yarn dev:collector

上記の手順の後、ブラウザに移動し、http://localhost:3000AnythingLLM のインターフェイスが表示されれば、インストールは成功しています。

すべてのテキスト

ドキュメントを使用したチャット

Ollama と AnythingLLM が正常にインストールされたら、次はそれらを結合します。my-profile.txt以下の例では、次のような情報の一部を含むファイルを作成します。

Hi, my name is Lam.
I am a web developer with 6 years of experience.
I am proficient in Ruby, PHP, and Javascript.
I started my programming career in late 2017.
Prior to that, I worked as a civil engineer for 2 years.

次に、このファイルをチャットボットに提供し、上記の内容に関連するいくつかの質問をします。

セットアップモデル

AnythingLLM のメイン画面で、画面左下の設定ボタンをクリックします。次に、 [LLM 設定]タブに移動し、[Ollama] を選択し、以下のように情報を入力して保存します。

すべてのテキスト

[チャット モデルの選択]セクションには、Ollama がダウンロードしたモデルが表示されます。mistralこの場合、上でロードしたのでモデルです。

埋め込みのセットアップ

引き続き[埋め込み設定]タブに移動し、以下のように情報を保存します。

すべてのテキスト

チャットの作成

メイン画面に戻り、[新しいワークスペース]をクリックし、ワークスペースの名前を「About Me」と入力します。チャット ウィンドウが表示されます。[ドキュメントのアップロード]リンクをクリックして、ファイルのアップロード画面に移動します。

すべてのテキスト

AnythingLLM はさまざまなファイル形式をサポートしており、Web サイトからの直接リンクを使用できます。ファイルをアップロードした後、[保存して埋め込む]をクリックします。そして結果を見てみましょう。

すべてのテキスト

素晴らしいですね、チャットボットは提供したコンテンツで正確に応答しました。

結論

そこで私たちは、外部プロバイダーに依存せずにあらゆるドキュメントとのチャットをサポートするチャットボットを共同で作成しました。これを使用して、提供した情報に基づいて質問に回答する仮想アシスタントを構築することができます。また、徐々に学習して活用できる他の多くの利点も提供します。

出典 : https://viblo.asia/p/tu-tao-chatbot-ai-giup-ban-chat-voi-moi-tai-lieu-bXP4WjkoV7G

Please follow and like us:
Pin Share

30件のコメントがあります

  1. zoritoler imol

    Hello this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding expertise so I wanted to get advice from someone with experience. Any help would be greatly appreciated!

  2. tokekwin

    I think this site holds some rattling wonderful information for everyone : D.

  3. drover sointeru

    Simply wanna remark on few general things, The website layout is perfect, the subject matter is very wonderful. “I have seen the future and it doesn’t work.” by Robert Fulford.

  4. Fes Desert Tours

    Excellent goods from you, man. I’ve understand your stuff previous to and you are simply too wonderful. I really like what you have obtained right here, really like what you’re stating and the best way through which you are saying it. You’re making it entertaining and you still take care of to keep it smart. I can’t wait to learn far more from you. This is actually a terrific website.

  5. zoritoler imol

    Hello there! Do you know if they make any plugins to assist with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results. If you know of any please share. Many thanks!

  6. nitric boost ultra

    I have recommended your blog to all of my friends and family Your words have the power to change lives and I want others to experience that as well

  7. biovanish

    Keep up the amazing work! Can’t wait to see what you have in store for us next.

  8. balmorex pro

    Your blog has become my daily dose of positivity and inspiration It’s a space that I always look forward to visiting

  9. vorbelutrioperbir

    It¦s really a great and helpful piece of info. I am satisfied that you shared this useful info with us. Please stay us up to date like this. Thank you for sharing.

  10. My programmer is trying to convince me to move to .net from PHP. I have always disliked the idea because of the costs. But he’s tryiong none the less. I’ve been using Movable-type on a variety of websites for about a year and am concerned about switching to another platform. I have heard fantastic things about blogengine.net. Is there a way I can import all my wordpress posts into it? Any kind of help would be really appreciated!

  11. droversointeru

    I always was interested in this topic and still am, thanks for posting.

コメントを残す