Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EduTube Tasks

Generate learning tasks from YouTube video transcripts and get AI feedback on answers. Uses Hugging Face models (Inference API) and RAG over the transcript.


Contents


Technologies & features

  • Transcript: YouTube URL → transcript (and optional language detection) via youtube-transcript-api and a small LangChain chain.
  • RAG: Transcript split into chunks, embedded with sentence-transformers (multilingual MiniLM), stored in FAISS; retriever used for evaluation and Q&A.
  • Task generation: LLM (Hugging Face Inference API) produces structured tasks: comprehension, multiple choice, fill-in-the-blanks, vocabulary, reflection.
  • Answer evaluation: User answer + task + RAG context → same LLM → short feedback and suggestions.
  • Agent: Follow-up questions answered using transcript search + LLM (no separate tool-calling agent).
  • UI: Streamlit app: paste URL → generate workbook → answer tasks → submit for feedback; optional follow-up question per task.

Usage examples

Generate workbook and get feedback

  1. In the sidebar, paste a YouTube URL (video must have captions).
  2. Set number of tasks and language (e.g. en, ru).
  3. Click Generate. After loading, tasks appear on the main page.
  4. Use ← Previous / Next → to switch between tasks. Type your answer and click Submit answer to receive feedback.
  5. Use the Follow-up question field and click Ask to get an answer based on the video transcript.

Task example 1

Task example 2


Run with Docker

Build and run the Streamlit app in a container:

docker build -t edutube-tasks .
docker run -p 8501:8501 -e HUGGINGFACEHUB_API_TOKEN=your_token edutube-tasks

Open http://localhost:8501. The image runs flake8 at build time; tests are not run in the default CMD (run them in CI or locally).


Local setup

  1. Clone the repo and create a virtual environment:
    python -m venv .venv
    source .venv/bin/activate   
  2. Install dependencies:
    pip install -r requirements.txt
  3. Copy env and set your token:
    cp .env-example .env
  4. Run the app (from project root):
    PYTHONPATH=. streamlit run src/app.py

Configuration

All optional; see .env-example.

Variable Description
HUGGINGFACEHUB_API_TOKEN Required for task generation and evaluation (Hugging Face Inference API). Alternative env names: HUGGINGFACE_API_TOKEN, HF_TOKEN.
EDUTUBE_LLM_MODEL_API LLM model ID (default: HuggingFaceH4/zephyr-7b-beta).
EDUTUBE_LLM_PROVIDER Optional Inference API provider (e.g. together, fal-ai).
EDUTUBE_MAX_TRANSCRIPT_CHARS Max transcript length for generation (default: 12000).
EDUTUBE_EMBEDDING_MODEL Sentence-transformers model for RAG (default: multilingual MiniLM).
EDUTUBE_RAG_CHUNK_SIZE, EDUTUBE_RAG_CHUNK_OVERLAP, EDUTUBE_RAG_RETRIEVER_K RAG splitter and retriever settings.

Development

  • Lint: flake8 src (see setup.cfg).
  • Tests: PYTHONPATH=. pytest tests/ -v
  • CI: GitHub Actions runs flake8 and pytest on push/PR to main/master.

About

Generating tasks for learning foreign languages ​​based on YouTube videos. RAG + langchain

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages