Observed since 21 Oct, 09:57 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
AssistantBot is a python package which provides an question-answering system designed to process large datasets efficiently. It dynamically matches user queries with relevant data, offering accurate responses and easy training process.
Assistant AI is a simple conversational assistant package that uses predefined questions and answers to provide relevant responses. The package also supports training, where you can add new questions and answers dynamically.
difflib to match input questions with the closest possible question in the model.Clone the repository and navigate to your project folder:
git clone https://github.com/wassim-khleifi/ai_assistantbot.git
cd ai_assistantbot
You can install the package using pip:
pip install .
Or install via pypi:
pip install ai_assistantbot
First, import and initialize the Assistant class with the path to the JSON file that stores the model data:
import ai_assistantbot
from ai_assistantbot import Assistant
# Initialize the assistant with the model JSON file
assistant = Assistant('path_to_your_model.json')
# Register the base model (if not created)
assistant.register()
Use the get_answer method to fetch answers based on user questions:
response = assistant.get_answer("hi", not_found="Sorry, I don't understand")
print(response) # Output: Hey there!
You can train the assistant by providing new questions and answers:
new_questions = ["how are you", "how's it going"]
new_answers = ["I'm doing great, thanks!", "All good!"]
assistant.train_model(new_questions, new_answers)
This example is taken from examples/example.py
import ai_assistantbot
from ai_assistantbot.assistant import *
# Initialize the assistant with the model JSON file
assistant = Assistant('example.json')
assistant.register() # Register the base model (if not created)
while True:
user_input = input('You: ')
response = assistant.get_answer(str(user_input), not_found="Sorry, I don't understand")
print('Bot: ' + response)
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.
This project is licensed under the MIT License:
MIT License
Copyright (c) 2024 Wassim Khleifi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.11 | 11 Sept 2024 | 0 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 09:57 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:d5352e0a1248fc5d7dd1aa72a33f5cbb104501361774c66aad136bfdfd26b878