This project explores the development of an AI-driven chatbot designed to assist students with their studies. Leveraging pre-trained models from Hugging Face and datasets such as SQuAD, the chatbot is capable of answering questions, summarizing notes, and providing educational insights. The aim of this project is to demonstrate the potential of machine learning in enhancing academic productivity and engagement
Tools and Frameworks
Google Colab: Used as the development environment for the project.
Streamlit: For creating an interactive user interface.
Hugging Face Transformers: For pre-trained language models.
Datasets Library: For accessing popular datasets like SQuAD and Persona-Chat.
Implementation Steps:
Load pre-trained models using the Hugging Face Transformers library.
Preprocess datasets to match the input format required by the models.
Create a simple Streamlit interface for interacting with the chatbot.
Test and fine-tune the chatbot’s responses based on sample questions.
Deployment:
The application was deployed locally on Google Colab, and users interacted with it via the Streamlit interface.
Code Snippet
Here is a snippet demonstrating the integration of a question-answering model:
from transformers import pipeline
qa_pipeline = pipeline("question-answering", model="distilbert-base-cased-distilled-squad")
question = "What is the capital of France?"
context = "France, in Western Europe, encompasses medieval cities, alpine villages, and Mediterranean beaches. The capital of France is Paris."
result = qa_pipeline(question=question, context=context)
print(result['answer'])
Question Answering: The chatbot successfully provides precise answers to factual questions based on provided context.
Conversational Capability: The chatbot engages users with general-purpose conversations, powered by the DialoGPT model.
Summarization: The chatbot summarizes long-form content into concise explanations using fine-tuned models.