| | |
| | | from funasr.utils import config_argparse |
| | | from funasr.utils.types import str2triple_str |
| | | from funasr.utils.types import str_or_none |
| | | from funasr.punctuation.text_preprocessor import split_to_mini_sentence |
| | | from funasr.datasets.preprocessor import split_to_mini_sentence |
| | | |
| | | |
| | | class Text2Punc: |
| | |
| | | text_name="text", |
| | | non_linguistic_symbols=train_args.non_linguistic_symbols, |
| | | ) |
| | | print("start decoding!!!") |
| | | |
| | | @torch.no_grad() |
| | | def __call__(self, text: Union[list, str], split_size=20): |
| | |
| | | result, _ = text2punc(line) |
| | | item = {'key': key, 'value': result} |
| | | results.append(item) |
| | | print(results) |
| | | return results |
| | | |
| | | for inference_text, _, _ in data_path_and_name_and_type: |