diff --git a/fun_text_processing/text_normalization/normalize.py b/fun_text_processing/text_normalization/normalize.py index c1cebdd097..7b10b65e6d 100644 --- a/fun_text_processing/text_normalization/normalize.py +++ b/fun_text_processing/text_normalization/normalize.py @@ -351,7 +351,7 @@ def split_text_into_sentences(self, text: str) -> List[str]: upper_case_unicode = "\u0410-\u042F" # Read and split transcript by utterance (roughly, sentences) - split_pattern = f"(?' assert params_split[2] == '' @@ -352,7 +352,7 @@ def to_pytorch_net(self, fread): for i in range(self.lorder): print('read conv_left weight -- %d' % i) line = fread.readline() - splits = line.strip().strip('\[\]').strip().split() + splits = line.strip().strip('\\[\\]').strip().split() assert len(splits) == self.dim cols = torch.tensor([float(item) for item in splits], dtype=torch.float32) @@ -375,7 +375,7 @@ def to_pytorch_net(self, fread): for i in range(self.rorder): print('read conv_right weight -- %d' % i) line = fread.readline() - splits = line.strip().strip('\[\]').strip().split() + splits = line.strip().strip('\\[\\]').strip().split() assert len(splits) == self.dim cols = torch.tensor([float(item) for item in splits], dtype=torch.float32) diff --git a/funasr/models/fun_asr_nano/tools/format5res.py b/funasr/models/fun_asr_nano/tools/format5res.py index 3b11bb83a7..619b9f67cb 100644 --- a/funasr/models/fun_asr_nano/tools/format5res.py +++ b/funasr/models/fun_asr_nano/tools/format5res.py @@ -320,8 +320,8 @@ def all_convert(content): continue name = tmp[0] content = tmp[1] - name = re.sub("\.pcm", "", name) - name = re.sub("\.wav", "", name) + name = re.sub("\\.pcm", "", name) + name = re.sub("\\.wav", "", name) content = recoformat(content) content = numbersingle(content) content = ch_number2digit(content)