Upload config
Browse files- config.json +18 -0
- config.py +15 -0
config.json
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"auto_map": {
|
3 |
+
"AutoConfig": "config.SentimentConfig"
|
4 |
+
},
|
5 |
+
"class_map": {
|
6 |
+
"0": "sad",
|
7 |
+
"1": "joy",
|
8 |
+
"2": "love",
|
9 |
+
"3": "anger",
|
10 |
+
"4": "fear",
|
11 |
+
"5": "surprise"
|
12 |
+
},
|
13 |
+
"embedding_model": "all-MiniLM-L6-v2",
|
14 |
+
"h1": 44,
|
15 |
+
"h2": 46,
|
16 |
+
"model_type": "SententenceTransformerSentimentClassifier",
|
17 |
+
"transformers_version": "4.29.0"
|
18 |
+
}
|
config.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import PretrainedConfig
|
2 |
+
|
3 |
+
|
4 |
+
mp = {0:'sad',1:'joy',2:'love',3:'anger',4:'fear',5:'surprise'}
|
5 |
+
|
6 |
+
class SentimentConfig(PretrainedConfig):
|
7 |
+
model_type = "SententenceTransformerSentimentClassifier"
|
8 |
+
|
9 |
+
def __init__(self, embedding_model: str="all-MiniLM-L6-v2", class_map: dict=mp, h1: int=44, h2: int=46, **kwargs):
|
10 |
+
self.embedding_model = embedding_model
|
11 |
+
self.class_map = class_map
|
12 |
+
self.h1 = h1
|
13 |
+
self.h2 = h2
|
14 |
+
|
15 |
+
super().__init__(**kwargs)
|