diff --git a/fun_text_processing/text_normalization/normalize.py b/fun_text_processing/text_normalization/normalize.py index c1cebdd09..7b10b65e6 100644 --- a/fun_text_processing/text_normalization/normalize.py +++ b/fun_text_processing/text_normalization/normalize.py @@ -351,7 +351,7 @@ class Normalizer: upper_case_unicode = "\u0410-\u042F" # Read and split transcript by utterance (roughly, sentences) - split_pattern = f"(?' assert params_split[2] == '' @@ -352,7 +352,7 @@ class FSMNBlock(nn.Module): 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 @@ class FSMNBlock(nn.Module): 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 3b11bb83a..619b9f67c 100644 --- a/funasr/models/fun_asr_nano/tools/format5res.py +++ b/funasr/models/fun_asr_nano/tools/format5res.py @@ -320,8 +320,8 @@ if __name__ == "__main__": 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)