1import os
2os.environ["MACRO_CORRECT_FLAG_CSC_TOKEN"] = "1"
3from macro_correct import correct_punct
4
5
6### 1.默认标点纠错(list输入)
7text_list = ["山不在高有仙则名。",
8 "水不在深,有龙则灵",
9 "斯是陋室惟吾德馨",
10 "苔痕上阶绿草,色入帘青。"
11 ]
12text_csc = correct_punct(text_list)
13print("默认标点纠错(list输入):")
14for res_i in text_csc:
15 print(res_i)
16print("#" * 128)
17"""
18默认标点纠错(list输入):
19{'index': 0, 'source': '山不在高有仙则名。', 'target': '山不在高,有仙则名。', 'score': 0.9917, 'errors': [['', ',', 4, 0.9917]]}
20{'index': 1, 'source': '水不在深,有龙则灵', 'target': '水不在深,有龙则灵。', 'score': 0.9995, 'errors': [['', '。', 9, 0.9995]]}
21{'index': 2, 'source': '斯是陋室惟吾德馨', 'target': '斯是陋室,惟吾德馨。', 'score': 0.9999, 'errors': [['', ',', 4, 0.9999], ['', '。', 8, 0.9998]]}
22{'index': 3, 'source': '苔痕上阶绿草,色入帘青。', 'target': '苔痕上阶绿,草色入帘青。', 'score': 0.9998, 'errors': [['', ',', 5, 0.9998]]}
23"""