Project

ai_chatbot

0.0
The project is in a healthy, maintained state
Fixed the model error in version 0.1.6.5.4. Details are available on Git. Also added a new package rapidfuzz. Please make sure to run pip install rapidfuzz.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 0
 Project Readme

AiChatbot

AiChatbot is a lightweight Ruby gem that provides a simple AI-based chatbot using TF-IDF vectorization and Naive Bayes classification. It supports learning new Q&A pairs and predicting answers based on cosine similarity.


🔧 Gem Installation

Add this line to your Gemfile:

gem 'ai_chatbot', '0.1.6.5.2'

And then execute:

bundle install

Or install it directly:

gem install ai_chatbot

🚀 Usage Example

require 'ai_chatbot'

chatbot = AiChatbot::Bot.new

# Predict an answer
puts chatbot.predict("How to create a model in Rails?")

# Add new training data
chatbot.train("How to upload a dish in hotel?", "Use the admin panel under 'Menu Upload' to add a dish.")

💡 Features

  • ✅ TF-IDF Vectorizer for understanding query intent
  • ✅ Cosine Similarity for matching confidence
  • ✅ Naive Bayes Classifier for predictions
  • ✅ Add / Update / Delete Q&A pairs
  • ✅ CLI Support

📁 CLI Usage

ruby chatbot.rb predict "How to add a route?"
ruby chatbot.rb train_model "What is RubyGems?" "A package manager for Ruby libraries."

📦 Development

To build and install locally:

bundle install
gem build ai_chatbot.gemspec
gem install ./ai_chatbot-x.y.z.gem

To release:

rake release

🔐 License

This project is licensed under the MIT License.


👨‍💻 Author

Sanket Tikhande
GitHub: @tikhandesanket