77
88import numpy as np
99
10- from unstructured_inference .constants import Source
10+ from unstructured_inference .constants import IsExtracted , Source
1111from unstructured_inference .math import safe_division
1212
1313
@@ -185,7 +185,7 @@ class TextRegion:
185185 bbox : Rectangle
186186 text : Optional [str ] = None
187187 source : Optional [Source ] = None
188- is_extracted : Optional [bool ] = None
188+ is_extracted : Optional [IsExtracted ] = None
189189
190190 def __str__ (self ) -> str :
191191 return str (self .text )
@@ -199,7 +199,7 @@ def from_coords(
199199 y2 : Union [int , float ],
200200 text : Optional [str ] = None ,
201201 source : Optional [Source ] = None ,
202- is_extracted : Optional [bool ] = None ,
202+ is_extracted : Optional [IsExtracted ] = None ,
203203 ** kwargs ,
204204 ) -> TextRegion :
205205 """Constructs a region from coordinates."""
@@ -215,7 +215,7 @@ class TextRegions:
215215 sources : np .ndarray = field (default_factory = lambda : np .array ([]))
216216 source : Source | None = None
217217 is_extracted_array : np .ndarray = field (default_factory = lambda : np .array ([]))
218- is_extracted : bool | None = None
218+ is_extracted : IsExtracted | None = None
219219 _optional_array_attributes : list [str ] = field (
220220 init = False , default_factory = lambda : ["texts" , "sources" , "is_extracted_array" ]
221221 )
0 commit comments