游雁
2023-02-11 0a4e3b7e64e9e095cfdcd4b3c28bde7aa58839e7
funasr/bin/asr_inference_paraformer_timestamp.py
@@ -410,7 +410,7 @@
        results = speech2text(**batch)
        if len(results) < 1:
            hyp = Hypothesis(score=0.0, scores={}, states={}, yseq=[])
            results = [[" ", ["<space>"], [2], hyp, 10, 6]] * nbest
            results = [[" ", ["sil"], [2], hyp, 10, 6]] * nbest
        time_end = time.time()
        forward_time = time_end - time_beg
        lfr_factor = results[0][-1]
@@ -436,7 +436,7 @@
                    ibest_writer["score"][key] = str(hyp.score)
    
                if text is not None:
                    text_postprocessed = postprocess_utils.sentence_postprocess(token)
                    text_postprocessed, _ = postprocess_utils.sentence_postprocess(token)
                    item = {'key': key, 'value': text_postprocessed}
                    asr_result_list.append(item)
                    finish_count += 1