Update pipeline/kotoba_whisper.py
Browse files
pipeline/kotoba_whisper.py
CHANGED
@@ -24,7 +24,7 @@ class Punctuator:
|
|
24 |
def punctuate(self, pipeline_chunk: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
25 |
|
26 |
def validate_punctuation(raw: str, punctuated: str):
|
27 |
-
if 'unk' in punctuated:
|
28 |
return raw
|
29 |
if punctuated.count("。") > 1:
|
30 |
ind = punctuated.rfind("。")
|
|
|
24 |
def punctuate(self, pipeline_chunk: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
25 |
|
26 |
def validate_punctuation(raw: str, punctuated: str):
|
27 |
+
if 'unk' in punctuated.lower() or any(p in raw for p in self.ja_punctuations):
|
28 |
return raw
|
29 |
if punctuated.count("。") > 1:
|
30 |
ind = punctuated.rfind("。")
|