Spaces:
Runtime error
Runtime error
Download app/schemas/moderation.py from AsyncCoder-10/my-moderation-api: direct link, hf CLI and curl.
- Browser
- Download file 604 Bytes
-
https://huggingface.co/spaces/AsyncCoder-10/my-moderation-api/resolve/main/app/schemas/moderation.py
- Command line
-
hf download hf://spaces/AsyncCoder-10/my-moderation-api/app/schemas/moderation.py
-
curl -L -o moderation.py https://huggingface.co/spaces/AsyncCoder-10/my-moderation-api/resolve/main/app/schemas/moderation.py
604 Bytes
| from pydantic import BaseModel, Field | |
| from typing import Dict, List | |
| class ModerationRequest(BaseModel): | |
| text: str = Field(..., min_length=1, description="The text to be moderated.") | |
| class ModerationResponse(BaseModel): | |
| is_flagged: bool | |
| model_used: str | |
| top_category: str | |
| identified_meaning: str = Field( | |
| default="", description="The core intent or meaning of the original text." | |
| ) | |
| suggested_alternatives: List[str] = Field( | |
| default_factory=list, description="7-8 dynamically reframed alternatives." | |
| ) | |
| raw_scores: Dict[str, float] | |