asahi417 commited on
Commit
c30e8c2
•
1 Parent(s): 117a600

Update pipeline/kotoba_whisper.py

Browse files
Files changed (1) hide show
  1. pipeline/kotoba_whisper.py +1 -1
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("。")