Skip to main content

Process Text Using NLU Models

Open In Collab Run in Postman

Once a model is deployed you would like it to predict the intent and entities given a piece of text that the model has never seen before. In this article we will walk you through the parse command, using which you can access any deployed model and use it to process text.

Prerequisites

  • Getting Started: Make sure to follow Getting Started to login and install nlu app. If you are using APIs, save your authorization token in a variable called AUTHORIZATION_TOKEN before moving ahead.
  • Create a Project:
    • Make sure to create a project and have the project id in a variable called PROJECT_ID.
    • Make sure to have the language for which you added training examples in a variable called LANGUAGE.
  • Add training data: Make sure to have at least two intents with 10 examples each
  • Train a model: Train a model using our training API and store the model id in a variable called MODEL_ID
  • Deploy a model: To process text using a model you need to deploy it first. Make sure to keep it's model id in a variable called MODEL_ID

Process Text

This returns a predicted intent as well as entities for a given text. Additionally, it returns a ranking of intents in the order of confidence.

neuralspace nlu parse -m $MODEL_ID -i "Sample input text"
Parsing Failures

Parsing might fail if you have exceeded your number of api calls specified in your license.