LUIS Authoring API:如何按意图过滤LUIS话语?

时间:2017-12-15 22:27:50

标签: botframework luis

我需要为特定的意图检索所有标记的话语(也就是示例)。

LUIS Authoring API中唯一要执行此操作的调用是GET review labeled examples

/luis/api/v2.0/apps/:appId/versions/:versionId/examples?skip=0&take=500 /luis/api/v2.0/apps/:appId/versions/:versionId/examples?skip=500&take=500

这将返回所有意图的所有话语。我有880个标记的话语,由于冗长的回复,它是一个2.5MB的文件。这使它变慢。

LUIS Web UI使用过滤调用: /luis/webapi/v2.0/apps/:appId/versions/0.1/models/:modelId/reviewLabels。生成的文件通常为10-50kB。但是,此调用没有相关文档(请注意路径中的webapi,而不仅仅是api)。

那么:是否有支持的方法来检索过滤的话语列表?

1 个答案:

答案 0 :(得分:4)

is there a supported method for retrieving a filtered list of utterances?

AFAIK, I could't find an API for this from server side, after research I found that even the Luis Web UI doesn't use any filter provided by server, it just gets all the utterances from server side and create filter use js in the foreground.

Since you're stratified with the result using net.corda.core.contracts.TransactionVerificationException$ContractConstraintRejection: Contract constraints failed for net.corda.training.contract.IOUContract, transaction: D60DD71F9D50BA7A638455B676CD394601460D937544A5697643FDD952C9FCB4 at net.corda.core.transactions.LedgerTransaction.verifyConstraints(LedgerTransaction.kt:91) ~[corda-core-1.0.0.jar:?] at net.corda.core.transactions.LedgerTransaction.verify(LedgerTransaction.kt:67) ~[corda-core-1.0.0.jar:?] at net.corda.node.services.transactions.InMemoryTransactionVerifierService$verify$1.invoke(InMemoryTransactionVerifierService.kt:13) ~[corda-node-1.0.0.jar:?] at net.corda.node.services.transactions.InMemoryTransactionVerifierService$verify$1.invoke(InMemoryTransactionVerifierService.kt:10) ~[corda-node-1.0.0.jar:?] at net.corda.core.internal.concurrent.ValueOrException$DefaultImpls.capture(CordaFutureImpl.kt:104) ~[corda-core-1.0.0.jar:?] at net.corda.core.internal.concurrent.OpenFuture$DefaultImpls.capture(CordaFutureImpl.kt) ~[corda-core-1.0.0.jar:?] at net.corda.core.internal.concurrent.CordaFutureImpl.capture(CordaFutureImpl.kt:116) ~[corda-core-1.0.0.jar:?] at net.corda.core.internal.concurrent.CordaFutureImplKt$fork$$inlined$also$lambda$1.run(CordaFutureImpl.kt:22) ~[corda-core-1.0.0.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:1.8.0_131] at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_131] for Luis Web UI, after testing, we can call this webapi exactly the same as calling webapi together with api as head, for example we can code like this in C#:

Ocp-Apim-Subscription-Key

There's no official document about this try { using (var client = new HttpClient()) { client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{SubscriptionKey}"); var uri = "https://westus.api.cognitive.microsoft.com/luis/webapi/v2.0/apps/{appId}/versions/{versionNumber}/models/{modelId}/reviewLabels"; var response = await client.GetAsync(uri); //TODO: } } catch (Exception e) { Debug.WriteLine(e.Message); } , but we can try to use webapi to analyse the http requests.