AI Account Chatbot Report 22-07-2024
AI Account Chatbot Report 22-07-2024
Technical Implementation:
Chatbot Framework:
o Uses ChatterBot for basic conversational capabilities.
o Trained with initial responses related to account creation and other
functionalities.
Data Management:
o Utilizes Pandas for managing data in-memory (e.g., accounts_df, contacts_df).
o SQLAlchemy is used for persistent storage with a SQLite database.
API Integration:
o External services like accountants.io are integrated for operations like bank
statement reconciliation.
o Example API endpoints are provided for account creation, contact
management, and reconciliation.
Web Application Framework:
o Flask is used to build the web application with RESTful API endpoints.
o Flask-Marshmallow is used for object serialization.
Database Models:
o SQLAlchemy models define the schema for Accounts, Contacts, Product
Classes, Services, Bank Statements, Projects, Work Orders, Billable Claims,
and Payroll.
Future Enhancements:
o Implement advanced algorithms for generating estimates based on historical
data.
o Develop customized dashboards with interactive features and advanced data
visualization.
Code:
python
Copy code
import chatterbot
from chatterbot.trainers import ListTrainer
import pandas as pd
import numpy as np
import requests
import os
import json
from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from accountants_io_api import AccountantsIOAPI # assuming you have an API
wrapper for accountants.io
class Contact(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
email = db.Column(db.String(100), nullable=False)
class ProductClass(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
class Service(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
class BankStatement(db.Model):
id = db.Column(db.Integer, primary_key=True)
account_id = db.Column(db.Integer, db.ForeignKey("account.id"))
account = db.relationship("Account", backref="bank_statements")
statement_date = db.Column(db.DateTime, nullable=False)
balance = db.Column(db.Float, nullable=False)
class Project(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
account_id = db.Column(db.Integer, db.ForeignKey("account.id"))
account = db.relationship("Account", backref="projects")
class WorkOrder(db.Model):
id = db.Column(db.Integer, primary_key=True)
project_id = db.Column(db.Integer, db.ForeignKey("project.id"))
project = db.relationship("Project", backref="work_orders")
description = db.Column(db.String(200), nullable=False)
class BillableClaim(db.Model):
id = db.Column(db.Integer, primary_key=True)
work_order_id = db.Column(db.Integer, db.ForeignKey("work_order.id"))
work_order = db.relationship("WorkOrder", backref="billable_claims")
amount = db.Column(db.Float, nullable=False)
class Payroll(db.Model):
id = db.Column(db.Integer, primary_key=True)
account_id = db.Column(db.Integer, db.ForeignKey("account.id"))
account = db.relationship("Account", backref="payrolls")
employee_name = db.Column(db.String(100), nullable=False)
salary = db.Column(db.Float, nullable=False)
@app.route("/create_contact", methods=["POST"])
def create_contact():
data = request.get_json()
contact = Contact(name=data["name"], email=data["email"])
db.session.add(contact)
db.session.commit()
return jsonify({"message": "Contact
LIST OF QUESTION:
1) FOR TRAINING THE CHATBOT WE NEED DATASET COULD U PLEASE GIVE
US ACCES TO UR DATA BASE OR DAY BOOK ?