@@ -93,10 +93,14 @@ def to_common(self) -> Line:
9393 return Line (points = [Point (x = pt .x , y = pt .y ) for pt in self .line ])
9494
9595 @classmethod
96- def from_common (cls , line : Line ,
97- classifications : List [ClassificationAnnotation ], name : str ,
98- feature_schema_id : Cuid , extra : Dict [str , Any ],
99- data : Union [ImageData , TextData ]) -> "NDLine" :
96+ def from_common (cls ,
97+ line : Line ,
98+ classifications : List [ClassificationAnnotation ],
99+ name : str ,
100+ feature_schema_id : Cuid ,
101+ extra : Dict [str , Any ],
102+ data : Union [ImageData , TextData ],
103+ confidence : Optional [float ] = None ) -> "NDLine" :
100104 return cls (line = [{
101105 'x' : pt .x ,
102106 'y' : pt .y
@@ -105,7 +109,8 @@ def from_common(cls, line: Line,
105109 name = name ,
106110 schema_id = feature_schema_id ,
107111 uuid = extra .get ('uuid' ),
108- classifications = classifications )
112+ classifications = classifications ,
113+ confidence = confidence )
109114
110115
111116class NDFrameLine (VideoSupported ):
@@ -340,7 +345,7 @@ class Location(BaseModel):
340345 end : int
341346
342347
343- class NDTextEntity (NDBaseObject ):
348+ class NDTextEntity (NDBaseObject , ConfidenceMixin ):
344349 location : Location
345350
346351 def to_common (self ) -> TextEntity :
@@ -350,7 +355,8 @@ def to_common(self) -> TextEntity:
350355 def from_common (cls , text_entity : TextEntity ,
351356 classifications : List [ClassificationAnnotation ], name : str ,
352357 feature_schema_id : Cuid , extra : Dict [str , Any ],
353- data : Union [ImageData , TextData ]) -> "NDTextEntity" :
358+ data : Union [ImageData ,
359+ TextData ], confidence : float ) -> "NDTextEntity" :
354360 return cls (location = Location (
355361 start = text_entity .start ,
356362 end = text_entity .end ,
@@ -359,7 +365,8 @@ def from_common(cls, text_entity: TextEntity,
359365 name = name ,
360366 schema_id = feature_schema_id ,
361367 uuid = extra .get ('uuid' ),
362- classifications = classifications )
368+ classifications = classifications ,
369+ confidence = confidence )
363370
364371
365372class NDObject :
0 commit comments