Using multiple StrictFilters in QnA Maker

浪子不回头ぞ 提交于 2020-05-15 08:46:46

问题


I'm looking to use the StrictFilter function of Microsoft QnA Maker, to pass in multiple strict filters, but to treat them as filterA OR filterB. It appears that the strict filters are treated as filterA AND filterB. Is there any way to change them to "OR"?

https://docs.microsoft.com/sl-si/azure/cognitive-services/qnamaker/how-to/metadata-generateanswer-usage

It looks like ultimately it's querying Azure search, generating an "filterA AND filterB" - would querying Azure Search directly rather than the GenerateAnswer method be an approach anyone else has taken for something like this?


回答1:


So in this case ANDing filters together within the same API call is not currently possible. However you can get a similar effect by posting the same query multiple times with different strict filters and then adding them together.

Call1: "strictFilters": [ { "name": "filter1", "value": "value1" },{ "name": "filter2", "value": "value2" }]

Call2: "strictFilters": [ { "name": "filter1", "value": "value1" },{ "name": "filter2", "value": "value3" }]

This would return all entries with filter1 set to value1 and filter2 set to value2 or value3. The documentation will likely be updated if this workaround is no longer necessary.



来源:https://stackoverflow.com/questions/50977134/using-multiple-strictfilters-in-qna-maker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!