-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add CV parser example #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| from openai import OpenAI | ||
|
|
||
| from gimkit import from_openai | ||
| from gimkit import guide as g | ||
|
|
||
|
|
||
| client = OpenAI( | ||
| api_key="***", | ||
| base_url="https://openrouter.ai/api/v1", | ||
| ) | ||
|
Comment on lines
+7
to
+10
|
||
| model = from_openai(client, model_name="qwen/qwen3-235b-a22b") | ||
|
|
||
| cv_content = "" | ||
|
||
| extraction_fields = f''' | ||
| {{ | ||
| "name": "{g.person_name()}", | ||
| "birthDay": "{g.datetime(require_time=False)}", | ||
| "phone": "{g.phone_number()}", | ||
| "email": "{g.e_mail()}", | ||
| "paperCount": "{g()}", | ||
| "ccfACount": "{g()}", | ||
| "scholarship": "{g()}", | ||
| "competitionAward": "{g()}", | ||
| "honors": "{g()}", | ||
| "homepageUrl": "{g()}", | ||
| "googleScholarUrl": "{g()}", | ||
| "githubUrl": "{g()}", | ||
| "citationCount": "{g()}", | ||
| "hIndex": "{g()}", | ||
| "talentEducationalParamList": [ | ||
| {{ | ||
| "degreeLevel": "{g.select(choices=["BACHELOR", "MASTER", "DOCTOR"])}", | ||
| "school": "{g()}", | ||
| "department": "{g()}", | ||
| "major": "{g()}", | ||
| "advisor": "{g()}", | ||
| "advisorTitles": "{g()}", | ||
| "lab": "{g()}", | ||
| "researchDirection": "{g()}", | ||
| "startDate": "{g.datetime(require_time=False)}", | ||
| "endDate": "{g.datetime(require_time=False)}", | ||
| }}, | ||
| {{ | ||
| "degreeLevel": "{g.select(choices=["BACHELOR", "MASTER", "DOCTOR"])}", | ||
| "school": "{g()}", | ||
| "department": "{g()}", | ||
| "major": "{g()}", | ||
| "advisor": "{g()}", | ||
| "advisorTitles": "{g()}", | ||
| "lab": "{g()}", | ||
| "researchDirection": "{g()}", | ||
| "startDate": "{g.datetime(require_time=False)}", | ||
| "endDate": "{g.datetime(require_time=False)}", | ||
| }}, | ||
| {{ | ||
| "degreeLevel": "{g.select(choices=["BACHELOR", "MASTER", "DOCTOR"])}", | ||
| "school": "{g()}", | ||
| "department": "{g()}", | ||
| "major": "{g()}", | ||
| "advisor": "{g()}", | ||
| "advisorTitles": "{g()}", | ||
| "lab": "{g()}", | ||
| "researchDirection": "{g()}", | ||
| "startDate": "{g.datetime(require_time=False)}", | ||
| "endDate": "{g.datetime(require_time=False)}", | ||
| }} | ||
| ] | ||
| }}''' | ||
|
|
||
| result = model(cv_content + extraction_fields, output_type="json", use_gim_prompt=True) | ||
| print(result) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example lacks documentation explaining its purpose and usage. Consider adding:
Other examples in the repository (e.g.,
examples/gimkit_quickstart.py) include helpful section headers and comments that guide users through the code.