Sadra-rezaei/Chat-Bot

5

stars

9

commits

Python

primary language

Dec 22, 2025

updated

README

Chat Bot

This is a Q&A-based chatbot, not a Large Language Model (LLM).


๐Ÿš€ Features

  • Sentence embedding
  • Question answering
  • Customizable Q&A database

๐Ÿ› ๏ธ Tech Stack


โ–ถ๏ธ Usage

Run the chatbot using Streamlit:

# example
streamlit run ChatBot.py

๐Ÿ“– Example

Example Output


๐Ÿง  How It Works

  1. When you ask a question, the sentence is embedded first.

  2. The answer() function compares your question with all embedded questions in the question bank and finds the most similar one.

  3. The similarity score ranges from 0 (least similar) to 1 (most similar).
    If the highest similarity score is below 0.3, the function returns "I don't know"


๐Ÿงช Tests

This project includes two test files:

  1. EmbeddingTesting.py
    • Compares two sentences and shows how similar they are (from 0 to 1).
  2. AnsweringTesting.py
    • Similar to ChatBot.py, but without the Streamlit GUI.
    • Useful if you encounter issues with Streamlit

โ“Is it just for Computer Engineering?

No! you can customize your own question bank. just use this pattern for questionBank.json :

{
  "questions": [
    {
      "id": "optional",
      "question": "your question",
      "answer": "the answer returned by the chatbot",
      "embedding": []
    }
  ]
}


๐Ÿ‘ค Author

Sadra Mir Mohammad Rezaei Email: sadrarezaei4@gmail.com

Contributors

Sadra-rezaei

9 commits

Sadra-rezaei/Chat-Bot

5

stars

9

commits

Python

primary language

Dec 22, 2025

updated

README

Chat Bot

This is a Q&A-based chatbot, not a Large Language Model (LLM).


๐Ÿš€ Features

  • Sentence embedding
  • Question answering
  • Customizable Q&A database

๐Ÿ› ๏ธ Tech Stack


โ–ถ๏ธ Usage

Run the chatbot using Streamlit:

# example
streamlit run ChatBot.py

๐Ÿ“– Example

Example Output


๐Ÿง  How It Works

  1. When you ask a question, the sentence is embedded first.

  2. The answer() function compares your question with all embedded questions in the question bank and finds the most similar one.

  3. The similarity score ranges from 0 (least similar) to 1 (most similar).
    If the highest similarity score is below 0.3, the function returns "I don't know"


๐Ÿงช Tests

This project includes two test files:

  1. EmbeddingTesting.py
    • Compares two sentences and shows how similar they are (from 0 to 1).
  2. AnsweringTesting.py
    • Similar to ChatBot.py, but without the Streamlit GUI.
    • Useful if you encounter issues with Streamlit

โ“Is it just for Computer Engineering?

No! you can customize your own question bank. just use this pattern for questionBank.json :

{
  "questions": [
    {
      "id": "optional",
      "question": "your question",
      "answer": "the answer returned by the chatbot",
      "embedding": []
    }
  ]
}


๐Ÿ‘ค Author

Sadra Mir Mohammad Rezaei Email: sadrarezaei4@gmail.com

Contributors

Sadra-rezaei

9 commits

Languages

Python

100.0%