@@ -120,25 +120,33 @@ def from_common(cls, radio: Radio, name: str,
120120class NDText (NDAnnotation , NDTextSubclass ):
121121
122122 @classmethod
123- def from_common (cls , text : Text , name : str , feature_schema_id : Cuid ,
124- extra : Dict [str , Any ], data : Union [TextData ,
125- ImageData ]) -> "NDText" :
123+ def from_common (cls ,
124+ text : Text ,
125+ name : str ,
126+ feature_schema_id : Cuid ,
127+ extra : Dict [str , Any ],
128+ data : Union [TextData , ImageData ],
129+ confidence : Optional [float ] = None ) -> "NDText" :
126130 return cls (
127131 answer = text .answer ,
128132 data_row = DataRow (id = data .uid , global_key = data .global_key ),
129133 name = name ,
130134 schema_id = feature_schema_id ,
131135 uuid = extra .get ('uuid' ),
136+ confidence = confidence ,
132137 )
133138
134139
135140class NDChecklist (NDAnnotation , NDChecklistSubclass , VideoSupported ):
136141
137142 @classmethod
138- def from_common (
139- cls , checklist : Checklist , name : str , feature_schema_id : Cuid ,
140- extra : Dict [str , Any ], data : Union [VideoData , TextData ,
141- ImageData ]) -> "NDChecklist" :
143+ def from_common (cls ,
144+ checklist : Checklist ,
145+ name : str ,
146+ feature_schema_id : Cuid ,
147+ extra : Dict [str , Any ],
148+ data : Union [VideoData , TextData , ImageData ],
149+ confidence : Optional [float ] = None ) -> "NDChecklist" :
142150 return cls (answer = [
143151 NDFeature (name = answer .name ,
144152 schema_id = answer .feature_schema_id ,
@@ -149,23 +157,29 @@ def from_common(
149157 name = name ,
150158 schema_id = feature_schema_id ,
151159 uuid = extra .get ('uuid' ),
152- frames = extra .get ('frames' ))
160+ frames = extra .get ('frames' ),
161+ confidence = confidence )
153162
154163
155164class NDRadio (NDAnnotation , NDRadioSubclass , VideoSupported ):
156165
157166 @classmethod
158- def from_common (cls , radio : Radio , name : str , feature_schema_id : Cuid ,
159- extra : Dict [str , Any ], data : Union [VideoData , TextData ,
160- ImageData ]) -> "NDRadio" :
167+ def from_common (cls ,
168+ radio : Radio ,
169+ name : str ,
170+ feature_schema_id : Cuid ,
171+ extra : Dict [str , Any ],
172+ data : Union [VideoData , TextData , ImageData ],
173+ confidence : Optional [float ] = None ) -> "NDRadio" :
161174 return cls (answer = NDFeature (name = radio .answer .name ,
162175 schema_id = radio .answer .feature_schema_id ,
163176 confidence = radio .answer .confidence ),
164177 data_row = DataRow (id = data .uid , global_key = data .global_key ),
165178 name = name ,
166179 schema_id = feature_schema_id ,
167180 uuid = extra .get ('uuid' ),
168- frames = extra .get ('frames' ))
181+ frames = extra .get ('frames' ),
182+ confidence = confidence )
169183
170184
171185class NDSubclassification :
@@ -212,7 +226,8 @@ def to_common(
212226 value = annotation .to_common (),
213227 name = annotation .name ,
214228 feature_schema_id = annotation .schema_id ,
215- extra = {'uuid' : annotation .uuid })
229+ extra = {'uuid' : annotation .uuid },
230+ confidence = annotation .confidence )
216231 if getattr (annotation , 'frames' , None ) is None :
217232 return [common ]
218233 results = []
@@ -235,7 +250,8 @@ def from_common(
235250 )
236251 return classify_obj .from_common (annotation .value , annotation .name ,
237252 annotation .feature_schema_id ,
238- annotation .extra , data )
253+ annotation .extra , data ,
254+ annotation .confidence )
239255
240256 @staticmethod
241257 def lookup_classification (
0 commit comments