View a markdown version of this page

Start an ontology induction - AWS Context

Start an ontology induction

When you start an induction, AWS Context checks your request and then runs the induction in the background. The request returns at once, and a new induction has the status INDUCING. The new ontology doesn’t exist until the induction succeeds.

You can start an induction on the AWS Context console or with the API. Before you start, prepare your inputs. For more information about how to prepare them, see Choose documents, a template ontology, and a prompt.

On the console, a wizard collects your inputs in three steps: Ontology details, Additional requirements, and Review and generate.

To start an ontology induction on the console, follow these steps:

  1. On the Ontologies page, choose Create ontology.

  2. On the Ontology details step, enter a name for the new ontology and, optionally, a description.

  3. Under Ontology files, upload your documents.

  4. (Optional) To extend an existing ontology, under Additional settings, choose a Template ontology.

  5. (Optional) On the Additional requirements step, enter a prompt in Requirements.

  6. On the Review and generate step, check your choices.

  7. Choose Generate ontology.

The induction starts, and its status is Inducing. To follow it, see Monitor an ontology induction.

On the Ontology details step, you can also add tags. The console applies the same tags to the induction and to the new ontology.

Start an ontology induction with the API

To start an induction with the API, call StartOntologyInduction. Send a name for the new ontology (ontologyName), your documents (inputConfig.documents), and a client token (clientToken). All three are required. A template ontology (seedOntologyId) and a prompt (prompt) are optional. The response has the induction’s ID (ontologyInductionId), its ARN, and its status, which is INDUCING for a new induction.

The following example shows the inputs for starting an induction with StartOntologyInduction. It isn’t a complete request. Replace the values in angle brackets with your own values.

StartOntologyInduction ontologyName: Claims ontology inputConfig: documents: - name: claims-handling-policy.pdf contentType: PDF content: <the bytes of the document> - name: claims-glossary.md contentType: MARKDOWN content: <the bytes of the document> seedOntologyId: <optional: the ID or ARN of a published custom ontology> prompt: Focus on claims, policies, and the parties to a claim. clientToken: <a unique token for this request>

StartOntologyInduction request fields

The following table describes each field in the request.

Field Description and rules

ontologyName

Required. The name of the new ontology, 1 to 128 characters. It can’t start or end with a space or another blank or invisible character, and it can’t contain control characters.

ontologyDescription

Optional. A description of the new ontology, up to 1,024 characters. It can’t contain control characters, such as tabs or line breaks.

inputConfig.documents

Required. Your documents, 1 to 100. Each document has a name, a content type (contentType), and its content. The content type is PDF, TXT, MARKDOWN, CSV, JSON, YAML, DOC, DOCX, or HTML, and the bytes must be a real document of that type. For information about the rules for each type, see Choose documents.

Give each document a name that is different from the others. AWS Context removes leading and trailing spaces before it compares names. If you give a name of only spaces, AWS Context counts it as the name document. Don’t use . or .. as a name, even with spaces around it, and don’t use /, \, control characters, or unpaired surrogates (U+D800 to U+DFFF) in a name. For information about the size limits, see Input limits.

seedOntologyId

Optional. The ID or ARN of the template ontology. For information about the rules, see Choose a template ontology (optional).

prompt

Optional. The prompt, 1 to 8,000 characters.

tags and ontologyTags

Optional. tags apply to the induction, and ontologyTags apply to the new ontology. You can set them separately.

clientToken

Required. A request without a token fails with a ValidationException. The token makes the request safe to retry. If you repeat the same request with the same token within 8 hours, AWS Context returns the same induction. It doesn’t start a second one. A different request with the same token fails with a ValidationException. To induce again from the same documents, use a new token.

AWS Context has a quota for how many inductions an account can have in progress at the same time. When you reach the quota, StartOntologyInduction fails with a ServiceQuotaExceededException. Start the induction again when one of your other inductions ends. Inductions in progress also count toward the number of ontologies that an account can have. When the ontologies and the inductions in progress together reach that quota, StartOntologyInduction fails with a ServiceQuotaExceededException whose resource type is ontology. For information about what to do, see An induction doesn’t start.