add space between special token :param text: :return:
(text)
| 22 | |
| 23 | |
| 24 | def add_space(text): |
| 25 | """ |
| 26 | add space between special token |
| 27 | :param text: |
| 28 | :return: |
| 29 | """ |
| 30 | new_text_list = list() |
| 31 | for item in zip(split_bracket.findall(text), split_bracket.split(text)[1:]): # 此处将第一个左括号 左边的token全部去掉 (如果以[CLS]开头则会被丢弃) |
| 32 | new_text_list += item |
| 33 | return ' '.join(new_text_list) # 空格组合对于中文效果? |
| 34 | |
| 35 | def find_bracket_num(tree_str): |
| 36 | """ |
no outgoing calls
no test coverage detected