File size: 1,038 Bytes
a6326c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import sys
sys.path.append("modules/preprocess")

from preprocessor.SerialPreprocessor import SerialConfig, SerialPreprocessor
from const import (
    EMOTION_RECOGNITION,
)
from preprocessor.prompt_funcs import const_prompt_func_wrapper
from preprocessor.knowledge_funcs import (
    None_knowledge,
)
from preprocessor.label_funs import (
    extract_turn_emotion_wrapper,
)
import sys

if __name__ == "__main__":
    # 2. Emotion Recognition
    TASK = EMOTION_RECOGNITION
    input_data_path = sys.argv[1]
    output_data_path = sys.argv[2]

    serial_proc = SerialPreprocessor(
        SerialConfig(
            input_data_path,
            output_data_path,
            TASK,
            logger_name=TASK,
            task_bos_token=f"[{TASK}]",
            prompt_func=const_prompt_func_wrapper(
                "Recognize correct emotions based on the dialogue context."
            ),
            knowledge_func=None_knowledge,
            label_func=extract_turn_emotion_wrapper(", "),
        )
    )

    serial_proc.launch()