Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word-Level Confidence #1

Open
ferderml opened this issue Aug 20, 2018 · 1 comment
Open

Word-Level Confidence #1

ferderml opened this issue Aug 20, 2018 · 1 comment

Comments

@ferderml
Copy link

Struggling with adding word-level confidence - added enableWordConfidence: true, under the request config. Doesn't output. Trying to incorporate what is at the Google code but no luck. I did update to const speech = require('@google-cloud/speech').v1p1beta1;. I would greatly appreciate any assistance here.

@ferderml
Copy link
Author

console.log(`Word-Level-Confidence:`);
                const result = data.results[data.results.length - 1];
                const words = data.results.map(result => result.alternatives[0]);

                const confidence = data.results
                    .map(result => result.alternatives[0].confidence)
                    .join(`\n`);
                    
                words[0].words.forEach(a => {
                console.log(` word: ${a.word}, confidence: ${a.confidence}`);
                });

Gives the following output:

Word-Level-Confidence:
 word: testing, confidence: undefined
 word: to, confidence: undefined
 word: see, confidence: undefined
 word: does, confidence: undefined
 word: it, confidence: undefined
 word: work, confidence: undefined

I''m gonna keep trying, but assistance would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant