Giter Club home page Giter Club logo

banking-faq-bot's Introduction

Banking FAQ Bot

This is retrieval based Chatbot based on FAQs found at a banking website. I've scraped the FAQs of various section from a banking website and saved it in a JSON file with format {section: [[question, answer], [question, answer], ...] }

Then I merged all this section into one big JSON file with all sections

Later I have transformed this JSON file to CSV and used the section names as class for the questions

Then I preprocess this csv file by stemming and tf-idf vectorizing the questions The same process is applied to user's query.

I have used Support Vector Machine with linear kernel to classify the user's query into different classes Once the class is found, I define a subset of questions belonging to this class and then use Cosine Similarity to find the most likely question The answer associated with the question with maximum cosine similarity to user's query is served to the user.

Various options are provided in case of mismatch. These are Debug - Let's you know the class predicted and the question with maximum cosine similarity TOP5 - Gives answer to top 5 questions with cosine similarity to user's query in descending order

banking-faq-bot's People

Contributors

mrjay10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

banking-faq-bot's Issues

Accuracy of faq bot

Is there any way to test the numerical accuracy of the bank faqbot code against a data set of questions and answers? I was curious since your code seems very streamlined and efficient.

error#3

Bot: Hi, Welcome to our bank!
You: What are the documents required for opening a Current Account of a sole proprietorship firm
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2646, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'question'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/adnan/PycharmProjects/untitled/banking-faq-bot-master/Bank FAQbot.py", line 152, in
chat()
File "/Users/adnan/PycharmProjects/untitled/banking-faq-bot-master/Bank FAQbot.py", line 115, in chat
for question in questionset['question']:
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pandas/core/frame.py", line 2800, in getitem
indexer = self.columns.get_loc(key)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'question'

Process finished with exit code 1

#this issue iam not able to resolve in your code

Warning

Warning (from warnings module):
File "/Users/RawanAbdullah/Documents/chatbotQu.py", line 7
from collections import Mapping, defaultdict
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working

Error!!

Traceback (most recent call last):
File "Bank FAQbot.py", line 158, in
chat()
File "Bank FAQbot.py", line 113, in chat
class_ = le.inverse_transform(model.predict(t_usr)[0])
File "C:\Users\M1042421\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\preprocessing\label.py", line 273, in inverse_transform
y = column_or_1d(y, warn=True)
File "C:\Users\M1042421\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\utils\validation.py", line 760, in column_or_1d
raise ValueError("bad input shape {0}".format(shape))
ValueError: bad input shape ()

error

Traceback (most recent call last):
File "C:\Users\muthupandy\AppData\Local\Programs\Python\Python35\myi.py", line 67, in
class_ = le.inverse_transform(model.predict(t_usr)[0])
File "C:\Users\muthupandy\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\preprocessing\label.py", line 273, in inverse_transform
y = column_or_1d(y, warn=True)
File "C:\Users\muthupandy\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\validation.py", line 797, in column_or_1d
raise ValueError("bad input shape {0}".format(shape))
ValueError: bad input shape ()

please help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.