Created
November 18, 2021 16:25
-
-
Save Hkazanci93/75665990fab882c6d0e24ee9cb933fae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sslCreds = getApiKeyCredentials(); | |
const client = new language.LanguageServiceClient({ sslCreds }); | |
const document = { | |
content: text, | |
type: 'PLAIN_TEXT', | |
}; | |
const [result] = await client.analyzeSentiment({ document: document }); | |
sentiment = mapSentiment(result.documentSentiment.score || 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment