πŸŽ“ Classroom Question Generator

An AI model that automatically generates age-appropriate classroom questions (Grades 1–10) from a simple topic.

Example

Input topic: Photosynthesis
Grade: 6
Output question: "Why do plants need sunlight?"

This project uses a fine-tuned T5-small Transformer and includes preprocessing, training, evaluation, inference, FastAPI API, and a Gradio UI.

πŸš€ Features

βœ“ Generates grade-appropriate questions for Grades 1–10
βœ“ Designed for teachers, schools, and ed-tech platforms
βœ“ End-to-end ML pipeline
βœ“ Gradio UI + FastAPI server
βœ“ Clean dataset format (CSV β†’ JSONL)
βœ“ Apache 2.0 license
βœ“ HuggingFace model card included

πŸ“ Project Structure

classroom-question-generator/
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ raw/
β”‚   β”œβ”€β”€ processed/
β”‚   └── README.md
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ config.py
β”‚   β”œβ”€β”€ dataset_preprocessing.py
β”‚   β”œβ”€β”€ train.py
β”‚   β”œβ”€β”€ evaluate.py
β”‚   β”œβ”€β”€ inference.py
β”‚   └── model_utils.py
β”‚
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api.py
β”‚   └── ui.py
β”‚
β”œβ”€β”€ model/
β”œβ”€β”€ notebooks/
β”œβ”€β”€ huggingface/
β”œβ”€β”€ tests/
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ LICENSE
└── README.md

πŸ“¦ Installation

python -m venv venv
source venv/bin/activate      # Windows: venv\Scripts\activate
pip install -r requirements.txt

πŸ”„ Dataset Preprocessing

python -m src.dataset_preprocessing   --input data/raw/dataset_raw.csv   --output data/processed/dataset_clean.jsonl

πŸ‹οΈ Train Model

python -m src.train

πŸ§ͺ Evaluate Model

python -m src.evaluate

πŸ€– Inference Example

from src.inference import generate_question
print(generate_question("Photosynthesis", 6))

🌐 FastAPI Server

uvicorn app.api:app --reload --port 7860

🎨 Gradio UI

python app/ui.py

🎯 Prompt Format

topic: <topic> | grade: <grade>

πŸ“š Example Outputs

Topic Grade Generated Question
Photosynthesis 6 Why do plants need sunlight?
Gravity 7 Why do objects fall toward the Earth?
Water Cycle 4 How does water move from the ground to the sky?
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for hmnshudhmn24/t5-small-classroom-question-generator

Base model

google-t5/t5-small
Finetuned
(2210)
this model