简历抽取(英文)服务
简历抽取服务使用示例。
本预训练模型提供的服务无需自主标注训练,直接调用API即可使用;
服务开通与资源包购买
预训练模型使用前,请确认是否已经开通了NLP自学习平台服务,开通后可购买优惠资源包。
NLP自学习平台:开通地址
自学习平台资源包:购买地址
调试
您可以在OpenAPI开发者门户中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI开发者门户可以自动生成SDK代码示例。
说明
调用简历抽取(英文)服务,ServiceName需要传入:ResumeExtractorEN
Java代码示例
DefaultProfile defaultProfile = DefaultProfile.getProfile("cn-hangzhou","your-access-key-id","your-access-key-secret");
IAcsClient client = new DefaultAcsClient(defaultProfile);
String content = "Resume Text";
RunPreTrainServiceRequest request = new RunPreTrainServiceRequest();
request.setServiceName("ResumeExtractorEN");
request.setPredictContent(content);
RunPreTrainServiceResponse response = client.getAcsResponse(request);
System.out.println(response.getPredictResult());
Python代码示例
# 安装依赖
pip install aliyun-python-sdk-core
pip install aliyun-python-sdk-nlp-automl
# -*- coding: utf8 -*-
import json
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdknlp_automl.request.v20191111 import RunPreTrainServiceRequest
# Initialize AcsClient instance
client = AcsClient(
"<your-access-key-id>",
"<your-access-key-secret>",
"cn-hangzhou"
);
content = 'Resume Text'
# Initialize a request and set parameters
request = RunPreTrainServiceRequest.RunPreTrainServiceRequest()
request.set_ServiceName('ResumeExtractorEN')
request.set_PredictContent(content)
# Print response
response = client.do_action_with_exception(request)
resp_obj = json.loads(response)
predict_result = json.loads(resp_obj['PredictResult'])
print(predict_result['result'])
PredictContent内容示例
PredictContent参数为简历文本参数。
John Smith
john.*****@example.com / +852 1111 1234
Unit 111, Tower 6A, Century Link, 6 Nanking Street, Tung Chung, Lantau Island, Hong Kong
EMPLOYMENT HISTORY
Aurostyle Limited (International Division, Christian Bernard Group), Hong Kong
June 2010 – December 2012
Marketing Manager
o Oversaw marketing activities in the International office of a French jewellery group.
o Worked closely with global marketing team and regional sales team to ensure qualitative
marketing collaterals, trade marketing tools and premiums can be delivered or localized
for POS promotions in international regions including China, Middle East and North
America.
o Drove and contributed to the launch of the jewellery line by French fashion houses, Guy
Laroche and Cacharel, in international regions by leading POS activations, localizing trade
marketing materials and conducting frontline staff trainings.
Waddy Jewellery Group Limited
June 2007 – June 2010
Marketing Executive
Marketing Manager
o Oversaw marketing activities in a fine jewellery manufacturer.
o Responsible for the development and maintenance of marketing collaterals, visual
merchandising tools, corporate website and company newsletters
o Successfully facilitated company’s participation in over 50 international tradeshows.
EDUCATION
The Hong Kong Polytechnic University, Hong Kong
2002 - 2004
Masters of Science, Marketing Management
University of British Columbia, Canada
1996 - 2000
Honours Bachelor of Arts, African Studies
PredictResult内容示例
PredictResult是JSON字符串,需要反序列化之后进行解析,具体结构如下示例。
{
"result": "{\"Schools\": [{\"School\": \"The Hong Kong Polytechnic University\", \"Degree\": null, \"StartDate\": \"2002-1-1\", \"EndDate\": \"2004-1-1\", \"DegreeCode\": null, \"SchoolDuration\": \"2002 - 2004\"}, {\"School\": \"University of British Columbia\", \"Degree\": \"Masters\", \"StartDate\": \"2000-3-1\", \"EndDate\": null, \"DegreeCode\": \"master\", \"SchoolDuration\": \", Mar\"}, {\"School\": \"University of British Columbia\", \"Degree\": \"Masters\", \"StartDate\": \"2000-3-1\", \"EndDate\": null, \"DegreeCode\": \"master\", \"SchoolDuration\": \", Mar\"}], \"Name\": \"John Smith\", \"Lang\": \"en\", \"Phone\": \"+852 1111 1234\", \"CountryCode\": \"852\", \"RegionalPhone\": \"11111234\", \"FamilyName\": \"Smith\", \"GivenName\": \"John\", \"City\": \"Hong Kong\", \"Email\": \"john.*****@example.com\", \"Companies\": [{\"Position\": null, \"EndDate\": \"2012-12-1\", \"Company\": \"Aurostyle Limited\", \"StartDate\": \"2010-6-1\", \"CompanyDuration\": \"June 2010 \u2013 December 2012\"}, {\"Position\": null, \"EndDate\": \"2010-6-1\", \"Company\": \"Waddy Jewellery Group Limited\", \"StartDate\": \"2007-6-1\", \"CompanyDuration\": \"June 2007 \u2013 June 2010\"}]}",
"time": 128,
"message": "",
"ret_code": 0
}
出参result是一个JSON字符串,是一个JsonArray结构,具体结构如下所示。
{
"Schools": [{
"School": "The Hong Kong Polytechnic University",
"StartDate": "2002-1-1",
"EndDate": "2004-1-1",
"SchoolDuration": "2002 - 2004"
}, {
"School": "University of British Columbia",
"Degree": "Masters",
"StartDate": "2000-3-1",
"DegreeCode": "master",
"SchoolDuration": ", Mar"
}, {
"School": "University of British Columbia",
"Degree": "Masters",
"StartDate": "2000-3-1",
"DegreeCode": "master",
"SchoolDuration": ", Mar"
}],
"Name": "John Smith",
"Lang": "en",
"Phone": "+852 1111 1234",
"CountryCode": "852",
"RegionalPhone": "11111234",
"FamilyName": "Smith",
"GivenName": "John",
"City": "Hong Kong",
"Email": "john.*****@example.com",
"Companies": [{
"Position": null,
"EndDate": "2012-12-1",
"Company": "Aurostyle Limited",
"StartDate": "2010-6-1",
"CompanyDuration": "June 2010 \u2013 December 2012"
}, {
"Position": null,
"EndDate": "2010-6-1",
"Company": "Waddy Jewellery Group Limited",
"StartDate": "2007-6-1",
"CompanyDuration": "June 2007 \u2013 June 2010"
}]
}
支持字段列表
字段名 | 描述 |
Name | 姓名 |
邮箱 | |
Phone | 联系方式 |
Address | 地址 |
School | 学校 |
Degree | 学位 |
SchoolDuration | 入学就读时间范围 |
Company | 公司 |
Position | 职位 |
CompanyDuration | 公司就职时间范围 |