https://github.com/elysian01/ai-chatbot
Python library for building custom AI chatbot with just one line of code.
https://github.com/elysian01/ai-chatbot
ai-chatbot bag-of-words bert chatbot custom-chatbot lstm-neural-networks python python-library seq2seq
Last synced: 7 days ago
JSON representation
Python library for building custom AI chatbot with just one line of code.
- Host: GitHub
- URL: https://github.com/elysian01/ai-chatbot
- Owner: Elysian01
- License: mit
- Created: 2021-04-14T12:30:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T01:55:39.000Z (over 2 years ago)
- Last Synced: 2025-04-10T02:59:03.423Z (6 months ago)
- Topics: ai-chatbot, bag-of-words, bert, chatbot, custom-chatbot, lstm-neural-networks, python, python-library, seq2seq
- Language: Jupyter Notebook
- Homepage: https://pypi.org/project/aichatbot/
- Size: 3.55 MB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AI-Chatbot 🤖
[](https://pepy.tech/project/aichatbot)
### Python library for building custom AI Chatbot with just one line of code.
## Get Started
Install the package
```
pip install aichatbot
```Load the module
```python
import aichatbot as bot
```**Create the `intents file` by following format**
```json
{
"intents": [
{
"tag": "tag name",
"patterns": ["example-1 of user query", "example-2 of user query", "example-3"],
"responses": ["bot response-1", "bot response-2", "bot response-3"]
}
]
}
```The `patterns` contains a list of example `expected user query`, which user will enter and `responses` contains the list of `bot response`.
Whenever a user inputs a query, bot will find the closest match with the `patterns`, and then select a random response from the list of `responses` specified under that pattern name.
**Example**
```json
{
"intents": [
{
"tag": "greeting",
"patterns": ["Hi", "How are you", "Is anyone there?", "Hello", "Good day"],
"responses": ["Hello, thanks for visiting", "Good to see you again", "Hi there, how can I help?"]
},{
"tag": "goodbye",
"patterns": ["Bye", "See you later", "Goodbye"],
"responses": ["See you later, thanks for visiting", "Have a nice day", "Bye! Come back again soon."]
}
]
}
```**Create the model**
```python
filenames = {
"intents": "./data/basic_intents.json",
"dir": "dumps"
}bot_model = bot.Create(filenames, technique="bow")
````intents` : Path to your intents file.
`dir`: Specify the directory where you want to save the bot model.
`technique`: Choose among [ bow | lstm | bert ]That's it 😊, **Start your conversation**
```python
bot.start(bot_model)
```Optional Parameter:
`end_conversation` : Contains strings to stop the chatbot.
`end_response` : Output Message when bot quitsExample:
```python
bot.start(bot_model, end_conversation=["/stop", "quit"], end_response="Thankyou for your time :)")
```Python Package: https://pypi.org/project/aichatbot/