Client
Create an ontology
EachTool
and Classification
type requires a specific value to be passed when creating the feature.
Feature | Class | Value |
---|---|---|
Bounding box | Tool | BBOX |
Polygon | Tool | POLYGON |
Polyline | Tool | LINE |
Point | Tool | POINT |
Segmentation mask | Tool | RASTER_SEGMENTATION |
Relationship | Tool | RELATIONSHIP |
Entity | Tool | NER |
Message ranking | Tool | MESSAGE_RANKING |
Single message selection | Tool | MESSAGE_SINGLE_SELECTION |
Multiple message selection | Tool | MESSAGE_MULTI_SELECTION |
Message step reasoning | Tool | STEP_REASONING |
Fact-checking | Tool | FACT_CHECKING |
Prompt rating | Tool | PROMPT_ISSUE |
Radio | Classification | RADIO |
Checklist | Classification | CHECKLIST |
Text | Classification | TEXT |
media_type
parameter, which represents the modality of the data rows that the ontology will be used to label. Certain features are only compatible with certain media types.
Specify an ontology media type
Themedia_type
parameter of client.create_ontology
defaults to None
, but it’s highly recommended to specify one for validation and error handling.media_type
parameter takes the following values:
lb.MediaType.Audio
lb.MediaType.Conversational
lb.MediaType.Document
lb.MediaType.Geospatial_Tile
lb.MediaType.Html
lb.MediaType.Image
lb.MediaType.Simple_Tile
lb.MediaType.Text
lb.MediaType.Video
Create ontologies from new features
You can define new features to build new ontologies. The following code sample shows how to create simple features for upserting into ontologies. To learn more about creating features, see Features.ontology_builder
or client.create_ontology_from_feature_schemas()
.
Create from normalized JSON format
- Users can create ontologies from a JSON definition of the ontology.
- Each tool type requires a specific value to be passed:
Tool | Value |
---|---|
Bounding box | rectangle |
Polygon | polygon |
Polyline | line |
Point | point |
Segmentation mask | raster-segmentation |
Entity | named-entity |
Create from existing features
If you already have features created, you can query them by name or by schema id. Re-using an existing feature is highly recommended.Create a nested ontology
You can create a child feature nested under a parent feature. Only classification features can be children of a nested ontology. For instance, if you want to create an ontology where a bounding box has a radio sub-classification, you will add aclassifications
field that contains a list of classification features as children.