This project implements an advanced Retrieval-Augmented Generation (RAG) chatbot focused on golf instruction, emulating the teaching style of legendary golfer Ben Hogan. The chatbot leverages state-of-the-art natural language processing and computer vision techniques to provide accurate, context-aware responses along with relevant visual aids.
-
Advanced Text Processing
- Utilized the
StatisticalChunkerfrom thesemantic_chunkerslibrary for intelligent text segmentation. - Implemented sophisticated text splitting methods to create meaningful chunks for embedding.
- Utilized the
-
AI-Powered Image Labeling
- Employed Claude, an advanced AI model, to generate detailed descriptions of golf-related images.
- These AI-generated descriptions enhance the quality and relevance of image retrieval.
-
Multimodal Embeddings
- Created embeddings for both text and AI-labeled images using CLIP (Contrastive Language-Image Pre-Training).
- Employed FAISS for efficient similarity search on image embeddings.
-
Vector Storage and Retrieval
- Used Chroma as a vector store for text embeddings, enabling fast and relevant information retrieval.
- Implemented a custom retrieval mechanism for matching relevant images to text responses.
-
RAG Pipeline
- Developed a Retrieval-Augmented Generation pipeline using LangChain.
- Integrated OpenAI's GPT model for high-quality text generation based on retrieved context.
-
Prompt Engineering
- Crafted detailed prompts to guide the AI in responding in Ben Hogan's distinctive style.
- Designed prompts to seamlessly incorporate diagram descriptions into responses.
-
Streamlit Web Application
- Created an interactive web interface using Streamlit for easy user interaction.
- Implemented real-time response generation and relevant image display.
- Text Processing: Used
StatisticalChunkerfor creating semantically meaningful text chunks. - Image Labeling: Leveraged Claude AI for generating descriptive labels for golf-related images.
- Embeddings: Utilized CLIP for creating joint embeddings of text and AI-labeled images.
- Similarity Search: Implemented FAISS for fast and efficient similarity search in high-dimensional spaces.
- Vector Storage: Employed Chroma for storing and retrieving text embeddings.
- Language Model: Utilized OpenAI's GPT for generating human-like responses.
- Web Framework: Built with Streamlit for a responsive and user-friendly interface.
- AI-Assisted Data Preparation: The use of Claude for image labeling represents an innovative approach to preparing multimodal data for embedding and retrieval.
- Semantic Chunking: The application of statistical chunking methods ensures that text is split into meaningful, context-preserving segments.
- Multimodal Retrieval: By combining text and image embeddings, the system can provide more comprehensive and relevant responses to user queries.
- Implement conversation history management for context-aware multi-turn interactions.
- Expand the knowledge base to cover a wider range of golf instruction topics.
- Optimize retrieval and generation pipeline for improved response times.
- Implement user feedback mechanism for continuous improvement of the chatbot.
- Explore fine-tuning of language models on golf-specific data for even more accurate responses.
- See
notebooks/rag.ipynbfor the retrieval pipeline. - To run the streamlit app, create a virtual environment with python version <= 3.11, install the
app/requirements.txtand runstreamlit run app.py.
This project uses content derived from published golf instruction materials. The use of this content is intended for educational and research purposes only.
Important points to note:
- This project is not affiliated with, endorsed by, or connected to Ben Hogan, his estate, or any official Ben Hogan branded entities.
- The content used in this project may be subject to copyright. Users should be aware that the redistribution or commercial use of this content may infringe on copyright laws.
- This project is a proof-of-concept and should not be used for commercial purposes without proper licensing and permissions from copyright holders.
- If you are a copyright holder and believe that your work has been used inappropriately in this project, please contact [simonryu328@gmail.com] to address the issue.
Users are advised to seek proper legal advice before using this project or its outputs for any purpose other than personal, educational use.
While this project aims to innovate in the field of AI and golf instruction, it's important to consider the ethical implications of using copyrighted material. Future iterations of this project should explore:
- Obtaining proper permissions or licenses for copyrighted content.
- Developing original content in collaboration with golf professionals.
- Using only publicly available, open-source golf instruction materials.
