Add sequence labelling output
This commit is contained in:
parent
6106816999
commit
d6865e2aec
4 changed files with 21 additions and 15 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue