A simple AI chatbot package
Project description
MLChatbotAI
MLChatbotAI is a Python package that provides tools for building, training, and deploying machine learning-based chatbots.
Features
- Build and train chatbot models using custom or inbuilt intents data.
- Flexible preprocessing tools for text data.
- Integration support for various applications.
Installation
You can install MLChatbotAI using pip:
pip install MLChatbotAI
This code for use the pre exits model
from MLChatbotAI import ChatBot
bot = ChatBot()
user_input = bot.take_command()
response = bot.get_response(user_input)
print(response)
This portion use for models which is train on external data
custom_model_path = "path/to/custom_model.h5"
custom_words_path = "path/to/custom_words.pkl"
custom_classes_path = "path/to/custom_classes.pkl"
custom_model, custom_words, custom_classes = trainer.load_custom_model(custom_model_path, custom_words_path, custom_classes_path)
user_input_custom = "How are you?"
response_custom = trainer.get_response_using_model(custom_model, custom_words, custom_classes, user_input_custom)
print(response_custom)
Train Chatbot with external data
This for how can train model with pre built data
from MLChatbotAI import ChatBotTrainer
trainer = ChatBotTrainer()
trained_model_default, words_default, classes_default = trainer.train_default()
This is example of train model on custom data wihtout giving no path
from MLChatbotAI import ChatBotTrainer
trainer = ChatBotTrainer()
custom_intents_data = {
"intents": [
{"tag": "greeting", "patterns": ["Hi", "Hello", "Hey"], "responses": ["Hello! How can I help you?"]},
# Add more custom intents as needed
]
}
trained_model_custom, words_custom, classes_custom = trainer.train_custom(custom_intents_data)
This is code for train model with giving path
from MLChatbotAI import ChatBotTrainer
trainer = ChatBotTrainer()
file_path = "path/to/custom_intents_file.json"
trained_model_file, words_file, classes_file = trainer.train_from_file(file_path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mlchatbotai-0.10.tar.gz
(5.8 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlchatbotai-0.10.tar.gz.
File metadata
- Download URL: mlchatbotai-0.10.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c5ee612e70d959ef5fe036d50a89b603e9a84984ed4224401bd4a558ed58fa1
|
|
| MD5 |
a7a68e3f7bd27d1e787fb2fbd47d5548
|
|
| BLAKE2b-256 |
a75e9d8f976acc98f4217209b9eb1a4b74886f9295f62503c73240a047da8349
|
File details
Details for the file mlchatbotai-0.10-py3-none-any.whl.
File metadata
- Download URL: mlchatbotai-0.10-py3-none-any.whl
- Upload date:
- Size: 5.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78de3af9af099341bb3869e4f1a153ae0c06914b7508d86531f32cb944c88ace
|
|
| MD5 |
f13cb3fe5631715c08de7fc440f50715
|
|
| BLAKE2b-256 |
b2a91649627de3644ba83d27c75d21d65561f75550fa7e15667aed6f3502b158
|