How phatjkk/nttu-chatbot works
Main Components
• Front-end: Located in the “front-end” directory, it contains the UI code (HTML, CSS, JavaScript/React—using Vite, Tailwind CSS, etc.). This is the interactive user layer where students interact with the chatbot.
• Back-end: Found in the “back-end” folder (e.g., RAG_SERVER_GPU.ipynb) which likely handles the server-side logic, managing chatbot queries and possibly coordinating with the language model.
• Vector Database: The “vector_database” directory holds the notebook for creating the vector database (VECTOR_DATABASE_CREATE.ipynb) that stores document embeddings used for retrieval.
• Model Training: The “training_model” directory includes notebooks like Fine_tuning_Zephyr_generator.ipynb for fine-tuning the generator models, a key aspect of the chatbot’s language generation capability.
• Data Analysis: The “data_analysis” directory contains notebooks to analyze data; useful for optimizing the RAG or for further insights.
• Evaluation: The “eval_rag” directory splits into subfolders for automated metric evaluation (BERT score evaluation notebooks) and human evaluation (user feedback and visualizations). These components are essential for continuously assessing chatbot performance.
• Dataset: The “dataset” directory holds raw data files (Excel, PDFs, text files) that serve as the source documents for the RAG system.
Relationships and Interactions
• User Interaction Flow:
• The user accesses the Chatbot via the Front-end web interface.
• User requests are sent (via API calls or similar mechanisms) from the Front-end to the Back-end.
• Back-end Processing:
• The Back-end (RAG server) accepts the query and interacts with the LLM to generate a response.
• This process likely involves querying the Vector Database for relevant document embeddings.
• The RAG design implies that document retrieval serves as a supporting module to provide context to the language model.
• Continuous Improvement Pipeline:
• The Training Model notebooks allow for fine-tuning on specific data (e.g., Zephyr generator adjustments) to improve response quality.
• Data Analysis notebooks help diagnose performance issues whereas Evaluation notebooks (both automated and human) validate system output.
Architectural Patterns and Design Principles
• Separation of Concerns: Each component (UI, API/server logic, data processing/training, and evaluation) is developed and maintained separately.
• Modular Design: The clear categorization (frontend, backend, vector database, training, evaluation) supports modularity, allowing updates or improvements to specific parts independently.
• Pipelines for Improvement: There is an evident design for continuously iterating on the model performance via training, testing, and evaluation pipelines.