Answer Server 23.2

# 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 2016-2023 Open Text
Version 23.2 | Last updated March 2023

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 23.2

Topic Title: Run Natural Language Generation