π 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? |
Model tree for hmnshudhmn24/t5-small-classroom-question-generator
Base model
google-t5/t5-small