Skip to content

Sherbieny/chatbotto

Repository files navigation

チャットボット

説明

このプロジェクトは、Nextjs と Nodejs で構築されたルールベースのチャットボットアプリケーションです。日本語の形態素解析にRakutenMAライブラリを使用し、ユーザーとの対話のためのチャットインターフェースを提供します。アプリケーションには、ユーザーの入力の各単語の重要性を決定するために使用されるWeightsデータを管理するための管理ページも含まれています。

デモ

Chatbotto on Vercel

インストール

  1. リポジトリをクローンします。

    git clone <repository-url>
  2. 依存関係をインストールします。

     npm install
  3. .env.local.tmp.env.localに名前を変更し、環境変数を入力します。

  4. ローカルで MongoDB のデータベースを作成するか、MongoDB Atlas などのクラウドデータベースサービスを使用します。

    1. chatbottoという名前のデータベースとweightsという名前のコレクションを作成します。
    2. qaという名前のコレクションを作成します。
    3. settingsという名前のコレクションを作成します (空でも構いません)。
    4. [オプション] sample_dataの json ファイルを使用して、サンプルデータでデータベースを作成します。

アプリケーションの実行

開発モードでアプリケーションを実行するには、次のコマンドを使用します。

npm run dev

本番モードでアプリケーションをビルドして実行するには、次のコマンドを使用します。

npm run build
npm start

Docker

このプロジェクトには、Docker コンテナでアプリケーションを実行するための Dockerfile と docker-compose.yml ファイルが含まれています。Docker コンテナをビルドして実行するには、次のコマンドを使用します。

docker-compose build
docker-compose up

機能

  • ユーザーとの対話のためのチャットインターフェース
  • RakutenMA ライブラリを使用した形態素解析
  • アプリケーションを管理するための管理ページ
  • ユーザーの入力の各単語の重要性を決定するための重みデータ
  • qa データはJaQuADデータセットに基づいています
  • JaQuAD JSON データ処理は、JSON データセットファイルを取り込み、QA データベースコレクション用の QA データファイルに変換するものです。
  • 画像とアイコンは ChatGPT DALL-E によって生成されます

ツールとテクノロジー

貢献

貢献は歓迎します。プルリクエストを送信するか、変更内容を議論するための問題を作成してください。

Chatbotto

Description

This project is a rule-based chatbot application built with Nextjs, and Nodejs. It uses the RakutenMA library for morphological analysis of Japanese language and provides a chat interface for user interaction. The application also includes an admin page for managing the application's Weights data that is used to determine the importance of each word in the user's input.

Demo

Chatbotto on Vercel

Installation

  1. Clone the repository:

    git clone <repository-url>
  2. Install the dependencies:

    npm install
  3. Rename .env.local.tmp to .env.local and fill in your environment variables.

  4. Create a database locally in MongoDB or use a cloud database service such as MongoDB Atlas.

    1. Create a database named chatbotto and a collection named weights.
    2. Create a collection named qa
    3. Create a collection named settings(can be empty)
    4. [Optional] use the json files in sample_data to populate the database with sample data.

Running the Application

To run the application in development mode, use the following command:

npm run dev

To build and run the application in production mode, use the following commands:

npm run build
npm start

Docker

This project includes a Dockerfile and a docker-compose.yml file for running the application in a Docker container. To build and run the Docker container, use the following commands:

docker-compose build
docker-compose up

Features

  • Chat interface for user interaction
  • Morphological analysis using the RakutenMA library
  • Admin page for managing the application
  • Weights data for determining the importance of each word in the user's input
  • qa data is based on JaQuAD dataset
  • JaQuAD json data process that takes json dataset files and converts it into qa data files ready for the qa database collection
  • Images and icons are generated by ChatGPT DALL-E

Tools and Technologies

Contributing

Contributions are welcome. Please submit a pull request or create an issue to discuss the changes you want to make.