Spaces:
Configuration error
Configuration error
Download app/api/v2/answer_evaluation.py from orderlymirror/loos: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/spaces/orderlymirror/loos/resolve/main/app/api/v2/answer_evaluation.py
- Command line
-
hf download hf://spaces/orderlymirror/loos/app/api/v2/answer_evaluation.py
-
curl -L -o answer_evaluation.py https://huggingface.co/spaces/orderlymirror/loos/resolve/main/app/api/v2/answer_evaluation.py
1.19 kB
| """Answer evaluation router. | |
| POST /ai/v2/evaluate-answer — scores a subjective answer and flags for teacher review. | |
| """ | |
| from fastapi import APIRouter, Depends | |
| from app.api.v2.dependencies import get_answer_evaluation_service | |
| from app.schemas.answer_evaluation import AnswerEvaluationRequest, AnswerEvaluationResponse | |
| router = APIRouter(prefix="/ai/v2", tags=["inference"]) | |
| async def evaluate_answer( | |
| request: AnswerEvaluationRequest, | |
| service=Depends(get_answer_evaluation_service), | |
| ) -> AnswerEvaluationResponse: | |
| """Score a student's subjective answer against a rubric.""" | |
| return service.predict( | |
| question_id=request.question_id, | |
| question_text=request.question_text, | |
| student_answer=request.student_answer, | |
| model_answer=request.model_answer, | |
| rubric=request.rubric, | |
| max_marks=request.max_marks, | |
| grade=request.grade, | |
| subject=request.subject, | |
| lo_id=request.lo_id, | |
| bloom_level=request.bloom_level, | |
| ) | |