Newer
Older
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
AnnotationType = Literal["lemma", "pos", "morph", "concept", "chunk", "turn"]
ReferenceType = Literal["Token", "Word", "Document", "SpanAnnotation"]
UUIDableType = Union[AnnotationType, ReferenceType]
class UUIDable(TypedDict):
id: str
type: UUIDableType
class Token(UUIDable):
text: str
class Word(UUIDable):
text: str
class Document(UUIDable):
word_ids: List[str]
class Annotation(UUIDable):
value: Any
class SingleAnnotation(Annotation):
reference_id: str
class SpanAnnotation(UUIDable):
name: str
elements: List[str]
class RelationAnnotation(UUIDable):
parent: UUIDable
child: UUIDable