22
33from pydantic import BaseModel
44
5- from labelbox import Classification as OClassification , OntologyBuilder , Option
5+ from labelbox . schema import ontology
66from labelbox .orm .model import Entity
77from .classification import ClassificationAnswer
88from .data import VideoData , TextData , RasterData
@@ -77,7 +77,8 @@ def create_data_row(self, dataset: "Entity.Dataset",
7777 self .data .external_id = data_row .external_id
7878 return self
7979
80- def assign_schema_ids (self , ontology_builder : OntologyBuilder ) -> "Label" :
80+ def assign_schema_ids (
81+ self , ontology_builder : ontology .OntologyBuilder ) -> "Label" :
8182 """
8283 Adds schema ids to all FeatureSchema objects in the Labels.
8384 This is necessary for MAL.
@@ -104,18 +105,18 @@ def assign_schema_ids(self, ontology_builder: OntologyBuilder) -> "Label":
104105 return self
105106
106107 def _get_feature_schema_lookup (
107- self , ontology_builder : OntologyBuilder
108+ self , ontology_builder : ontology . OntologyBuilder
108109 ) -> Tuple [Dict [str , str ], Dict [str , str ]]:
109110 tool_lookup = {}
110111 classification_lookup = {}
111112
112113 def flatten_classification (classifications ):
113114 for classification in classifications :
114- if isinstance (classification , OClassification ):
115+ if isinstance (classification , ontology . OClassification ):
115116 classification_lookup [
116117 classification .
117118 instructions ] = classification .feature_schema_id
118- elif isinstance (classification , Option ):
119+ elif isinstance (classification , ontology . Option ):
119120 classification_lookup [
120121 classification .value ] = classification .feature_schema_id
121122 else :
0 commit comments