Skip to content

Latest commit

 

History

History
74 lines (59 loc) · 2.78 KB

custom-ent-rel.md

File metadata and controls

74 lines (59 loc) · 2.78 KB
copyright lastupdated subcollection
years
2015, 2021
2021-02-12
natural-language-understanding

{:shortdesc: .shortdesc} {:external: target="_blank" .external} {:tip: .tip} {:note: .note} {:beta: .beta} {:pre: .pre} {:important: .important} {:codeblock: .codeblock} {:screen: .screen} {:javascript: .ph data-hd-programlang='javascript'} {:java: .ph data-hd-programlang='java'} {:python: .ph data-hd-programlang='python'} {:swift: .ph data-hd-programlang='swift'}

Creating custom entities and relations models

{: #entities-and-relations}

The {{site.data.keyword.nlushort}} Free plan limits the size and performance of your custom model. To test a custom model to its full extent, use it with the {{site.data.keyword.nlushort}} Standard plan. {: shortdesc}

  1. Get started with {{site.data.keyword.knowledgestudioshort}}.

  2. Create a custom model.

    1. To create a custom entities and relations model, see Creating a machine learning model
    2. You can also create a custom entities model with a rule-based model. See Creating a rule-based model for details.
  3. Deploy your model to {{site.data.keyword.nlushort}}

  4. To use your model, specify the model that you deployed in the entities{: external} or relations{: external} options of your API request:

    • Example parameters.json file:

      {
        "url": "www.url.example",
        "features": {
          "entities": {
            "model": "your-model-id-here"
          },
          "relations": {
            "model": "your-model-id-here"
          }
        }
      }
    • Example curl request:

      curl --user "apikey":"{apikey}" \
      "{url}/v1/analyze?version={date}" \
      --request POST \
      --header "Content-Type: application/json" \
      --data @parameters.json

Deleting custom entities and relations models

{: #deleting-a-custom-model}

To delete an entities or relations model from your service instance, use the Delete model method. Replace {url} and {apikey} with your service URL and API key, and replace {model_id} with the model ID of the model you want to delete.

  • The following example undeploys an entities or relations model.

    curl --user "apikey":"{apikey}" "{url}/v1/models/{model_id}?version={date}"
    --request DELETE