Download app/schemas.py from hHoai/api: direct link, hf CLI and curl.
- Browser
- Download file 914 Bytes
-
https://huggingface.co/spaces/hHoai/api/resolve/main/app/schemas.py
- Command line
-
hf download hf://spaces/hHoai/api/app/schemas.py
-
curl -L -o schemas.py https://huggingface.co/spaces/hHoai/api/resolve/main/app/schemas.py
914 Bytes
| from pydantic import BaseModel | |
| from typing import Dict, Any, List, Optional | |
| class TextRequest(BaseModel): | |
| """ | |
| Model yêu cầu sửa lỗi chính tả | |
| """ | |
| text: str | |
| options: Optional[Dict[str, Any]] = None | |
| class Correction(BaseModel): | |
| """ | |
| Model chi tiết sửa lỗi | |
| """ | |
| word: str | |
| suggestions: List[str] = [] | |
| start_position: int | |
| end_position: int | |
| class RepeatWarning(BaseModel): | |
| """ | |
| Model cảnh báo từ lặp | |
| """ | |
| word: str | |
| start_position: int | |
| end_position: int | |
| class CorrectionResponse(BaseModel): | |
| """ | |
| Model phản hồi sửa lỗi chính tả | |
| """ | |
| status: str = "success" # Trạng thái xử lý: success hoặc error | |
| has_errors: bool # True nếu phát hiện lỗi, False nếu không | |
| corrections: List[Correction] = [] | |
| warning: Optional[List[RepeatWarning]] = None |