FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

sensevoice 增加置信度输出

Open wantt opened this issue 1 year ago • 1 comments

输出结果增加置信度输出

修改前输出格式: result_i = {"key": key[i], "text": text}

修改后输出格式:result_i = {"key": key[i], "text": text,"token_probs": token_probs }

以下是一个输出样例

[ { "key": "en", "text": "<|en|><|NEUTRAL|><|Speech|><|withitn|>The tribal chieftain called for the boy and presented him with 50 pieces of gold.", "token_probs": [ [ "<|en|>", 0.9999994039539004 ], [ "<|NEUTRAL|>", 0.6650255170850227 ], [ "<|Speech|>", 0.9988953170967498 ], [ "<|withitn|>", 1 ], [ "The", 0.9999670993193821 ], [ "tri", 0.9951907347523162 ], [ "bal", 0.9998259847282137 ], [ "chief", 0.9997330424830995 ], [ "tain", 0.9998868831779733 ], [ "called", 0.9992851364546496 ], [ "for", 0.9992235970978443 ], [ "the", 0.9991294577839298 ], [ "boy", 0.9301944527327015 ], [ "and", 0.9978013800052254 ], [ "presented", 0.995074099711129 ], [ "him", 0.99313369103405 ], [ "with", 0.9990471153011622 ], [ "", 0.9982630434699987 ], [ "5", 0.9995348234280294 ], [ "0", 0.9989625261045192 ], [ "pieces", 0.9995082651587693 ], [ "of", 0.9992288342347033 ], [ "gold", 0.9997841585713534 ], [ ".", 0.9979425173465579 ] ] } ]

wantt avatar Sep 15 '24 05:09 wantt

可以增加一个flag来进行控制,例如,output_ token_probs=True/False,默认是False

LauraGPT avatar Sep 24 '24 07:09 LauraGPT