ترحيل التعليمات البرمجية من v3.1 إلى v3.2 من واجهة برمجة تطبيقات REST

يتم استخدام Speech to text REST API للنسخ الدفعي والكلام المخصص. توضح هذه المقالة التغييرات من الإصدار 3.1 إلى 3.2.

هام

يتوفر Speech to text REST API v3.2 في المعاينة. يتوفر الكلام إلى نص REST API v3.1 بشكل عام. سيتم إيقاف Speech to text REST API v3.0 في 1 أبريل 2026. لمزيد من المعلومات، راجع دلائل الترحيل Speech to text REST API v3.0 إلى v3.1 وv3.1 إلى v3.2 .

المسار الأساسي

يجب تحديث المسار الأساسي في التعليمات البرمجية الخاصة بك من /speechtotext/v3.1 إلى /speechtotext/v3.2-preview.2. على سبيل المثال، للحصول على نماذج أساسية في eastus المنطقة، استخدم https://eastus.api.cognitive.microsoft.com/speechtotext/v3.2-preview.2/models/base بدلا من https://eastus.api.cognitive.microsoft.com/speechtotext/v3.1/models/base.

لمزيد من المعلومات، راجع معرفات العملية لاحقا في هذا الدليل.

كتابة حديث دُفعة

هام

التسعير الجديد ساري المفعول للنسخ الدفعي عبر Speech to text REST API v3.2. لمزيد من المعلومات، راجع دليل التسعير.

قيود التوافق مع الإصدارات السابقة

لا تستخدم Speech للنص REST API v3.0 أو v3.1 لاسترداد نسخة تم إنشاؤها عبر Speech إلى نص REST API v3.2. قد ترى رسالة خطأ مثل: "لا يمكن استخدام إصدار واجهة برمجة التطبيقات للوصول إلى هذا النسخ. استخدم إصدار API v3.2 أو أعلى."

وضع تعريف اللغة

LanguageIdentificationMode تتم إضافة إلى LanguageIdentificationProperties كأخوة ل candidateLocales وspeechModelMapping. الأوضاع المتوفرة لتحديد اللغة هي Continuous أو Single. تعريف اللغة المستمر هو الافتراضي. لمزيد من المعلومات، راجع نموذج تعريف اللغة.

نماذج الهمس

يدعم Azure الذكاء الاصطناعي Speech الآن نموذج OpenAI's Whisper عبر Speech to text REST API v3.2. لمعرفة المزيد، راجع دليل إنشاء نسخ دفعي .

إشعار

تدعم خدمة Azure OpenAI أيضا نموذج الهمس الخاص ب OpenAI لتحويل الكلام إلى نص باستخدام واجهة برمجة تطبيقات REST متزامنة. لمعرفة المزيد، تحقق من التشغيل السريع. راجع ما هو نموذج الهمس؟ لمعرفة المزيد حول وقت استخدام Azure الذكاء الاصطناعي Speech مقابل خدمة Azure OpenAI.

الكلام المخصص

هام

ستتم محاسبتك على تدريب نموذج الكلام المخصص إذا تم إنشاء النموذج الأساسي في 1 أكتوبر 2023 والإصدارات الأحدث. لا تتم محاسبتك على التدريب إذا تم إنشاء النموذج الأساسي قبل أكتوبر 2023. لمزيد من المعلومات، راجع تسعير Azure الذكاء الاصطناعي Speech.

لتحديد ما إذا كان قد تم إنشاء نموذج برمجيا قبل 1 أكتوبر 2023 أو بعده، استخدم chargedForAdaptation الخاصية الجديدة في الإصدار 3.2.

تنسيق نص العرض المخصص

لدعم تكيف النموذج مع بيانات تنسيق نص العرض المخصصة، تدعم عملية Datasets_Create نوع بيانات OutputFormatting. لمزيد من المعلومات، راجع تحميل مجموعات البيانات.

تمت إضافة تعريف ل OutputFormatType بالقيم مع Lexical تعداد القيم.Display

"OutputFormatType": {
    "title": "OutputFormatType",
    "enum": [
        "Lexical",
        "Display"
    ],
    "type": "string",
    "x-ms-enum": {
        "name": "OutputFormatType",
        "modelAsString": true,
        "values": [
            {
                "value": "Lexical",
                "description": "Model provides the transcription output without formatting."
            },
            {
                "value": "Display",
                "description": "Model supports display formatting transcriptions output or endpoints."
            }
        ]
    }
},

OutputFormattingData تتم إضافة قيمة قائمة التعداد إلى FileKind (نوع بيانات الإدخال).

supportedOutputFormat تتم إضافة الخاصية إلى BaseModelFeatures. هذه الخاصية BaseModel ضمن التعريف.

"BaseModelFeatures": {
    "title": "BaseModelFeatures",
    "description": "Features supported by the model.",
    "type": "object",
    "allOf": [
        {
            "$ref": "#/definitions/SharedModelFeatures"
        }
    ],
    "properties": {
        "supportsAdaptationsWith": {
            "description": "Supported dataset kinds to adapt the model.",
            "type": "array",
            "items": {
                "$ref": "#/definitions/DatasetKind"
            },
            "readOnly": true
        },
        "supportedOutputFormat": {
            "description": "Supported output formats.",
            "type": "array",
            "items": {
                "$ref": "#/definitions/OutputFormatType"
            },
            "readOnly": true
        }
    }
},

رسوم التكيف

chargeForAdaptation تتم إضافة الخاصية إلى BaseModelProperties. هذه الخاصية BaseModel ضمن التعريف.

هام

ستتم محاسبتك على تدريب نموذج الكلام المخصص إذا تم إنشاء النموذج الأساسي في 1 أكتوبر 2023 والإصدارات الأحدث. لا تتم محاسبتك على التدريب إذا تم إنشاء النموذج الأساسي قبل أكتوبر 2023. لمزيد من المعلومات، راجع تسعير Azure الذكاء الاصطناعي Speech.

إذا كانت قيمة chargeForAdaptation هي true، فستتم محاسبتك على تدريب النموذج. إذا كانت القيمة هي false، فستتم محاسبتك على تدريب النموذج. استخدم الخاصية chargeForAdaptation بدلا من تاريخ الإنشاء لتحديد ما إذا كنت مسؤولا برمجيا عن تدريب نموذج.

"BaseModelProperties": {
    "title": "BaseModelProperties",
    "type": "object",
    "properties": {
        "deprecationDates": {
            "$ref": "#/definitions/BaseModelDeprecationDates"
        },
        "features": {
            "$ref": "#/definitions/BaseModelFeatures"
        },
        "chargeForAdaptation": {
            "description": "A value indicating whether model adaptation is charged.",
            "type": "boolean",
            "readOnly": true
        }
    }
},

تسوية النص

textNormalizationKind تتم إضافة الخاصية إلى DatasetProperties.

تعريف الكيان ل TextNormalizationKind: نوع تسوية النص.

  • الافتراضي: تسوية النص الافتراضي (على سبيل المثال، يحل 'اثنان إلى ثلاثة' محل '2 إلى 3' في en-US).
  • بلا: لا يتم تطبيق أي تسوية للنص على نص الإدخال. هذه القيمة هي خيار تجاوز يجب استخدامه فقط عند تسوية النص قبل التحميل.

خصائص التقييم

تمت إضافة عدد الرموز المميزة وخصائص خطأ الرمز المميز إلى الخصائص EvaluationProperties :

  • correctTokenCount1: عدد الرموز المميزة التي تم التعرف عليها بشكل صحيح حسب model1.
  • tokenCount1: عدد الرموز المميزة المعالجة حسب model1.
  • tokenDeletionCount1: عدد الرموز المميزة التي تم التعرف عليها بواسطة model1 التي هي عمليات حذف.
  • tokenErrorRate1: معدل خطأ الرمز المميز للتعرف مع model1.
  • tokenInsertionCount1: عدد الرموز المميزة التي تم التعرف عليها بواسطة model1 وهي عمليات إدراج.
  • tokenSubstitutionCount1: عدد الكلمات التي تم التعرف عليها حسب model1 التي تعد استبدالا.
  • correctTokenCount2: عدد الرموز المميزة التي تم التعرف عليها بشكل صحيح حسب model2.
  • tokenCount2: عدد الرموز المميزة المعالجة حسب model2.
  • tokenDeletionCount2: عدد الرموز المميزة التي تم التعرف عليها بواسطة model2 التي هي عمليات حذف.
  • tokenErrorRate2: معدل خطأ الرمز المميز للتعرف مع model2.
  • tokenInsertionCount2: عدد الرموز المميزة التي تم التعرف عليها حسب الطراز 2 وهي عمليات إدراج.
  • tokenSubstitutionCount2: عدد الكلمات التي تم التعرف عليها حسب model2 التي تعد استبدالا.

نسخة النموذج

التغييرات التالية للسيناريو حيث تقوم بنسخ نموذج.

  • تمت إضافة عملية Models_Copy الجديدة. إليك المخطط في عملية النسخ الجديدة: "$ref": "#/definitions/ModelCopyAuthorization"
  • إهمال عملية Models_CopyTo . إليك المخطط في عملية النسخ المهملة: "$ref": "#/definitions/ModelCopy"
  • تمت إضافة عملية Models_AuthorizeCopy الجديدة التي ترجع "$ref": "#/definitions/ModelCopyAuthorization". يمكن استخدام هذا الكيان الذي تم إرجاعه في عملية Models_Copy الجديدة.

تمت إضافة تعريف كيان جديد ل ModelCopyAuthorization:

"ModelCopyAuthorization": {
    "title": "ModelCopyAuthorization",
    "required": [
        "expirationDateTime",
        "id",
        "sourceResourceId",
        "targetResourceEndpoint",
        "targetResourceId",
        "targetResourceRegion"
    ],
    "type": "object",
    "properties": {
        "targetResourceRegion": {
            "description": "The region (aka location) of the target speech resource (e.g., westus2).",
            "minLength": 1,
            "type": "string"
        },
        "targetResourceId": {
            "description": "The Azure Resource ID of the target speech resource.",
            "minLength": 1,
            "type": "string"
        },
        "targetResourceEndpoint": {
            "description": "The endpoint (base url) of the target resource (with custom domain name when it is used).",
            "minLength": 1,
            "type": "string"
        },
        "sourceResourceId": {
            "description": "The Azure Resource ID of the source speech resource.",
            "minLength": 1,
            "type": "string"
        },
        "expirationDateTime": {
            "format": "date-time",
            "description": "The expiration date of this copy authorization.",
            "type": "string"
        },
        "id": {
            "description": "The ID of this copy authorization.",
            "minLength": 1,
            "type": "string"
        }
    }
},

تمت إضافة تعريف كيان جديد ل ModelCopyAuthorizationDefinition:

"ModelCopyAuthorizationDefinition": {
    "title": "ModelCopyAuthorizationDefinition",
    "required": [
        "sourceResourceId"
    ],
    "type": "object",
    "properties": {
        "sourceResourceId": {
            "description": "The Azure Resource ID of the source speech resource.",
            "minLength": 1,
            "type": "string"
        }
    }
},

تمت إضافة خاصية جديدة copy .

"CustomModelLinks": {
    "title": "CustomModelLinks",
    "type": "object",
    "properties": {
      "copyTo": {
        "format": "uri",
        "description": "The location to the obsolete model copy action. See operation \"Models_CopyTo\" for more details.",
        "type": "string",
        "readOnly": true
      },
      "copy": {
        "format": "uri",
        "description": "The location to the model copy action. See operation \"Models_Copy\" for more details.",
        "type": "string",
        "readOnly": true
      },
      "files": {
        "format": "uri",
        "description": "The location to get all files of this entity. See operation \"Models_ListFiles\" for more details.",
        "type": "string",
        "readOnly": true
      },
      "manifest": {
        "format": "uri",
        "description": "The location to get a manifest for this model to be used in the on-prem container. See operation \"Models_GetCustomModelManifest\" for more details.",
        "type": "string",
        "readOnly": true
      }
    },
    "readOnly": true
},

معرفات العملية

يجب تحديث المسار الأساسي في التعليمات البرمجية الخاصة بك من /speechtotext/v3.1 إلى /speechtotext/v3.2-preview.2. على سبيل المثال، للحصول على نماذج أساسية في eastus المنطقة، استخدم https://eastus.api.cognitive.microsoft.com/speechtotext/v3.2-preview.2/models/base بدلا من https://eastus.api.cognitive.microsoft.com/speechtotext/v3.1/models/base.

الخطوات التالية