招中标公告类型分类服务

招中标公告类型分类服务示例:

说明 适用于作为招标解析服务(高级版)、中标解析服务(高级版)的前处理步骤。

Java代码示例

  1. DefaultProfile defaultProfile = DefaultProfile.getProfile("cn-hangzhou","your-access-key-id","your-access-key-secret");
  2. IAcsClient client = new DefaultAcsClient(defaultProfile);
  3. String content = "牡丹江市阳明区2021年高标准农田建设项目勘察设计(一标段)中标候选人公示";
  4. RunPreTrainServiceRequest request = new RunPreTrainServiceRequest();
  5. request.setServiceName("classify-type-bid");
  6. request.setPredictContent(content);
  7. RunPreTrainServiceResponse response = client.getAcsResponse(request);
  8. System.out.println(response.getPredictResult());

Python代码示例

  1. # 安装依赖
  2. pip install aliyun-python-sdk-core
  3. pip install aliyun-python-sdk-nlp-automl
  1. # -*- coding: utf8 -*-
  2. import json
  3. from aliyunsdkcore.client import AcsClient
  4. from aliyunsdkcore.acs_exception.exceptions import ClientException
  5. from aliyunsdkcore.acs_exception.exceptions import ServerException
  6. from aliyunsdknlp_automl.request.v20191111 import RunPreTrainServiceRequest
  7. # Initialize AcsClient instance
  8. client = AcsClient(
  9. "<your-access-key-id>",
  10. "<your-access-key-secret>",
  11. "cn-hangzhou"
  12. );
  13. content = '牡丹江市阳明区2021年高标准农田建设项目勘察设计(一标段)中标候选人公示'
  14. # Initialize a request and set parameters
  15. request = RunPreTrainServiceRequest.RunPreTrainServiceRequest()
  16. request.set_ServiceName('classify-type-bid')
  17. request.set_PredictContent(content)
  18. # Print response
  19. response = client.do_action_with_exception(request)
  20. resp_obj = json.loads(response)
  21. predict_result = json.loads(resp_obj['PredictResult'])
  22. print(predict_result)
说明 调用招中标公告类型分类服务,ServiceName需要传入:classify-type-bid
说明 PredictResult是JSON字符串,需要反序列化之后进行解析

返回结果示例:

  1. {
  2. "type": [
  3. [
  4. {
  5. "score": 0.922555685043335,
  6. "key": "中标"
  7. },
  8. {
  9. "score": 0.08074402064085007,
  10. "key": "招标"
  11. }
  12. ]
  13. ]
  14. }

抽取字段及说明

字段名 说明
type
key 公告类型,当前只有“招标”,“中标”两种
score 对应公告类型的概率大小,数值范围[0,1]