googleapis / googleapis/google-cloud-java

There should be way for providing List of Document for analyzeSentiment instead of single Document

Open
#11,371 1 comment 0 reactions 0 assignees View on GitHub
priority: p2 type: feature request
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

I am trying to get the Sentiment for the conversation between Agent and Customer on sentence level using **Google Cloud Natural Language API**.
But observation is, i have to call API for each sentence Is there any way to get the sentiment for List of Document And after Successfull Sentiment i am able to map that sentiment to each sentence.

Here is the snniped code which i tried for sentiment analysis

There is no way to give List of Document

```java
Document doc = Document.newBuilder()
.setContent(TEXT)
.setType(Document.Type.PLAIN_TEXT)
.build();
AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(doc);
Sentiment documentSentiment = response.getDocumentSentiment();
log.info("sentence:{}", fromObjectToJson(documentSentiment));
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.