Development of AI-Powered Remittance Chatbot

adetunjijeremiah1
3 min readJul 23, 2024

--

HDSC SPRING’24 CAPSTONE PROJECT BY TEAM BERT

Introduction

In today’s interconnected world, people travel across various countries for different purposes such as schooling, vacations, business, work, sporting events, carnivals etc. Remittances support millions of individuals, families, and governments in driving economic development. However, navigating the complex landscape of international money transfers to get simplified information on remittance can be daunting. Our team developed an AI-powered Remittance Chatbot to make remittance information more accessible and understandable for everyone.

Objectives

  1. Develop a conversational AI chatbot capable of answering remittance-related queries accurately and contextually.
  2. Create a comprehensive knowledge base covering remittance patterns, costs, processes, and regulations.
  3. Implement and evaluate various NLP models to find the most effective solution.
  4. Design a user-friendly interface for easy interaction with the chatbot.
  5. Explore the potential for integration with existing remittance systems.

Methodology

Remittance Chatbot Development Flowchart

Our approach involved several key steps:

  1. Data Collection and Preprocessing: We gathered diverse remittance-related data from authoritative sources, including regulatory information, and transactional data.
# Load and preprocess PDF data
FILE_PATHS = ["./documents/migration_development_brief_38_june_2023_0.pdf"]
all_texts = []

for file_path in FILE_PATHS:
loader = PyPDFLoader(file_path)
pages = loader.load_and_split()
texts = [page.page_content for page in pages] # Extract text from each page
all_texts.extend(texts)

2. Knowledge Base Construction: We built a structured knowledge base to serve as the foundation for our chatbot’s responses.

# Combine all extracted texts into a single context string
context = " ".join(all_texts)

3. Model Exploration: We tested multiple NLP models, including:

  • BERT-based models with PDF data
  • OLLAMA models (Gemma, Mistral, Llama3)
  • Hugging Face models (GPT-2 variants)
  • OpenAI’s GPT-3.5-Turbo

4. Model Evaluation and Selection: After rigorous testing, we identified GPT-3.5-Turbo as the most suitable model for our needs.

# Load pre-trained question-answering model
qa_pipeline = pipeline("question-answering", model="bert-large-uncased-whole-word-masking-finetuned-squad")

# Function to answer questions
def answer_question(query, context):
result = qa_pipeline(question=query, context=context)
return result['answer']

5. Iterative Training and Refinement: We fine-tuned the model continuously to improve its accuracy and relevance in the remittance domain.

6. Local Deployment: We implemented a local deployment using Streamlit, creating a functional user interface for testing and demonstration.

st.title("Remittance Chatbot")

st.write("This app allows you to ask questions on remittance")

prompt = st.chat_input("Ask a question about remittance:")


if prompt:
cont = context
if context:
st.write(f"Message by user: {prompt}")
answer = answer_question(prompt, context)
st.write("Answer:", answer)
else:
st.write("Cannot answer your question")
else:
st.write("Please enter a question.")

Result

Remittance chatbot responding to a prompt

We developed a functional Remittance Chatbot capable of handling a wide range of queries.

  • GPT-3.5-Turbo showed superior performance in understanding and responding to remittance-related questions.
  • Our local Streamlit deployment provided a user-friendly interface for interacting with the chatbot.
  • Initial user feedback indicated high satisfaction with the chatbot’s accuracy and ease of use.
  • Identified challenges include model response times and API access costs

Conclusion

Our Remittance Chatbot project demonstrates the potential of AI in simplifying access to complex financial information. While challenges remain in scaling and integration, there are exciting possibilities for enhancing financial literacy and empowering individuals in the global remittance ecosystem.

As we move forward, we envision this technology not just as a tool, but as a catalyst for financial inclusion, making the world of international money transfers more transparent and accessible to all.

Documentation: This is a link to our GitHub page

Contributors: Prosperity Oguama, Fatimah Adwan,
Emmanueldashing, Babatunde Akanfe, Oyewale Daniel, Ebuka Obi, Abimbola Sekinat Abimbola, Olanrewaju AMUDIPE

#AI #Chatbots #ChatGPT #LLMs #Remittance #Data #DataScience

--

--