来自官方 Microsoft Azure 教程的以下代码在第一行给出了以下错误消息:ITextAnalyticsAPI client = new TextAnalyticsAPI();TextAnalyticsAPI.TextAnalyticsAPI(param DelegatingHandler[]) 由于其保护级别而无法访问using System;using Microsoft.Azure.CognitiveServices.Language.TextAnalytics;using Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models;using System.Collections.Generic;namespace ConsoleApp1{ class Program { static void Main(string[] args) { // Create a client. ITextAnalyticsAPI client = new TextAnalyticsAPI(); client.AzureRegion = AzureRegions.Westus; client.SubscriptionKey = "ENTER KEY HERE"; Console.OutputEncoding = System.Text.Encoding.UTF8; // Extracting language Console.WriteLine("===== LANGUAGE EXTRACTION ======"); LanguageBatchResult result = client.DetectLanguage( new BatchInput( new List<Input>() { new Input("1", "This is a document written in English."), new Input("2", "Este es un document escrito en Español."), new Input("3", "这是一个用中文写的文件") })); // Printing language results. foreach (var document in result.Documents) { Console.WriteLine("Document ID: {0} , Language: {1}", document.Id, document.DetectedLanguages[0].Name); } // Getting key-phrases Console.WriteLine("\n\n===== KEY-PHRASE EXTRACTION ======"); KeyPhraseBatchResult result2 = client.KeyPhrases( } }}
1 回答
杨魅力
TA贡献1811条经验 获得超6个赞
帖子来自09-20-2017
并且包的1.0.0
预览版本来自09-19-2017
。
然而,该软件包的最新版本是1.0.1
昨天发布的,您很可能已安装。
小升级不应该有重大变化,但是......
- 1 回答
- 0 关注
- 122 浏览
添加回答
举报
0/150
提交
取消