Open topic with navigation

# Run Natural Language Generation

You run NLG by sending the `NLG` action to Answer Server in a POST request method. You submit a JSON object, which contains details of the parts of speech that you want to use to generate a sentence, and the action returns the appropriate sentence.

    curl http://localhost:12000/?action=NLG –F Spec={
      "sentences": [
        {
          "subject": {
            "noun_phrases": [
              { "value": "the dog" },
              { "value": "your giraffe" }
            ]
          },
          "verb": {
            "verb_phrase": {
              "value": "chase",
              "modifiers": [ "quickly" ]
            }
          },
          "object": {
            "noun_phrases": [
              { "value": "the monkey" },
              { "value": "George" },
              { "value": "Martha" }
            ],
            "conjunction": "or"
          }
        }
      ]
    }

This action generates the following sentence:

The dog and your giraffe quickly chase the monkey, George or Martha.

You can retrieve the full schema for the JSON object to use by using the `GetResources` action. See Find the JSON Schema for Your Update.

© Copyright 2015-2019 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm