GithubHelp home page GithubHelp logo

google_stt's Introduction

Google_STT

Test --- python STT linked to node.js testing NLU app

Authentification

If your not authentified yet on Google API Client Libraries please do it by following instructions on that link : https://developers.google.com/api-client-library/python/apis/discovery/v1

you could link your google API Client accound with your server by using either API Keys or OAuth 2.0

Running local STT Sample

make sure you have python 2.7 on your machine

$ cd STT/
$ python stt_v1.py 

this script takes short .flac file displaying a spoken query, eg : "play the Hammerhead from Birdy Nam Nam" after encoding the .flac file with based 64 bytes script, we give it as an input to STT as below

service = googleapiclient.discovery.build('speech', 'v1')
service_request = service.speech().recognize(
    body={
          "config": {
            "maxAlternatives": 30,
            "languageCode": "en_US",
            "speechContexts": [
              {
                "phrases": [
                  "Play",
                  "Volume up",
                  "Stop" # we could contextualise by adding more phrases. but the number of phrases is limited
                ]
              }
            ],
            "encoding": "FLAC"
          },
            'audio': {
                'content': speech_content
            }

        })

#. Json Output

It display 10 guesses

{"results": [{
      "alternatives": [
        {"transcript": "play the Hammerhead from birdie num num",
          "confidence": 0.83659744},
        {"transcript": "play the Hammerhead from Birdy num-num"},
        {"transcript": "play the Hammerhead from Birdy Nam Nam"},
        {"transcript": "play the Hammerhead from nerdy num num"},
        {"transcript": "play the Hammerhead from brooten MN"},
        {"transcript": "play the Hammerhead from routine of them"},
        {"transcript": "play the Hammerhead from 13 of them"},
        {"transcript": "play the hammerheads from nerdy num num"},
        {"transcript": "play the hammerheads from brooten MN"},
        {"transcript": "play the hammer head from nerdy num num"}]}]}

#. text Output

It display 10 guesses

play the Hammerhead from birdie num num

play the Hammerhead from Birdy num-num

play the Hammerhead from Birdy Nam Nam

play the Hammerhead from nerdy num num

play the Hammerhead from brooten MN

play the Hammerhead from routine of them

play the Hammerhead from 13 of them

play the hammerheads from nerdy num num

play the hammerheads from brooten MN

play the hammer head from nerdy num num

google_stt's People

Contributors

aymankhattar avatar

Watchers

 avatar

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.