diff --git a/dsLightRag/KeDaXunFei/XunFeiAudioEvaluator_cn.py b/dsLightRag/KeDaXunFei/XunFeiAudioEvaluator_cn.py index 4b2ce195..449b0863 100644 --- a/dsLightRag/KeDaXunFei/XunFeiAudioEvaluator_cn.py +++ b/dsLightRag/KeDaXunFei/XunFeiAudioEvaluator_cn.py @@ -105,21 +105,20 @@ class XunFeiAudioEvaluator_cn: "app_id": self.appid }, "business": { - "category": "read_sentence", + "category": "read_chapter", "rstcd": "utf8", "sub": "ise", - "group": "pupil", # 根据文档设置为小学组 + "group": "adult", # 根据文档设置为小学组 "ent": "cn_vip", # 固定中文引擎 "tte": "utf-8", "cmd": "ssb", - "auf": "audio/L16;rate=16000", # 修复参数格式错误 - "aue": "lame", + #"auf": "audio/L16;rate=16000", # 修复参数格式错误 + "aue": "lame",# mp3 "text": '\uFEFF' + "[content]\n" + self.txt, # 确保UTF8 BOM "extra_ability": "multi_dimension" # 启用多维度评分 }, "data": { "status": 0, - "data": "" } } ws.send(json.dumps(send_dict)) @@ -169,21 +168,21 @@ class XunFeiAudioEvaluator_cn: """解析中文评测XML结果(仅处理read_sentence节点)""" try: root = ET.fromstring(xml_content) - # 中文专用:仅查找read_sentence节点 - read_sentence = root.find('.//read_sentence') - if read_sentence is not None: - # 中文评分字段映射 + # 中文专用:查找read_chapter节点(原read_sentence) + read_chapter = root.find('.//read_chapter') + if read_chapter is not None: + # 中文评分字段映射(修正节点名称和属性) self.evaluation_results = { - 'total_score': float(read_sentence.get('total_score', 0)), - 'accuracy_score': float(read_sentence.get('accuracy_score', 0)), - 'fluency_score': float(read_sentence.get('fluency_score', 0)), - 'integrity_score': float(read_sentence.get('integrity_score', 0)), - 'tone_score': float(read_sentence.get('tone_score', 0)), # 中文特有调型分 - 'is_rejected': read_sentence.get('is_rejected', 'false') == 'true' + 'total_score': float(read_chapter.get('total_score', 0)), + 'accuracy_score': float(read_chapter.get('accuracy_score', 0)), + 'fluency_score': float(read_chapter.get('fluency_score', 0)), + 'integrity_score': float(read_chapter.get('integrity_score', 0)), # 修正字段名 + 'tone_score': float(read_chapter.get('tone_score', 0)), + 'is_rejected': read_chapter.get('is_rejected', 'false') == 'true' } - # 提取句子级得分(中文特有) + # 提取句子级得分 sentences = [] - for sent in read_sentence.findall('.//sentence'): + for sent in read_chapter.findall('.//sentence'): sentences.append({ 'content': sent.get('content', ''), 'total_score': float(sent.get('total_score', 0)), diff --git a/dsLightRag/KeDaXunFei/__pycache__/XunFeiAudioEvaluator_cn.cpython-310.pyc b/dsLightRag/KeDaXunFei/__pycache__/XunFeiAudioEvaluator_cn.cpython-310.pyc index de84ace5..9000e793 100644 Binary files a/dsLightRag/KeDaXunFei/__pycache__/XunFeiAudioEvaluator_cn.cpython-310.pyc and b/dsLightRag/KeDaXunFei/__pycache__/XunFeiAudioEvaluator_cn.cpython-310.pyc differ diff --git a/dsLightRag/static/audio/audio_1c4f421079d94473af7327ce6808e7c7.mp3 b/dsLightRag/static/audio/audio_1c4f421079d94473af7327ce6808e7c7.mp3 new file mode 100644 index 00000000..62eba522 Binary files /dev/null and b/dsLightRag/static/audio/audio_1c4f421079d94473af7327ce6808e7c7.mp3 differ diff --git a/dsLightRag/static/audio/audio_1c4f421079d94473af7327ce6808e7c7.wav b/dsLightRag/static/audio/audio_1c4f421079d94473af7327ce6808e7c7.wav new file mode 100644 index 00000000..a5ce2e9c Binary files /dev/null and b/dsLightRag/static/audio/audio_1c4f421079d94473af7327ce6808e7c7.wav differ diff --git a/dsLightRag/static/audio/audio_a16f6f99fec7405fbe60517125c93f14.mp3 b/dsLightRag/static/audio/audio_a16f6f99fec7405fbe60517125c93f14.mp3 new file mode 100644 index 00000000..973287df Binary files /dev/null and b/dsLightRag/static/audio/audio_a16f6f99fec7405fbe60517125c93f14.mp3 differ diff --git a/dsLightRag/static/audio/audio_a16f6f99fec7405fbe60517125c93f14.wav b/dsLightRag/static/audio/audio_a16f6f99fec7405fbe60517125c93f14.wav new file mode 100644 index 00000000..fe8ac046 Binary files /dev/null and b/dsLightRag/static/audio/audio_a16f6f99fec7405fbe60517125c93f14.wav differ