Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ...
- // Text for sentiment analysis
- const positiveText =
- 'I am incredibly happy today! It may be the best day ever!';
- const negativeText =
- "Oh no, it's Monday. My alarm didn't go off! I have a presentation in afew minutes. This is really bad.";
- // Format for Cloud Natural Language API
- const positiveDocument = {
- type: 'PLAIN_TEXT',
- content: positiveText,
- };
- const negativeDocument = {
- type: 'PLAIN_TEXT',
- content: negativeText,
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement