perspective-api-client icon indicating copy to clipboard operation
perspective-api-client copied to clipboard

AnalyzeComment object not working?

Open corbolt opened this issue 4 years ago • 0 comments

Hi,

I tried to call analyze() with an AnalyzeComment object instead of the variant analyze(text, { options }).

The request looked like this:

analyze({ comment: { text }, languages: ['en'], requestedAttributes: { 'TOXICITY': { scoreThreshold: 0.6 }, 'IDENTITY_ATTACK': { scoreThreshold: 0.6 }, 'INSULT': { scoreThreshold: 0.7 } } });

Here I don't get a complete response from the API:

What I get as a response is the following:

{ languages: [ 'en' ], detectedLanguages: [ 'ro', 'en' ] }

The attributeScores are missing here. What am I doing wrong?

corbolt avatar Jun 22 '21 08:06 corbolt