{
  "openapi": "3.0.3",
  "info": {
    "title": "阿里云-自然语言处理",
    "description": "自然语言处理（NLP）是为各类企业及开发者提供的用于文本分析及挖掘的核心工具，已经广泛应用在电商、文化娱乐、金融、物流等行业客户的多项业务中。自然语言处理（NLP）可用于搭建内容搜索、内容推荐、舆情识别及分析、文本结构化、对话机器人等智能产品。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/1936-10": {
      "x-pointCode": 10,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-智能文本分类(电商领域)",
        "description": "对用户输入的一段文本，映射到具体的类目上。\n支持的类目体系可以是平层类目或者以树状形式组织的层次类目，系统内置两种默认分类体系：新闻资讯领域类目体系、电商领域类目体系。其中：\n新闻资讯分为15个类目（健康、观点、旅游、经济、房产、文娱、社会、国际、消费、从政、数码、汽车、教育、体育、防腐前沿）；\n电商领域类目为17个分类，（数码／科技、游戏、汽车/摩托车/电动车、穿搭／时尚、美容/个人护理、摄影、动漫/二次元、园艺、萌宠、母婴、旅游、家居／生活百货、美食、运动／户外、文娱/影视、星座、其他）。\n同时支持对用户输入的文本，识别出其中的关键词，并给出每个关键词的类别信息（产品词、品牌词、人物等）。关键词会根据文本所属的不同领域信息来进行抽取。目前支持新闻资讯领域和电商领域的关键词打标。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Data": {
                      "type": "string",
                      "description": "返回的结果字符串"
                    },
                    "RequestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "1936_10_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  },
                  "Text": {
                    "type": "string",
                    "description": "输入的文本"
                  }
                },
                "required": [
                  "ds_id",
                  "Text"
                ]
              }
            }
          }
        }
      }
    },
    "/1936-9": {
      "x-pointCode": 9,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-NLP自学习平台",
        "description": "NLP自学习平台，支持文本实体抽取、文本分类等NLP定制化算法能力，用户无需拥有丰富的算法背景，仅需标注或上传适量文档数据，即可通过平台快速创建算法模型并使用。\n本接口（PredictModel）用于获取nlp自学习模型产出的结果。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1936_9_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  },
                  "ModelId": {
                    "type": "string",
                    "description": "模型Id"
                  },
                  "Content": {
                    "type": "string",
                    "description": "预测内容"
                  },
                  "Version": {
                    "type": "string",
                    "description": "可以传入模型的版本号，例如V1、V2等，不传默认用最新版本"
                  },
                  "Action": {
                    "type": "string",
                    "description": "目前有四个Action值，详见https://help.aliyun.com/document_detail/145077.html?spm=a2c4g.145076.0.0.5deb6cf0BNrQvQ"
                  }
                },
                "required": [
                  "ds_id",
                  "ModelId",
                  "Content"
                ]
              }
            }
          }
        }
      }
    },
    "/1936-8": {
      "x-pointCode": 8,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-商品评价解析",
        "description": "商品评价解析主要用于分析消费者反馈的评价、点评内容，同时也可以对类似微博的口语化、短文本进行分析。对于长篇幅的新闻篇章不适用。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ali_ret": {
                              "type": "object",
                              "properties": {
                                "ali_ret": {
                                  "type": "object",
                                  "properties": {
                                    "aspectItem": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "aspectCategory": {
                                            "type": "string",
                                            "description": "属性类别"
                                          },
                                          "aspectIndex": {
                                            "type": "string",
                                            "description": "属性词所在的起始位置，终结位置"
                                          },
                                          "aspectTerm": {
                                            "type": "string",
                                            "description": "属性词"
                                          },
                                          "opinionTerm": {
                                            "type": "string",
                                            "description": "情感词"
                                          },
                                          "aspectPolarity": {
                                            "type": "string",
                                            "description": "属性片段极性（正、中、负）"
                                          }
                                        }
                                      },
                                      "description": "属性情感列表，每个元素是一个json字段"
                                    },
                                    "textPolarity": {
                                      "type": "string",
                                      "description": "整条文本情感极性：正、中、负，text字段输入非法时返回-100"
                                    },
                                    "textIntensity": {
                                      "type": "string",
                                      "description": "整条文本情感程度(取值范围[-1,1]，越大代表越正向，越小代表越负向，接近0代表中性)"
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1936_8_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "您的数据源ID，在showapi控制台=》接口使用者=》数据源授权管理中管理您的数据源"
                  },
                  "ServiceName": {
                    "type": "string",
                    "description": "ServiceName参数，详细见阿里云文档https://help.aliyun.com/document_detail/181178.html?spm=a2c4g.176959.0.0.2d815d7aoOTmEp"
                  },
                  "PredictContent": {
                    "type": "string",
                    "description": "PredictContent参数，是个JSON字符串，这里要求的格式为{\n    \"input\": {\n        \"content\": content,\n        \"domain\": domain,\n        \"entity\": True\n    }\n}\n，注意这里提交的是系列化后的JSON"
                  }
                },
                "required": [
                  "ds_id",
                  "ServiceName",
                  "PredictContent"
                ]
              }
            }
          }
        }
      }
    },
    "/1936-6": {
      "x-pointCode": 6,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-智能文本分类(新闻领域)",
        "description": "对用户输入的一段文本，映射到具体的类目上。\n\n支持的类目体系可以是平层类目或者以树状形式组织的层次类目，系统内置两种默认分类体系：新闻资讯领域类目体系、电商领域类目体系。其中：\n\n新闻资讯分为15个类目（健康、观点、旅游、经济、房产、文娱、社会、国际、消费、从政、数码、汽车、教育、体育、防腐前沿）；\n电商领域类目为17个分类，（数码／科技、游戏、汽车/摩托车/电动车、穿搭／时尚、美容/个人护理、摄影、动漫/二次元、园艺、萌宠、母婴、旅游、家居／生活百货、美食、运动／户外、文娱/影视、星座、其他）。\n同时支持对用户输入的文本，识别出其中的关键词，并给出每个关键词的类别信息（产品词、品牌词、人物等）。关键词会根据文本所属的不同领域信息来进行抽取。目前支持新闻资讯领域和电商领域的关键词打标。阿里云文档：https://help.aliyun.com/document_detail/179244.html?spm=a2c4g.179243.0.0.753453ceArJSpZ",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Data": {
                      "type": "string",
                      "description": "labelName: 类目名称"
                    },
                    "RequestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "1936_6_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "您的数据源ID，在showapi控制台=》接口使用者=》数据源授权管理中管理您的数据源"
                  },
                  "Text": {
                    "type": "string",
                    "description": "输入的文本"
                  }
                },
                "required": [
                  "ds_id",
                  "Text"
                ]
              }
            }
          }
        }
      }
    },
    "/1936-5": {
      "x-pointCode": 5,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-中心词提取",
        "description": "使用电商标题中心词以及类目进行训练，通过给每个词计算一个相关性分数来衡量每个词与句子的相关性程度，进而识别并提取出句子的中心词。\n适用于提取电商搜索query、标题及其他类似短文本（一般小于25个词）的中心词，目前仅提供电商领域中文中心词提取。详见文档：https://help.aliyun.com/document_detail/179228.html?spm=a2c4g.179229.0.0.352353cezFQfpN",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Data": {
                      "type": "string",
                      "description": "span：抽取的中心词\n\nlabel：固定为headword\n\nscore：是当前中心词的分数"
                    },
                    "RequestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "1936_5_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "您的数据源ID，在showapi控制台=》接口使用者=》数据源授权管理中管理您的数据源"
                  },
                  "Text": {
                    "type": "string",
                    "description": "待处理的文本，一般为句子，长度在128个字以内"
                  },
                  "ApiVersion": {
                    "type": "string",
                    "description": "固定值，仅有值等于\"v2\"时才返回2.0版本算法结果，否则返回1.0版本的算法结果"
                  }
                },
                "required": [
                  "ds_id",
                  "Text"
                ]
              }
            }
          }
        }
      }
    },
    "/1936-4": {
      "x-pointCode": 4,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-情感分析",
        "description": "针对带有主观描述的自然语言文本，可自动判断该文本的情感正负倾向并给出相应的结果。目前仅支持电商领域的商品评价情感正负倾向判断，通用版，阿里云文档：https://help.aliyun.com/document_detail/179345.html?spm=a2c4g.179344.0.0.343d4a85Kk58L3",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Data": {
                      "type": "string",
                      "description": "sentiment：句子情感极性，包含正面、负面、中性三种情况\n\npositive_prob：句子极性为正面的概率大小，0-1之间，保留4位小数\n\nnegative_prob：句子极性为负面的概率大小，0-1之间，保留4位小数"
                    },
                    "RequestId": {
                      "type": "string",
                      "description": "唯一请求id，排查问题的依据"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "1936_4_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "您的数据源ID，在showapi控制台=》接口使用者=》数据源授权管理中管理您的数据源"
                  },
                  "Text": {
                    "type": "string",
                    "description": "要分析的句子内容，长度不超过1000字"
                  }
                },
                "required": [
                  "ds_id",
                  "Text"
                ]
              }
            }
          }
        }
      }
    },
    "/1936-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-命名实体",
        "description": "命名实体识别（基础版）目前主要针对电商领域，识别品牌、产品、型号等，同时也包括一些通用领域实体如人名、地名、机构名、时间日期等。将传入接口的文本参数分成有意义的词,并给出每个词所属类别，阿里云文档https://help.aliyun.com/document_detail/177223.html?spm=a2c4g.177247.0.0.2bd63bf7t0xRS1",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Data": {
                      "type": "string",
                      "description": "synonym：近义词\n\nweight：实体类型权重\n\ntag：实体类型\n\nword：实体词"
                    },
                    "RequestId": {
                      "type": "string",
                      "description": "唯一请求id，排查问题的依据"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "1936_3_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "您的数据源ID，在showapi控制台=》接口使用者=》数据源授权管理中管理您的数据源"
                  },
                  "Text": {
                    "type": "string",
                    "description": "需要分析的文本，最大长度1024个字符"
                  },
                  "LexerId": {
                    "type": "string",
                    "description": "\t\n模型类型，默认为ECOM"
                  }
                },
                "required": [
                  "ds_id",
                  "Text"
                ]
              }
            }
          }
        }
      }
    },
    "/1936-2": {
      "x-pointCode": 2,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-词性标注",
        "description": "通过自然语言处理组件的词性标注API，可以为自然语言文本中的每个词汇赋予一个词性。阿里云文档https://help.aliyun.com/document_detail/177225.html?spm=a2c4g.392278.0.0.339f66d9Rquhsj",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Data": {
                      "type": "string",
                      "description": "pos：词性\n\nword：词"
                    },
                    "RequestId": {
                      "type": "string",
                      "description": "唯一请求id，排查问题的依据"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "1936_2_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "您的数据源ID，在showapi控制台=》接口使用者=》数据源授权管理中管理您的数据源"
                  },
                  "Text": {
                    "type": "string",
                    "description": "需要分析的文本，最大长度1024个字符"
                  },
                  "TokenizerId": {
                    "type": "string",
                    "description": "GENERAL_CHN"
                  },
                  "OutType": {
                    "type": "number",
                    "description": "0：大粒度，1：中粒度（默认），2：小粒度"
                  }
                },
                "required": [
                  "ds_id",
                  "Text"
                ]
              }
            }
          }
        }
      }
    },
    "/1936-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自然语言处理-多语言分词",
        "description": "通过自然语言处理组件的分词API，可以将连续的自然语言文本，切分成具有语义合理性和完整性的词汇序列。阿里云文档：https://help.aliyun.com/document_detail/177222.html?spm=a2c4g.179124.0.0.4eb040cfFDpJ04",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Data": {
                      "type": "string",
                      "description": "output：输出结果\n\nsentence：原始输入的句子\n\nwords：分词后结果表\n\nsyllables：分音节后结果表"
                    },
                    "RequestId": {
                      "type": "string",
                      "description": "唯一请求id，排查问题的依据"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "1936_1_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "您的数据源ID，在showapi控制台=》接口使用者=》数据源授权管理中管理您的数据源"
                  },
                  "Language": {
                    "type": "string",
                    "description": "语种代码如下\n\n越南语：vi\n\n印尼语：id\n\n泰语：th\n\n马来语：ms\n\n英语：en"
                  },
                  "Text": {
                    "type": "string",
                    "description": "要处理的文本"
                  },
                  "ServiceCode": {
                    "type": "string"
                  }
                },
                "required": [
                  "ds_id",
                  "Text",
                  "ServiceCode"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/1936?tab=book"
  },
  "x-apiCode": "1936",
  "x-is-own": false,
  "x-is-op": true
}