Add sequence labelling output

This commit is contained in:
Andras Schmelczer 2022-07-13 08:47:23 +02:00
parent 6106816999
commit d6865e2aec
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
4 changed files with 21 additions and 15 deletions

View file

@ -1,5 +1,5 @@
"""GreatAI.""" """GreatAI."""
__version__ = "0.1.4" __version__ = "0.1.5"
from .context import configure from .context import configure
@ -22,10 +22,10 @@ from .remote.call_remote_great_ai_async import call_remote_great_ai_async
from .tracing.add_ground_truth import add_ground_truth from .tracing.add_ground_truth import add_ground_truth
from .tracing.delete_ground_truth import delete_ground_truth from .tracing.delete_ground_truth import delete_ground_truth
from .tracing.query_ground_truth import query_ground_truth from .tracing.query_ground_truth import query_ground_truth
from .views import ( from .views import RouteConfig, Trace
ClassificationOutput, from .views.outputs.classification_output import ClassificationOutput
from .views.outputs.multi_label_classification_output import (
MultiLabelClassificationOutput, MultiLabelClassificationOutput,
RegressionOutput,
RouteConfig,
Trace,
) )
from .views.outputs.regression_output import RegressionOutput
from .views.outputs.sequence_labeling_output import SequenceLabelingOutput

View file

@ -6,11 +6,6 @@ from .function_metadata import FunctionMetadata
from .health_check_response import HealthCheckResponse from .health_check_response import HealthCheckResponse
from .model import Model from .model import Model
from .operators import operators from .operators import operators
from .outputs import (
ClassificationOutput,
MultiLabelClassificationOutput,
RegressionOutput,
)
from .query import Query from .query import Query
from .route_config import RouteConfig from .route_config import RouteConfig
from .sort_by import SortBy from .sort_by import SortBy

View file

@ -1,3 +0,0 @@
from .classification_output import ClassificationOutput
from .multi_label_classification_output import MultiLabelClassificationOutput
from .regression_output import RegressionOutput

View file

@ -1 +1,15 @@
# todo from typing import Any, List, Literal, Optional
from ..hashable_base_model import HashableBaseModel
class LabeledToken(HashableBaseModel):
token: str
tag: Literal["B", "I", "O", "E", "S"]
confidence: float
explanation: Optional[Any]
class SequenceLabelingOutput(HashableBaseModel):
labeled_tokens: List[LabeledToken]
explanation: Optional[Any]