Azure-docs: Using custom model IDs does not work like explained

Created on 2 Apr 2019  Â·  24Comments  Â·  Source: MicrosoftDocs/azure-docs

@strohne commented on Tue Apr 02 2019

When using custom model IDs I get an error:

The request body is invalid: Unexpected initial token 'String' when populating object. Expected JSON object or array. Path 'models[0]', line 4, position 50.

Could you please explain how to correctly provide the model ID?

My payload example:

{
"name":"https://urltoblob.wav",
"recordingsUrl":"https://urltoblob.wav",
"models" : ["11111111-2222-3333-4444-55555555555"],
"locale":"de-DE"
}


Dokumentdetails

⚠ Bearbeiten Sie diesen Abschnitt nicht. Er ist für die Verknüpfung von docs.microsoft.com zum GitHub-Artikel erforderlich.

assigned-to-author cognitive-servicesvc doc-enhancement speech-servicsubsvc triaged

All 24 comments

Hi team,
I'm moving this here since the user is making a comment about the original documentation
kind regards

@CeciAc Thank you for your feedback, we will investigate it and get back to you soon.

@PanosPeriorellis Hi Panos, quick question: If a language model ID and acoustic model ID is must for custom model? If just one ID is provide, like the customer just has the acoustic model ID, what format it should be? Thank you.

BTW: I would be interested in the scenario with only language model, no acoustic model. Current documentation states:

For baseline transcriptions, you don't need to declare the ID for the baseline models. If you only specify a language model ID (and no acoustic model ID), a matching acoustic model is automatically selected. If you only specify an acoustic model ID, a matching language model is automatically selected.

@strohne Yea Jakob, I am asking the similar thing, thank you for taking that here as well.

I believe I have this set up correctly but I get the error "the recordings URI contains invalid data." which sounds like my audio file is corrupt or the wrong format. I've tried this on a number of different formats, all matching the supported formats. Is there anything special about the Azure blob setup? Or is there a sample audio file that you know works with this?

I believe I have this set up correctly but I get the error "the recordings URI contains invalid data." which sounds like my audio file is corrupt or the wrong format. I've tried this on a number of different formats, all matching the supported formats. Is there anything special about the Azure blob setup? Or is there a sample audio file that you know works with this?

I guess you need to set your blob storage to public.

That was it, thanks.

You can provide just one ID. We will figure out which model it corresponds too

From: YutongTie-MSFT notifications@github.com
Sent: 03 April 2019 21:51
To: MicrosoftDocs/azure-docs azure-docs@noreply.github.com
Cc: Panos Periorellis Panos.Periorellis@microsoft.com; Mention mention@noreply.github.com
Subject: Re: [MicrosoftDocs/azure-docs] Using custom model IDs does not work like explained (#28573)

@PanosPeriorellishttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPanosPeriorellis&data=02%7C01%7Cpanos.periorellis%40microsoft.com%7Cbf2b46fee5204ff2b82f08d6b86db095%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636899178587077147&sdata=oFmiS36DK7kNWXm8rzPoDWNqyrH08ys6WPe0JSj64Ac%3D&reserved=0 Hi Panos, quick question: If a language model ID and acoustic model ID is must for custom model? If just one ID is provide, like the customer just have the acoustic model ID, what format it should be? Thank you.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fazure-docs%2Fissues%2F28573%23issuecomment-479633899&data=02%7C01%7Cpanos.periorellis%40microsoft.com%7Cbf2b46fee5204ff2b82f08d6b86db095%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636899178587077147&sdata=4gDoUJ1EpvorvroPdDE1sJFgla7YBMT7ev4dlcLyMio%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAYK9khpo0EQH9oBJ1OnzhCHtzsfhMnGKks5vdQYhgaJpZM4cYyRn&data=02%7C01%7Cpanos.periorellis%40microsoft.com%7Cbf2b46fee5204ff2b82f08d6b86db095%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636899178587087160&sdata=DN%2BnjlcGzfhZHgnKyx77pyStFmXOjZPfwLMSdBVsbQc%3D&reserved=0.

@dinobrago Hi Dean, we will now proceed to close this thread. If there are further questions regarding this matter, please respond here and @YutongTie-MSFT and we will gladly continue the discussion.

@PanosPeriorellis Thank you for your information, that's cool and convenient.

@YutongTie-MSFT the issue is not solved, could you please reopen? @dinobrago hijacked the thread for an unrelated issue and I just helped out.

the answer of @PanosPeriorellis does not solve the issue since providing an ID like proposed leads to the error message provided in the opening comment

You can provide just one ID.

How?

@strohne If my understanding is not wrong, according to the configuration:

{
"recordingsUrl": "",
"models": [", "],
"locale": "",
"name": "",
"description": "",
"properties": {
"ProfanityFilterMode": "Masked",
"PunctuationMode": "DictatedAndAutomatic",
"AddWordLevelTimestamps" : "True"
}
}

For the models object, you can just provide with one of the IDs, and it can be recognized automatically for either acoustic ID or Language model ID. @PanosPeriorellis Please correct me if I am wrong.

The document point I want to share is, it's little bit confused for the first time reader. Much clearer will be helpful.

@strohne Please correct me if I did not get your point.

@YutongTie-MSFT This is exactly what I did (see above) and it throws an error:

The request body is invalid: Unexpected initial token 'String' when populating object. Expected JSON object or array. Path 'models[0]', line 3, position 51.

The problem is not providing one or two IDs / models. Rather the format is not working, neither for one nor for two IDs.

Looks like something else is expected in the models array, definitely not an ID-string.

@strohne Thank you for the clarification. I got you.

@PanosPeriorellis Could we have more details or samples for batch transcription about custom model? Thanks a lot.

Maybe the following example helps to understand the point. The message above says an array or object is expected inside the array. Thus, I tried to provide the model ID with doubled brackets (real ID is replaced with letters A-E) :

"models" : [[ "AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEE"]],

We get another error message:

The request body is invalid: Cannot populate JSON array onto type 'Microsoft.SpeechServices.Cris.Http.ModelIdentity'. Path 'models[0]', line 3, position 13.

I guess there is a bug in the code when converting String to GUID type or whatever.

Sorry for being impatient...any updates in this issue? I am currently working on a paper where we wanted to use this function. Only few days are left for finishing the empirical study part.

@strohne Hi Jakob, I understand your time is limited and this issue is emergent. Could you please send an email to us at [email protected]? We can help you to figure out this issue first.

@YutongTie-MSFT Thank you for your quick response, an email is on the way.

@YutongTie-MSFT Thanks to your engineers we have a solution. The correct way for specifying models is:

"models": [{"Id":"<optional acoustic model ID>"},{"Id":"<optional language model ID>"}]

Will you change the documentation?

Thank you so much for your support, I really appreciate it.

@strohne Yes, thank you for sharing this, I am going to fix the document bug. Thank you again.

please-close

you close without fixing the docs? strange.

@strohne Hi Jakob, thank you for the followup. I have created PR for both repos. You should see the change shortly after the author's review.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments

Favna picture Favna  Â·  3Comments