This repository was archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathutils.py
More file actions
59 lines (40 loc) · 1.48 KB
/
utils.py
File metadata and controls
59 lines (40 loc) · 1.48 KB
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
from enum import Enum
from typing import List
class OxapiType(Enum):
NLP = "nlp"
class OxapiNLPClassificationModel(Enum):
"""Enum for OxAPI NLP classification models."""
DIALOG_CONTENT_FILTER = "dialog-content-filter"
DIALOG_TOPICS = "dialog-topics"
DIALOG_EMOTIONS = "dialog-emotions"
DIALOG_TAG = "dialog-tag"
def get_labels(self) -> List[str]:
"""Defines the list of class labels.
Returns:
List[str] : the list of labels
"""
if self.value in [self.DIALOG_CONTENT_FILTER.value, self.DIALOG_TAG.value]:
return ["label", "confidence_score"]
elif self.value == self.DIALOG_EMOTIONS.value:
return [
"original_label",
"ekman_label",
"group_label",
"confidence_score",
]
elif self.value == self.DIALOG_TOPICS.value:
return ["label"]
class OxapiNLPCompletionModel(Enum):
"""Enum for OxAPI NLP completion models."""
GPT_NEO_27B = "gpt-neo-2-7b"
GPT_J_6B = "gpt-j-6b"
class OxapiNLPEncodingModel(Enum):
"""Enum for OxAPI NLP encoding models."""
ALL_MPNET_BASE_V2 = "all-mpnet-base-v2"
ALL_MINILM_L6_V2 = "all-minilm-l6-v2"
class OxapiNLPPipelineModel(Enum):
"""Enum for OxAPI NLP pipeline models."""
EN_CORE_WEB_LG = "en-core-web-lg"
class OxapiNLPTransformationModel(Enum):
"""Enum for OxAPI NLP transformation models."""
PUNCT_IMPUTATION = "punctuation-imputation"