Spaces:
Sleeping
Sleeping
DWizard commited on
Commit ·
a12b2b8
1
Parent(s): e4c138e
add loggin & complete func list in preprocess cfg
Browse filesFormer-commit-id: be5ede3735ab672daa313914c610f888251c2924
- configs/task_config.yaml +1 -0
- src/task.py +8 -1
configs/task_config.yaml
CHANGED
|
@@ -11,6 +11,7 @@ field: SC2
|
|
| 11 |
chunk_size: 1000
|
| 12 |
pre_process:
|
| 13 |
ON: True
|
|
|
|
| 14 |
spell_check: False
|
| 15 |
term_correct: True
|
| 16 |
post_process:
|
|
|
|
| 11 |
chunk_size: 1000
|
| 12 |
pre_process:
|
| 13 |
ON: True
|
| 14 |
+
sentence_form: True
|
| 15 |
spell_check: False
|
| 16 |
term_correct: True
|
| 17 |
post_process:
|
src/task.py
CHANGED
|
@@ -95,6 +95,12 @@ class Task:
|
|
| 95 |
logging.info(f" subtitle_type: \t\t{self.output_type['subtitle']}")
|
| 96 |
logging.info(f" video_ouput: \t\t{self.output_type['video']}")
|
| 97 |
logging.info(f" bilingal_ouput: \t{self.output_type['bilingal']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
@staticmethod
|
| 100 |
def fromYoutubeLink(youtube_url, task_id, task_dir, task_cfg):
|
|
@@ -156,7 +162,8 @@ class Task:
|
|
| 156 |
def preprocess(self):
|
| 157 |
self.status = TaskStatus.PRE_PROCESSING
|
| 158 |
logging.info("--------------------Start Preprocessing SRT class--------------------")
|
| 159 |
-
self.
|
|
|
|
| 160 |
if self.pre_setting["spell_check"]:
|
| 161 |
self.SRT_Script.spell_check_term()
|
| 162 |
if self.pre_setting["term_correct"]:
|
|
|
|
| 95 |
logging.info(f" subtitle_type: \t\t{self.output_type['subtitle']}")
|
| 96 |
logging.info(f" video_ouput: \t\t{self.output_type['video']}")
|
| 97 |
logging.info(f" bilingal_ouput: \t{self.output_type['bilingal']}")
|
| 98 |
+
logging.info(" PREprocess setting:")
|
| 99 |
+
for key, value in self.pre_setting:
|
| 100 |
+
logging.info(f" {key}: {value}")
|
| 101 |
+
logging.info(" POSTprocess setting:")
|
| 102 |
+
for key, value in self.post_setting:
|
| 103 |
+
logging.info(f" {key}: {value}")
|
| 104 |
|
| 105 |
@staticmethod
|
| 106 |
def fromYoutubeLink(youtube_url, task_id, task_dir, task_cfg):
|
|
|
|
| 162 |
def preprocess(self):
|
| 163 |
self.status = TaskStatus.PRE_PROCESSING
|
| 164 |
logging.info("--------------------Start Preprocessing SRT class--------------------")
|
| 165 |
+
if self.pre_setting["sentence_form"]:
|
| 166 |
+
self.SRT_Script.form_whole_sentence()
|
| 167 |
if self.pre_setting["spell_check"]:
|
| 168 |
self.SRT_Script.spell_check_term()
|
| 169 |
if self.pre_setting["term_correct"]:
|