Git Product home page Git Product logo

Comments (6)

Z-yq avatar Z-yq commented on May 24, 2024

您希望 是什么样式的示例呢? 自己因为有知识背景的原因,不知道对新手来说,更希望哪些地方有说明。或者有什么样式的demo

from tensorflowasr.

zxOnVacation avatar zxOnVacation commented on May 24, 2024

感谢您的回复
现在我就是不知道我输入语音 产生了['ér', 'yǐ', 'què', 'shí', 'zuò'] 这样子的句子 但是我该怎么样让他变成汉语句子呢~ 再过一遍lm吗

from tensorflowasr.

Z-yq avatar Z-yq commented on May 24, 2024

是的
在最新的run-test.py中提供了一些示例,您可以更新一下代码。
具体参考这三个函数:

`

def stt(self,wav_path):

    am_result=self.am.predict(wav_path)
    if self.am.model_type=='Transducer':
        am_result =self.decode_am_result(am_result[1:-1])
        lm_result = self.lm.predict(am_result)
        lm_result = self.lm.decode(lm_result[0].numpy(), self.lm.word_featurizer)
    else:
        am_result=self.decode_am_result(am_result[0])
        lm_result=self.lm.predict(am_result)
        lm_result = self.lm.decode(lm_result[0].numpy(), self.lm.word_featurizer)
    return am_result,lm_result
def am_test(self,wav_path):
    #am_result is token id
    am_result = self.am.predict(wav_path)
    #token to vocab
    if self.am.model_type == 'Transducer':
        am_result = self.decode_am_result(am_result[1:-1])
    else:
        am_result = self.decode_am_result(am_result[0])
    return am_result
def lm_test(self,txt):
    py=pypinyin.pinyin(txt)
    input_py=[i[0] for i in py]
    #now lm_result is token id
    lm_result=self.lm.predict(input_py)
    #token to vocab
    lm_result=self.lm.decode(lm_result[0].numpy(),self.lm.word_featurizer)
    return lm_result

`

from tensorflowasr.

zxOnVacation avatar zxOnVacation commented on May 24, 2024

感谢 我还能再问下 流式处理 现在一般是怎么做的呀
是每次抽固定的时间去做吗 那前后断的句子该怎么处理呢

from tensorflowasr.

Z-yq avatar Z-yq commented on May 24, 2024

这个目前没有标准答案,主要就是对encoder和decoder的应用。 只要满足了需求就是好的方案。

from tensorflowasr.

zxOnVacation avatar zxOnVacation commented on May 24, 2024

好的 感谢

from tensorflowasr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.