Master's Dissertation for the Deep Learning and Generative AI Master's Degree at Datamecum | Supervisor: Quique García Vidal | Student: Maria Magdalena Balos
This master's final project focuses on Machine Learning and Deep Learning, with a particular emphasis on NLP generative models and Retrieval-Augmented Generation (RAG) and is part of the Master's Final Thesis (TFM) at Datamecum. It aims to implement tools introduced during the master's program, with a particular emphasis on NLP generative models and Retrieval Augmented Generation (RAG). The repository includes scripts and documentation to support the research and implementation of the project.
Click here to watch the video presentation of this project
This project was inspired by the episode AI in the Classroom of the podcast from Google DeepMind, where Professor Hannah Fry converses with Research Lead Irina Jurenka about the integration of AI in educational settings. Some ideas for AI implementations discussed in this episode include:
- Providing AI tutors for each student
- Tailoring lessons to each student's learning pace using AI
- Predicting where a student might struggle before they even realize it
Several important questions about AI in education are raised in this podcast, including:
- How can new technology integrate into the current educational system?
- What criteria should define good pedagogy in AI?
- How can we ensure everyone engages with AI as a tutor to enhance learning?
- How can we maintain engagement during difficult conversations with an AI tutor?
- To what extent should an AI tutor mimic human interaction?
This project aims to demonstrate how the educational system can be enhanced with AI, utilizing knowledge assessment to gauge student improvement. The assistant is designed to serve as a RAG-based educational tool for future students in the intensive or master's program. It allows users to ask questions related to specific subjects and provides a tool to evaluate students' knowledge through test questions. These assessments consist of multiple-choice questions with options a, b, c, and d, where only one answer is correct.
- RAG-Based Question and Answer Platform: A space for students to ask and answer subject-related questions using Retrieval Augmented Generation techniques.
- Knowledge Evaluation Tool: A system to create and take multiple-choice tests that assess understanding of the material.
- Enhance the learning experience for Datamecum master's students.
- Provide tools for self-assessment and peer support.
- Illustrate the benefits of applying Machine Learning and Deep Learning concepts, particularly RAG models, in educational tools.
Please follow these instructions after cloning the repository:
-
Install the required packages by running
pip install .orpip install -r requirements.txt.` -
API KEY: Define an API key for the OpenAI and/or Anthropic models in your environment, use:
export OPENAI_API_KEY=your-api-key-here -
CHROMADB: If you have access to the Datamecum ChroamDB created for this project, make sure to place the database directory inside the
rag/. If you don't have access to the database, you can still run this project creating a chroma database with your personal data. Here is how you can do it:
- Generate_transcriptions: fill the
VIDEOS_DIRvariable inconfig.jsonwith the path to the videos directory that you want to transcribe. Now go toscripts/transcribeand run the script withpython transcribe.py. Wait for it to finish. - Give access to the transcriptions: fill the
TRANSCRIPTIONS_DIRvariable inconfig.jsonwith the path to the directory where the transcriptions are saved. - When you run the RAG in the next section, the chromadb will be created automatically. The function
init_rag()inside therag.pyfile it has a condition that will load the chromadb database if its available or creates a new one with the documents available in the givenTRANSCRIPTIONS_DIRpath.
- If you want to run any other process, please ensure to fill the remaining
config.jsontemplate with your own paths before.
- Run the CLI version of the RAG system from the root directory with one of the following commands:
python scripts/main_rag_launcher.py --model gpt-4o-minipython scripts/main_rag_launcher.py --model claude-3-haiku-20240307
- Run the main Flask app from the root directory with:
python app.py
Please get in contact if these instructions are not clear for you or if you need any further support.
- Whisper (OpenAI) - Automatic transcription.
- text-embedding-ada-002 (OpenAI) – Embedding model for semantic indexing.
- FAISS (Facebook Research) – Vector search engine used during early development.
- ChromaDB - Final vector database used for retrieval.
- LangChain – Framework for building RAG pipelines with LLMs.
- GPT-4o-mini (OpenAI) – Language model used to generate answers.
- Claude-3-Haiku (Anthropic) – Alternative LLM evaluated in the system.
- Werkzeug Utils (Hash de contraseñas) – Used for secure password hashing.
- VAPI (voz generada) – Sugestion of posible future implementation for generating synthetic voice with AI.