【问题标题】:Azure Text Moderator not found未找到 Azure 文本审查器
【发布时间】:2019-11-18 10:57:41
【问题描述】:

API 名称:

文本编辑器

拥有 Azure 订阅,我创建了认知服务,并从 c# 控制台尝试测试 TextModerator 项目。

当这行被调用时:

var screenResult =
                        client.TextModeration.ScreenText("text/plain", new MemoryStream(Encoding.UTF8.GetBytes(text)), "eng", true, true, null, true);

我收到以下消息:

Microsoft.CognitiveServices.ContentModerator.Models.APIErrorException : '操作返回一个无效的状态码'NotFound''

端点是这样的:

https://contentmoderator-****.cognitiveservices.azure.com/contentmoderator

有什么想法吗?

萨德

【问题讨论】:

    标签: azure azure-cognitive-services


    【解决方案1】:

    您可以将以下基本端点用于您的特定区域(例如:westus)。 https://westus.api.cognitive.microsoft.com.

    安装客户端库: 在应用程序目录中,使用以下命令安装 .NET 的 Content Moderator 客户端库:

    dotnet 添加包 Microsoft.Azure.CognitiveServices.ContentModerator --version 2.0.0

    如果您使用的是 Visual Studio IDE,客户端库可作为可下载的 NuGet 包使用。

    请按照以下文档查看中等文本。 https://docs.microsoft.com/en-us/azure/cognitive-services/content-moderator/dotnet-sdk-quickstart#setting-up

    请关注API Reference了解更多信息。

    【讨论】:

    • 感谢您的回复,但为什么 Azure 会生成端点?
    • 只是为了澄清解决方案:我将 ContentModerator nuget 更新到了最新版本 2.0.0 ,是的,我使用了我所在地区(法国)的基本端点。
    • Azure生成的Endpoint没用,如果有人知道为什么,提前谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-25
    • 1970-01-01
    • 2019-04-21
    • 2020-07-08
    • 1970-01-01
    • 2011-05-25
    相关资源
    最近更新 更多