Skip to content

Commit a747636

Browse files
author
marwan37
committed
Add ImageDescription pydantic model for the OCR pipeline
1 parent 66d0de1 commit a747636

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""This module contains the schema for the OCR results."""
2+
3+
from typing import List, Optional
4+
5+
from pydantic import BaseModel, Field
6+
7+
8+
class ImageDescription(BaseModel):
9+
"""Base model for OCR results."""
10+
11+
raw_text: str = Field(description="Extracted text from the image")
12+
description: str = Field(description="Description of the image")
13+
entities: Optional[List[str]] = Field(default=None, description="List of entities found in the image")

0 commit comments

Comments
 (0)