Answer Server 12.12

# 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-2022 Micro Focus or one of its affiliates
Version 12.12 | Last updated June 2022

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL Answer Server 12.12

Topic Title: Run Natural Language Generation