Azure-Samples / Azure-Samples/cognitive-services-quickstart-code

The analyze request is invalid. Ensure that each filter key is not null, empty or longer than 128 and that the length of all keys is less than 1024 characters

Aperta
#50 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
389
Fork
556
Merge medio
3g 12h
PR unite (30g)
1

Descrizione

When running the analyze function using a list of keys to filter the data, I am getting the error below.

> "{\"error\":{\"code\":\"1010\",\"message\":\"The analyze request is invalid. Ensure that each filter key is not null, empty or longer than 128 and that the length of all keys is less than 1024 characters.\"}}"

```
AnalyzeResult result = await formClient.AnalyzeWithCustomModelAsync(modelId, fileStream, contentType: "application/pdf", GetKeyListByProvince(province));

private IList GetKeyListByProvince(Province province)
{
var keys = new List();
switch (province)
{
default:
case Province.BC:
keys = new List{
"Name of Company:", "Incorporation Number:", "Business Number:", "Last Name, First Name, Middle Name:", "Jurisdiction:", "Delivery Address:", "Entity Status:"
};
break;
}
return keys;
}
```

It works fine when analyzing the data without the list of keys, but we need to narrow it down to only the ones required.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.