All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::NLPAUTOML::Model

更新時間:Jul 05, 2023

ALIYUN::NLPAUTOML::Model is used to create a model.

Syntax

{
  "Type": "ALIYUN::NLPAUTOML::Model",
  "Properties": {
    "DatasetIdList": List,
    "ModelName": String,
    "TestDatasetIdList": List,
    "Nepochs": String,
    "Lr": String,
    "ProjectId": Integer,
    "ModelType": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DatasetIdList

List

Yes

Yes

The IDs of the datasets that you want to upload.

The datasets must meet the following requirements:

  • The datasets must belong to the same project.

  • The datasets are in the online state.

  • The total number of labeled data entries contained in the datasets must be greater than or equal to four.

ModelName

String

Yes

No

The name of the model.

None.

TestDatasetIdList

List

No

Yes

The IDs of the test datasets.

Separate multiple IDs by commas (,).

Note

You can add test datasets to specific models of the text classification type.

Nepochs

String

No

No

The number of iterations of the training dataset.

None.

Lr

String

No

No

The learning rate of the model.

None.

ProjectId

Integer

Yes

No

The project ID.

None.

ModelType

String

Yes

No

The model type.

Valid values:

  • NLP-NER-Chinese

  • NLP-NER-BERT

  • NLP-NER-English

  • NLP-TextCategory-ensemble

  • NLP-TextCategory-CNN2

  • NLP-TextCategory-FT

  • NLP-TextCategory-SA

  • NLP-TextCategory-STC

  • classification_bert

  • NLP-Keyphrase-textrank

  • NLP-RE-PCNN

  • NLP-RelationClassficiation-BERT

  • NLP-RE-BERT-NOISE

  • structbert_matching

  • NLP-TextCategory-CNN2

  • classification_cnn

  • NLP-Resume-Chinese

  • NLP-Resume-Pretrain-Chinese

  • NLP-Resume-Pretrain-English

Return values

Fn::GetAtt

  • ModelVersion: the version of the model.

  • ModelId: the model ID.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DatasetIdList:
    Type: Json
    Description: The uploaded dataset must be under the same project, and the total number of marked data is greater than or equal to 4.
    MinLength: 1
    MaxLength: 20
    Default:
      - '1212'
      - '1211'
  ModelName:
    Type: String
    Description: The name of model.
    Default: test
  ProjectId:
    Type: Number
    Description: The project id to which the model belongs
    Default: '123123'
  ModelType:
    Type: String
    Description: |-
      The type of model. Please refer to the documentation for the parameter values corresponding to different types of models.
      Using the specified model type under different project, and the backend will do the verification. If the model type does not exist under the project, it will prompt that the base model is not found
    AllowedValues:
      - NLP-NER-Chinese
      - NLP-NER-BERT
      - NLP-NER-English
      - NLP-TextCategory-ensemble
      - NLP-TextCategory-CNN2
      - NLP-TextCategory-FT
      - NLP-TextCategory-SA
      - NLP-TextCategory-STC
      - classification_bert
      - NLP-Keyphrase-textrank
      - NLP-RE-PCNN
      - NLP-RelationClassficiation-BERT
      - NLP-RE-BERT-NOISE
      - structbert_matching
      - NLP-TextCategory-CNN2
      - classification_cnn
      - NLP-Resume-Chinese
      - NLP-Resume-Pretrain-Chinese
      - NLP-Resume-Pretrain-English
    Default: NLP-NER-Chinese
Resources:
  Model:
    Type: ALIYUN::NLPAUTOML::Model
    Properties:
      DatasetIdList:
        Ref: DatasetIdList
      ModelName:
        Ref: ModelName
      ProjectId:
        Ref: ProjectId
      ModelType:
        Ref: ModelType
Outputs:
  ModelVersion:
    Description: The version of model.
    Value:
      Fn::GetAtt:
        - Model
        - ModelVersion
  ModelId:
    Description: The ID of model.
    Value:
      Fn::GetAtt:
        - Model
        - ModelId

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DatasetIdList": {
      "Type": "Json",
      "Description": "The uploaded dataset must be under the same project, and the total number of marked data is greater than or equal to 4.",
      "MinLength": 1,
      "MaxLength": 20,
      "Default": [
        "1212",
        "1211"
      ]
    },
    "ModelName": {
      "Type": "String",
      "Description": "The name of model.",
      "Default": "test"
    },
    "ProjectId": {
      "Type": "Number",
      "Description": "The project id to which the model belongs",
      "Default": "123123"
    },
    "ModelType": {
      "Type": "String",
      "Description": "The type of model. Please refer to the documentation for the parameter values corresponding to different types of models.\nUsing the specified model type under different project, and the backend will do the verification. If the model type does not exist under the project, it will prompt that the base model is not found",
      "AllowedValues": [
        "NLP-NER-Chinese",
        "NLP-NER-BERT",
        "NLP-NER-English",
        "NLP-TextCategory-ensemble",
        "NLP-TextCategory-CNN2",
        "NLP-TextCategory-FT",
        "NLP-TextCategory-SA",
        "NLP-TextCategory-STC",
        "classification_bert",
        "NLP-Keyphrase-textrank",
        "NLP-RE-PCNN",
        "NLP-RelationClassficiation-BERT",
        "NLP-RE-BERT-NOISE",
        "structbert_matching",
        "NLP-TextCategory-CNN2",
        "classification_cnn",
        "NLP-Resume-Chinese",
        "NLP-Resume-Pretrain-Chinese",
        "NLP-Resume-Pretrain-English"
      ],
      "Default": "NLP-NER-Chinese"
    }
  },
  "Resources": {
    "Model": {
      "Type": "ALIYUN::NLPAUTOML::Model",
      "Properties": {
        "DatasetIdList": {
          "Ref": "DatasetIdList"
        },
        "ModelName": {
          "Ref": "ModelName"
        },
        "ProjectId": {
          "Ref": "ProjectId"
        },
        "ModelType": {
          "Ref": "ModelType"
        }
      }
    }
  },
  "Outputs": {
    "ModelVersion": {
      "Description": "The version of model.",
      "Value": {
        "Fn::GetAtt": [
          "Model",
          "ModelVersion"
        ]
      }
    },
    "ModelId": {
      "Description": "The ID of model.",
      "Value": {
        "Fn::GetAtt": [
          "Model",
          "ModelId"
        ]
      }
    }
  }
}