File size: 370 Bytes
98abe61
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from pydantic import BaseModel, Field
from typing import List, Dict

class Entity(BaseModel):
    text: str
    label: str
    location: List[Dict] = Field(..., description="Location data for each word in the entity.")

class AnalysisResponse(BaseModel):
    filename: str
    entities: List[Entity]

class RedactRequest(BaseModel):
    entities_to_redact: List[Entity]