chrome 扩展和 Azure 文本分析 API 之间的连接
Connection between chrome extension and Azure text analytics API
我正在尝试在我的 chrome 扩展和文本分析 API 之间建立连接。我创建了 background.js 来处理扩展安装到 chrome 后的连接,但它抛出错误代码:Failed to load resource: the server responded with a status of 404 ()
如何在扩展和 Azure TA 之间建立连接API?
有一个 JavaScript 库可供您使用:Azure Text Analytics client library for JavaScript。 GitHub repo 有很多示例,比如这个用于检测语言的示例:
const documents = [
"This document is written in English.",
"Este es un document escrito en Español.",
"这是一个用中文写的文件",
"Dies ist ein Dokument in deutsche Sprache.",
"Detta är ett dokument skrivet på engelska."
];
const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey));
const results = await client.detectLanguage(documents);
我正在尝试在我的 chrome 扩展和文本分析 API 之间建立连接。我创建了 background.js 来处理扩展安装到 chrome 后的连接,但它抛出错误代码:Failed to load resource: the server responded with a status of 404 ()
如何在扩展和 Azure TA 之间建立连接API?
有一个 JavaScript 库可供您使用:Azure Text Analytics client library for JavaScript。 GitHub repo 有很多示例,比如这个用于检测语言的示例:
const documents = [
"This document is written in English.",
"Este es un document escrito en Español.",
"这是一个用中文写的文件",
"Dies ist ein Dokument in deutsche Sprache.",
"Detta är ett dokument skrivet på engelska."
];
const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey));
const results = await client.detectLanguage(documents);