Systems, methods, and computer-readable media for constructing a conversation model using documentation of an application programming interface (API) are disclosed. The conversation model can be used to train a natural language classifier. API endpoints may be represented in the API documentation as (verb, resource, element) tuples. These tuples can be converted into intent and parameters of the API endpoints can be converted into entities. In addition, example utterances may be created for each intent. The conversation model can be generated using the intents, example utterances, and/or entities.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A computer-implemented method for constructing a conversation model using documentation of an application programming interface (API), the method comprising: generating a respective intent for each API endpoint in a set of API endpoints identified in the documentation of the API; generating a respective set of utterance examples for each respective intent; and generating the conversation model using each respective intent and each respective set of utterance examples; and utilizing the conversation model to train a natural language classifier, the natural language classifier being used to classify an input utterance as corresponding to a particular API endpoint, wherein utilizing the conversation model to train the natural language classifier further comprises using positive training examples and negative training examples to train the natural language classifier.
2. The computer-implemented method of claim 1 , further comprising: receiving the input utterance; determining, using the trained natural language classifier, that the input utterance can be handled by the API; determining, using the conversation model, a particular intent corresponding to the input utterance; determining, using the conversation model, the particular API endpoint corresponding to the particular intent; making a call to the particular API endpoint; and generating a natural language API response to the input utterance.
3. The computer-implemented method of claim 2 , wherein utilizing the conversation model to train the natural language classifier comprises utilizing each respective set of utterance examples as the positive training examples.
4. The computer-implemented method of claim 1 , wherein generating the respective intent for each API endpoint comprises converting a respective resource of each API endpoint into the respective intent.
5. The computer-implemented method of claim 1 , further comprising generating a respective set of one or more entities for each API endpoint, wherein the conversation model is generated further based at least in part on each respective set of one or more entities.
6. The computer-implemented method of claim 5 , wherein generating a respective set of one or more entities for each API endpoint comprises converting a respective one or more parameters of each API endpoint into the respective set of one or more entities.
7. The computer-implemented method of claim 1 , wherein generating the conversation model comprises: generating a top-level node in a conversation tree of the conversation model for each respective intent; generating a respective set of one or more sub-nodes for each top-level node, wherein each sub-node corresponds to a mandatory input field; and generating a respective terminal node corresponding to each top-level node and each respective set of one or more sub-nodes, wherein each respective terminal node stores a respective API endpoint to which the respective intent corresponds.
8. A system for constructing a conversation model using documentation of an application programming interface (API), the system comprising: at least one memory storing computer-executable instructions; and at least one processor configured to access the at least one memory and execute the computer-executable instructions to: generate a respective intent for each API endpoint in a set of API endpoints identified in the documentation of the API; generate a respective set of utterance examples for each respective intent; generate the conversation model using each respective intent and each respective set of utterance examples; and utilize the conversation model to train a natural language classifier, the natural language classifier being used to classify an input utterance as corresponding to a particular API endpoint, wherein utilizing the conversation model to train the natural language classifier further comprises using positive training examples and negative training examples to train the natural language classifier.
9. The system of claim 8 , wherein the at least one processor is further configured to execute the computer-executable instructions to: receiving the input utterance; determine, using the trained natural language classifier, that the input utterance can be handled by the API; determine, using the conversation model, a particular intent corresponding to the input utterance; determine, using the conversation model, the particular API endpoint corresponding to the particular intent; make a call to the particular API endpoint; and generate a natural language API response to the input utterance.
10. The system of claim 9 , wherein the at least one processor is further configured to utilize the conversation model to train the natural language classifier by executing the computer-executable instructions to utilize each respective set of utterance examples as the positive training examples.
11. The system of claim 8 , wherein the at least one processor is configured to generate the respective intent for each API endpoint by executing the computer-executable instructions to convert a respective resource of each API endpoint into the respective intent.
12. The system of claim 8 , wherein the at least one processor is further configured to execute the computer-executable instructions to generate a respective set of one or more entities for each API endpoint, and wherein the conversation model is generated further based at least in part on each respective set of one or more entities.
13. The system of claim 12 , wherein the at least one processor is configured to generate a respective set of one or more entities for each API endpoint by executing the computer-executable instructions to convert a respective one or more parameters of each API endpoint into the respective set of one or more entities.
14. The system of claim 8 , wherein the at least one processor is configured to generate the conversation model by executing the computer-executable instructions to: generate a top-level node in a conversation tree of the conversation model for each respective intent; generate a respective set of one or more sub-nodes for each top-level node, wherein each sub-node corresponds to a mandatory input field; and generate a respective terminal node corresponding to each top-level node and each respective set of one or more sub-nodes, wherein each respective terminal node stores a respective API endpoint to which the respective intent corresponds.
15. A computer program product for constructing a conversation model using documentation of an application programming interface (API), the computer program product comprising a storage medium readable by a processing circuit, the storage medium storing instructions executable by the processing circuit to cause a method to be performed, the method comprising: generating a respective intent for each API endpoint in a set of API endpoints identified in the documentation of the API; generating a respective set of utterance examples for each respective intent; generating the conversation model using each respective intent and each respective set of utterance examples; and utilizing the conversation model to train a natural language classifier, the natural language classifier being used to classify an input utterance as corresponding to a particular API endpoint, wherein utilizing the conversation model to train the natural language classifier further comprises using positive training examples and negative training examples to train the natural language classifier.
16. The computer program product of claim 15 , the method further comprising: receiving the input utterance; determining, using the trained natural language classifier, that the input utterance can be handled by the API; determining, using the conversation model, a particular intent corresponding to the input utterance; determining, using the conversation model, the particular API endpoint corresponding to the particular intent; making a call to the particular API endpoint; and generating a natural language API response to the input utterance.
17. The computer program product of claim 16 , wherein utilizing the conversation model to train the natural language classifier comprises utilizing each respective set of utterance examples as the positive training examples.
18. The computer program product of claim 15 , wherein generating the respective intent for each API endpoint comprises converting a respective resource of each API endpoint into the respective intent.
19. The computer program product of claim 15 , the method further comprising generating a respective set of one or more entities for each API endpoint, wherein the conversation model is generated further based at least in part on each respective set of one or more entities.
20. The computer program product of claim 15 , wherein generating the conversation model comprises: generating a top-level node in a conversation tree of the conversation model for each respective intent; generating a respective set of one or more sub-nodes for each top-level node, wherein each sub-node corresponds to a mandatory input field; and generating a respective terminal node corresponding to each top-level node and each respective set of one or more sub-nodes, wherein each respective terminal node stores a respective API endpoint to which the respective intent corresponds.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
December 15, 2017
November 10, 2020
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.