This commit is contained in:
2025-09-06 17:25:52 +08:00
parent 074c4b9384
commit e6464e56cc
2 changed files with 0 additions and 49 deletions

View File

@@ -282,27 +282,3 @@ class XunFeiAudioEvaluator_cn:
return self.evaluation_results, evaluation_time
# 使用示例
if __name__ == '__main__':
# 中文使用示例
appid = XF_APPID
api_secret = XF_APISECRET
api_key = XF_APIKEY
audio_file = r'D:\dsWork\dsProject\dsLightRag\static\audio\test_cn.wav' # 中文测试音频
txt = "大家好。很高兴认识你们。今天天气很好。我正在使用这个工具练习中文发音。"
evaluator = XunFeiAudioEvaluator_cn(appid, api_key, api_secret, audio_file, txt)
results, eval_time = evaluator.run_evaluation()
print(evaluator.get_evaluation_summary())
# 创建评测器实例
txt="Hello everyone! Nice to meet you. Today is a beautiful day. I am learning English pronunciation with this tool."
evaluator = XunFeiAudioEvaluator_cn(appid, api_key, api_secret, audio_file, "english", txt)
# 运行评测
results, eval_time = evaluator.run_evaluation()
# 输出评测结果摘要
print("\n" + "=" * 50)
print(evaluator.get_evaluation_summary())
print(f"总评测时间: {eval_time}")
print("=" * 50)

View File

@@ -286,28 +286,3 @@ class XunFeiAudioEvaluator_en:
print(f"评测耗时: {evaluation_time}")
return self.evaluation_results, evaluation_time
# 使用示例
if __name__ == '__main__':
# 配置参数
# appid = "5b83f8d6"
# api_secret = "604fa6cb9c5ab664a0d153fe0ccc6802"
# api_key = "5beb887923204000bfcb402046bb05a6"
appid = XF_APPID
api_secret = XF_APISECRET
api_key = XF_APIKEY
# audio_file = "./1.mp3"
audio_file = r'D:\dsWork\dsProject\dsLightRag\static\audio\audio_afc0a96e382c428cba2f00e3f71e4e8f.mp3'
# 创建评测器实例
txt="Hello everyone! Nice to meet you. Today is a beautiful day. I am learning English pronunciation with this tool."
evaluator = XunFeiAudioEvaluator_en(appid, api_key, api_secret, audio_file, "english", txt)
# 运行评测
results, eval_time = evaluator.run_evaluation()
# 输出评测结果摘要
print("\n" + "=" * 50)
print(evaluator.get_evaluation_summary())
print(f"总评测时间: {eval_time}")
print("=" * 50)