Created
March 26, 2022 13:55
-
-
Save harihara6/a467a9e37d32f82f1dabb6bd0262c305 to your computer and use it in GitHub Desktop.
Analyse the data
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
import * as AWSComprehend from "@aws-sdk/client-comprehend"; | |
import { LanguageServiceClient } from '@google-cloud/language'; | |
//Analyse using GCP | |
const [result] = await client.analyzeSentiment({document : { | |
content : item.toProcessString, | |
type : 'PLAIN_TEXT', | |
language: 'en' | |
}}); | |
//Analyse using AWS | |
const comprehendClient = new AWSComprehend.Comprehend({ region: "ap-south-1" }); | |
const awsSentimentResult = await comprehendClient.detectSentiment({ | |
LanguageCode : 'en', | |
Text: item.toProcessString | |
}) as AWSComprehend.DetectSentimentResponse; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment