介绍
虽然GPT-3已经发布了很长一段时间,因为它在编写类似人类的故事和诗歌方面的卓越能力而受到广泛关注,但我从来没有想到它附带的API能够为构建具有广泛应用程序的数据产品提供如此大的灵活性和方便性。
在本文中,我试图探索一些与我在就业市场中看到的问题相关的用例,并试图理解构建基于语言的数据产品在未来可能只是围绕着“即时工程”。
与此同时,本文并不试图解释GPT-3是如何工作的,也不试图解释它如何能够完成它正在做的事情。关于这些话题的更多细节已经在Jay Alammar[1]和Max Woolf[2]等文章中写得很详细。GPT-3论文本身可以在[3]中引用。
在GPT-3的API中,' prompt '是提供给API的一个参数,以便它能够识别要解决的问题的上下文。根据提示的编写方式,返回的文本将尝试匹配相应的模式[4]。
下面是一个提示的例子,我们试图通过编程API来在银行部门的范围内提供答案。“Q:”和“A:”格式,连同问题文本和它的回答,提示模型,我们正在寻找的存在于银行领域(或至少,这是我如何理解它:))
defcall_openapi(question): response=openai.Completion.create( engine="davinci", prompt="""This is a banking expert.Q: What is interest rate?A: The interest rate is the amount a lender charges for the use of assets expressed as a percentage of the principal.Q: What is PD?A: Probability of default.Q: {question}?A:""".format(question=question), temperature=0.3, max_tokens=60, top_p=1.0, frequency_penalty=0.0, presence_penalty=0.0, stop=["\n"] ) returnresponse
一旦设置了提示,我们现在就可以自由发送我们的文本(或问题,如果你愿意的话)。
如上所述,我们可以看到我们得到的回答确实听起来合理(如果不是一个准确的答案本身)。
关于如何配置提示的其他创造性方法,请参阅其GPT-3 API页面[5]的示例部分。或者,您也可以参考我的代码来检查文本分类和产品命名任务的提示示例。
回到我们的议程,让我们看一下可以应用GPT-3的就业市场领域的一些现有用例。
免责声明:虽然我以前在一个工作网站公司工作过,但我并没有直接参与下面提到的大多数用例。因此,在现实生活中,所演示的问题的解决方案可能与我解决它的方式完全不同。这意味着我的解决方法可能存在明显的漏洞。
案例1:工作的分类匹配
问题
客户提供的招聘广告。(雇主),我们(作为工作市场)想要帮助他们快速分类他们的广告到正确的工作类别,从而帮助工作广告在稍后的工作门户发现。
虽然这个问题可能由我们的客户/客户经理(即。我们帮助我们的客户填写表单),这种方法(由我们的客户自己或客户经理填写表单)经常容易出错,而且从长远来看无法扩展(更不用说,归因于错误的数据收集)。
解决方案
根据职位标题和描述,我们尝试根据根据配置的提示出现的单词的可能性来推断职位类别。
我们通过GPT-3来提示职位名称、描述和类别是什么样子的。我们将保留最后一个作业专业为空,作为一种向API发出信号的方式,表明这是它接下来需要填充的位置。' ### '关键字被定义为该配置中的停止字符。
defcall_openapi(title, desc): response=openai.Completion.create( engine="davinci", prompt="""This is a job specialization classifierJob title: Account ExecutiveJob description: Handle full set of accounts.\nFamiliar with Income Tax filing.\nMaintain daily cash flow and reporting.\nPrepare monthly and annual financial reports.\nMaintain proper records of all accounting transactions.\nPerform general administrative and other accounting duties from time to time.Job specialization: Accounting/Finance###Job title: Senior Accounts ExecutiveJob description: To handle a full set of Accounts.\nTo be responsible for monthly closing of accounts with relevant supporting schedules in an accurate and timely manner.\nPreparation of any financial ad-hoc reports.\nReviewing all invoices and payment instructions and preparing creditors’ payment for payment processing.\nTo prepare invoices for approval by the relevant Head of Department.\nTo ensure that the Account Payable records are updated accurately and timely for management reporting purposes.\nTo review and process staff claims.\nLiaison with Auditors, Company Secretary, Tax Agent and Bank OfficersJob specialization: Accounting/Finance###Job title: Account ExecutiveJob description: Compiling and analyzing data to find trends.\nDeveloping sales strategies and setting quotas.\nStaying current on company offerings and industry trends.\nMaintaining a database of contact information.\nBuilding long-lasting, mutually beneficial relationships with external contacts and internal departments to create a better customer experience.Job specialization: Sales/Marketing###Job title: Sales Consultant (General)Job description: Develop and formulate strategic and tactical plans in a sizeable market portfolio. Ensure KPI and goals of the assigned accounts are met.\nBuild market position by identifying potential business deals and close relationship with existing and new customers;\nDevelop and formulate strategies to acquire new business.\nProvide and screen data/information for potential business deals by analysing market strategy, examining risks and financial accuracy for business decision making;\nGrow account depth and breadth\nDevelop Account plans for all KPI customers.\nAccountable on driving every opportunity to closure with a close plan.\nKeeping track of all post sales activities with daily sales report.Job specialization: Sales/Marketing###Job title: {job_title}Job description: {job_desc}Job specialization:""".format(job_title=job_title, job_desc=job_desc), temperature=0.3, max_tokens=60, top_p=1.0, frequency_penalty=0.0, presence_penalty=0.0, stop=["###"] ) returnresponsedefextract_ans(response): returnprint('Job specialization: ', response.choices[0].text.partition('\n')[0])