We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b949e87 commit 18456b4Copy full SHA for 18456b4
cloud-language/snippets/analyze.v1.js
@@ -314,8 +314,17 @@ async function classifyTextOfText(text) {
314
type: 'PLAIN_TEXT',
315
};
316
317
+ const classificationModelOptions = {
318
+ v2Model: {
319
+ contentCategoriesVersion: 'V2',
320
+ },
321
+ };
322
+
323
// Classifies text in the document
- const [classification] = await client.classifyText({document});
324
+ const [classification] = await client.classifyText({
325
+ document,
326
+ classificationModelOptions,
327
+ });
328
console.log('Categories:');
329
classification.categories.forEach(category => {
330
console.log(`Name: ${category.name}, Confidence: ${category.confidence}`);
0 commit comments