全部产品
Search
文档中心

资源编排:ALIYUN::NLPAUTOML::Model

更新时间:Jun 02, 2023

ALIYUN::NLPAUTOML::Model类型用于创建模型。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

DatasetIdList

List

数据集ID列表。

上传数据集需满足以下条件:

  • 必须在同一项目下。

  • 已上线状态。

  • 已标注数据总数大于等于4条。

ModelName

String

模型名称。

TestDatasetIdList

List

测试集ID列表。

多个ID用半角逗号分隔。

说明

文本分类下部分模型支持添加测试集数据。

Nepochs

String

训练数据集迭代次数。

Lr

String

学习率,模型算法指标。

ProjectId

Integer

项目ID。

ModelType

String

模型类型。

取值:

  • 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

返回值

Fn::GetAtt

  • ModelVersion:模型迭代版本

  • ModelId:模型组ID

示例

YAML格式

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格式

{
  "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"
        ]
      }
    }
  }
}