--- license: mit title: AI_tutor sdk: gradio emoji: 📚 colorFrom: red colorTo: yellow pinned: true app_file: main.py short_description: AI Tutor tool transforms documents or queries into lectures sdk_version: 5.33.1 tag: "agent-demo-track" --- title: AI tutor sdk: gradio app_file: main.py pinned: false # AI Tutor Application ## Overview The AI Tutor Application is an advanced tool designed to transform documents (e.g., PDFs) or user queries into interactive and structured lectures. Equipped with cutting-edge AI capabilities, this application provides voice narration, retrieval-augmented generation (RAG) chatbot functionality, and PDF generation for educational purposes. ## Features ### 1. **Lecture Generation** - Converts PDF content or user-provided queries into structured lectures. - Generates detailed outlines, sections, and content tailored to the user's learning objectives. - Supports multiple styles (e.g., academic, casual) and includes examples if requested. ### 2. **Voice Narration** - Synthesizes lecture content into audio using text-to-speech (TTS) technology. - Offers multiple voice options to suit user preferences. ### 3. **RAG Chatbot** - Provides a chatbot powered by Retrieval-Augmented Generation (RAG) to answer questions based on lecture or PDF content. - Maintains session memory for personalized interactions. ### 4. **PDF Processing** - Extracts and processes text from PDF files. - Supports metadata extraction and text cleaning for better analysis. ### 5. **Interactive Gradio Interface** - User-friendly interface for uploading documents, generating lectures, and interacting with the chatbot. - Allows users to download generated lectures as PDFs or audio files. ### 6. **Customizable Learning Objectives** - Users can specify learning objectives to tailor the lecture content. - AI analyzes objectives to create relevant and engaging content. ## How It Works 1. **Input**: Upload a PDF document or provide a query/learning objective. 2. **Processing**: The application analyzes the input, generates a structured lecture, and optionally synthesizes audio. 3. **Output**: Download the lecture as a PDF or listen to the audio narration. ## Installation 1. Clone the repository: ```bash git clone ``` 2. Navigate to the project directory: ```bash cd PDFLectureMaster ``` 3. Install dependencies: ```bash pip install -r requirements.txt ``` ## Usage 1. Start the Gradio interface: ```bash python main.py ``` 2. Open the provided URL in your browser. 3. Upload a PDF or enter a query to generate a lecture. ## Project Structure - `main.py`: Entry point for the Gradio application. - `app/`: Contains the core modules for lecture generation, chatbot, PDF processing, and more. - `lecture_generator.py`: Handles lecture creation. - `voice_synthesizer.py`: Converts text to speech. - `rag_system.py`: Implements the RAG chatbot. - `pdf_processor.py`: Extracts and processes PDF content. - `gradio_interface.py`: Defines the Gradio interface. ## Requirements - Python 3.11 or higher - OpenAI API key (set in `.env` file) ## Environment Variables Create a `.env` file in the project root and add the following: ```env OPENAI_API_KEY= ``` ## License This project is licensed under the MIT License. See the LICENSE file for details. ## Acknowledgments - [OpenAI](https://openai.com/) for GPT-based models. - [Gradio](https://gradio.app/) for the interactive interface. - [ReportLab](https://www.reportlab.com/) for PDF generation. --- *This project was developed to make learning more interactive and accessible by leveraging AI technologies.*