代码之家  ›  专栏  ›  技术社区  ›  Nelson Teixeira

糟糕的沃森抄本

  •  0
  • Nelson Teixeira  · 技术社区  · 5 年前

    我使用了以下命令:

    curl -X POST -u "apikey:<key>" --header "Content-Type: audio/mp3" --data-binary @./file.mp3 
    "https://api.us-south.speech-to-text.watson.cloud.ibm.com/instances/<code>/v1/recognize/model=pt-BR_BroadbandModel"
    

    https://drive.google.com/file/d/1Xuibxksudp55uwaz6oSOccTZ3pP7Dya9/view?usp=sharing

    华生不可能有这么糟糕的抄本。我错过了什么?我需要先设置一些参数还是在音频中做一些工作?

    我也试过窄带模型。我也试过flac。

    0 回复  |  直到 5 年前
        1
  •  -1
  •   optimus    5 年前

    沃森ibmapi似乎没有为最终用户正确编码,原因似乎是他们的api设计对于转录过于复杂。 它有一个错误,我相信他们的团队还没有破译出来

    不过,与谷歌合作是明智的

        pip install --upgrade SpeechRecognition(linux, unix systems)
    or  C:\path_to_ python.exe -m pip install --upgrade SpeechRecognition (windows)
    

    这是一个具有所有内置功能的模块 不同api创建者(如ibm)的容量 仅仅通过使用

    import speech_recogntion as sr
    r = sr.Recognizer()
    with sr.AudioFile("path to audio file") as source:
           #r.adjust_for_ambient_noise() depending on if you have background noise 
          audio = r.record(source)
    

    然后; 识别文件输出 其中xxx是列表中的api创建者。说

      google, ibm, azure or bing(with microsoft)
      t = r.recognize_xxx(audio, credentials, ...)
    

    这只是一个粗略的指南