-
Notifications
You must be signed in to change notification settings - Fork 0
/
schemes.py
61 lines (42 loc) · 1.1 KB
/
schemes.py
1
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from typing import List, Dict, Optional, Union
from dataclasses import dataclass
from stores.download import LocalMetaConfig
@dataclass
class PublicMetaConfig:
package: str
@dataclass
class ModelConfig:
type: str
meta: Union[LocalMetaConfig, PublicMetaConfig]
@dataclass
class Config:
event_type_detector: Optional[ModelConfig] = None
event_argument_extractor: Optional[ModelConfig] = None
event_extractor: Optional[ModelConfig] = None
@dataclass
class EventDetectorOutput:
tweet: List[str]
event_type: Optional[List[str]]
wikidata_link: Optional[List[str]]
@dataclass
class LinkedEntity:
entity: Optional[str]
id: Optional[str]
label: Optional[str]
description: Optional[str]
@dataclass
class EventExtractorOutput:
tweet: List[str]
event_type: Optional[List[str]]
event_arguments: Optional[List[LinkedEntity]]
event_graph: Optional[List[Dict]]
@dataclass
class EventArgumentExtractorOutput:
tweet: str
event_arguments: Optional[List[LinkedEntity]]
@dataclass
class Time:
value: str
@dataclass
class Location:
value: str