You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于Azure托管Mistral OCR API置信度分数支持的技术问询

Azure托管Mistral OCR置信度分数相关问题解答

问题背景

正在集成Azure托管的Mistral OCR API,期望获取单词级OCR置信度分数,功能对齐原生Mistral OCR API,但传入confidence_scores_granularity: "word"参数时收到HTTP 422错误,提示参数不被允许。

错误响应示例:

{
  "error": {
    "code": "Invalid input",
    "message": {
      "detail": [
        {
          "type": "extra_forbidden",
          "loc": [
            "body",
            "confidence_scores_granularity"
          ],
          "msg": "Extra inputs are not permitted",
          "input": "word"
        }
      ]
    },
    "status": 422
  }
}

实现代码示例:

const endpoint = process.env.MISTRAL_BASE_URL;
const apiKey = process.env.MISTRAL_API_KEY;
const modelName = "mistral-document-ai-2512";

const base64Pdf = pdfBuffer.toString("base64");

const response = await fetch(endpoint, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${apiKey}`,
  },
  body: JSON.stringify({
    model: modelName,
    document: {
      type: "document_url",
      document_url: `data:application/pdf;base64,${base64Pdf}`,
    },
    include_image_base64: true,
    // confidence_scores_granularity: "word",
  }),
});

环境:日本东部区域的Azure托管Mistral OCR端点


问题解答

1. Azure Mistral OCR当前是否支持OCR置信度分数?

当前Azure托管的Mistral OCR服务暂不支持通过confidence_scores_granularity参数获取单词级或其他粒度的置信度分数。该参数是原生Mistral API的特性,但Azure托管版本的API实现与原生版本存在差异,未包含该参数的支持,因此传入后会触发422参数无效错误。

2. 是否存在其他兼容Azure的参数或API版本,可用于获取Mistral的单词/页面置信度值?

目前没有公开的替代参数或API版本支持在Azure托管Mistral OCR中获取置信度分数。如果业务场景必须依赖OCR置信度验证扫描PDF质量、检测低置信度区域,可考虑以下方案:

  • 使用Azure Computer Vision OCR服务:该原生Azure服务支持返回单词级、行级的置信度分数,完全匹配你的用例需求。
  • 持续关注Azure官方文档更新:Azure托管的Mistral服务可能在后续版本中同步原生API的置信度功能,建议定期查看服务更新日志。

内容的提问来源于stack exchange,提问作者user32727936

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.02 01:34:52