摘要:昨天的Demo以txt文件为例进行说明,并且评估标准写死了,跟真实的简历评估系统差别太大了。今天分享的是经过改进后更加真实的基于LLM的简历评估系统。
昨天的Demo以txt文件为例进行说明,并且评估标准写死了,跟真实的简历评估系统差别太大了。今天分享的是经过改进后更加真实的基于LLM的简历评估系统。
使用AI生成了5份不同的简历,如下所示:
程序员A:
程序员B:
程序员C:
程序员D:
程序员E:
输入要求:
shared["requirements"] = """- 具备前端开发能力
- 使用过Vue
""";
效果:
更改要求:
shared["requirements"] = """- 具备后端开发能力
- 熟悉go语言
""";
全部代码已上传至GitHub,地址:https://github.com/Ming-jiayou/PocketFlowSharp/tree/main/PocketFlowSharpSamples.Console/Real_Resume_Qualification_Demo
项目简介:使用 C# 读取和提取 PDF 中的文本和其他内容(PDFBox 的移植)
修改Utils类,增加读取PDF内容功能:
public static string ExtractTextFromPdf(string pdfPath){
StringBuilder text = new StringBuilder;
using (PdfDocument document = PdfDocument.Open(pdfPath))
{
foreach (Page page in document.GetPages)
{
text.AppendLine(page.Text);
}
}
return text.ToString;
}
效果如下所示:
可以将要求存入共享内存,然后通过$插值字符串,插入到提示词中即可:
string prompt = $@"评估以下简历并确定候选人是否符合职位的要求。
资格标准:
{requirements}
简历内容:
{content}
请以YAML格式返回您的评估:
```yaml
candidate_name: [候选人姓名]
qualifies: [true/false]
reasons:
- [资格认定/不认定的第一个原因]
- [第二个原因(如果适用)]
```
";
运行时就会变成这样:
publicstaticstring EndPoint { get; set; }
publicstaticstring ApiKey { get; set; }
public static stringCallLLM(string prompt)
{
ApiKeyCredential apiKeyCredential = new ApiKeyCredential(ApiKey);
OpenAIClientOptions openAIClientOptions = new OpenAIClientOptions;
openAIClientOptions.Endpoint = new Uri(EndPoint);
ChatClient client = new(model: ModelName, apiKeyCredential, openAIClientOptions);
ChatCompletion completion = client.CompleteChat(prompt);
return completion.Content[0].Text;
}
以上就是通过这个Demo可以学习到的一些内容。
来源:opendotnet
免责声明:本站系转载,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权和其它问题,请在30日内与本站联系,我们将在第一时间删除内容!