|
| 1 | +from dingo.model.model import Model |
| 2 | +from dingo.model.prompt.base import BasePrompt |
| 3 | + |
| 4 | + |
| 5 | +@Model.prompt_register("RESUME_QUALITY_ZH", [], ['LLMResumeQuality']) |
| 6 | +class PromptResumeQualityZh(BasePrompt): |
| 7 | + """Chinese prompt for resume quality evaluation.""" |
| 8 | + |
| 9 | + _metric_info = { |
| 10 | + "category": "Resume Quality Assessment Metrics", |
| 11 | + "metric_name": "PromptResumeQualityZh", |
| 12 | + "description": "Comprehensive resume quality evaluation covering privacy, contact, format, structure, professionalism, date, and completeness issues", |
| 13 | + "paper_title": "N/A", |
| 14 | + "paper_url": "", |
| 15 | + "paper_authors": "Dingo Team", |
| 16 | + "evaluation_results": "" |
| 17 | + } |
| 18 | + |
| 19 | + content = """ |
| 20 | +# Role |
| 21 | +You are an expert in resume quality evaluation. |
| 22 | +
|
| 23 | +# Background |
| 24 | +The resume is submitted by job seekers for employment opportunities. Your task is to evaluate the quality of the resume based on professional standards. |
| 25 | +
|
| 26 | +# Goals |
| 27 | +Your primary objective is to assess the quality of this resume. If the resume meets any of the following negative criteria, it will be considered as having quality issues. |
| 28 | +
|
| 29 | +# Criteria |
| 30 | +1. Privacy |
| 31 | + 1.1 Error_ID_Card: The resume contains Chinese ID card numbers (18 digits), which is a serious privacy leak. |
| 32 | + 1.2 Error_Detailed_Address: The resume contains detailed address information (province, city, district, street, building number), which may leak privacy. |
| 33 | +
|
| 34 | +2. Contact |
| 35 | + 2.1 Error_Email_Missing: The resume does not contain a valid email address. |
| 36 | + 2.2 Error_Phone_Missing: The resume does not contain a valid phone number. |
| 37 | + 2.3 Error_Phone_Format_Error: The phone number format is incorrect or invalid. |
| 38 | +
|
| 39 | +3. Format |
| 40 | + 3.1 Error_Excessive_Whitespace: The resume contains excessive consecutive spaces (3 or more spaces). |
| 41 | + 3.2 Error_Markdown_Syntax_Error: The resume has Markdown syntax errors (e.g., too many # symbols, excessive * or _). |
| 42 | +
|
| 43 | +4. Structure |
| 44 | + 4.1 Error_Name_Missing: The resume does not have a clear name or heading in the first section. |
| 45 | + 4.2 Error_Section_Missing: The resume is missing required sections such as education or work experience. |
| 46 | + 4.3 Error_Heading_Level_Error: The resume has inconsistent or incorrect heading hierarchy. |
| 47 | +
|
| 48 | +5. Professionalism |
| 49 | + 5.1 Error_Emoji_Usage: The resume contains emoji characters, which reduces professionalism. |
| 50 | + 5.2 Error_Informal_Language: The resume uses informal or colloquial expressions (e.g., "搞定", "牛逼", "厉害"). |
| 51 | + 5.3 Error_Typo: The resume contains obvious typos or grammatical errors. |
| 52 | +
|
| 53 | +6. Date |
| 54 | + 6.1 Error_Date_Format_Inconsistent: The resume uses inconsistent date formats (e.g., mixing "2020.01" and "2021-03"). |
| 55 | + 6.2 Error_Date_Logic_Error: The resume has date logic errors (e.g., graduation date earlier than enrollment date, end date earlier than start date). |
| 56 | +
|
| 57 | +7. Completeness |
| 58 | + 7.1 Error_Education_Missing: The resume does not contain education background information. |
| 59 | + 7.2 Error_Experience_Missing: The resume does not contain work experience or project experience information. |
| 60 | +
|
| 61 | +# Workflow |
| 62 | +1. Carefully read and understand the provided resume content, evaluate the quality based on the negative criteria above. |
| 63 | +2. Assign a type to the resume. |
| 64 | + - If the resume does not hit any negative criteria above, type must only be 'Good'. |
| 65 | + - Otherwise, type must only be one of the list ['Privacy', 'Contact', 'Format', 'Structure', 'Professionalism', 'Date', 'Completeness']. |
| 66 | +3. Assign a name to the resume. |
| 67 | + - If type is 'Good', name must only be 'None'. |
| 68 | + - If type is 'Privacy', name must only be one of ['Error_ID_Card', 'Error_Detailed_Address']. |
| 69 | + - If type is 'Contact', name must only be one of ['Error_Email_Missing', 'Error_Phone_Missing', 'Error_Phone_Format_Error']. |
| 70 | + - If type is 'Format', name must only be one of ['Error_Excessive_Whitespace', 'Error_Markdown_Syntax_Error']. |
| 71 | + - If type is 'Structure', name must only be one of ['Error_Name_Missing', 'Error_Section_Missing', 'Error_Heading_Level_Error']. |
| 72 | + - If type is 'Professionalism', name must only be one of ['Error_Emoji_Usage', 'Error_Informal_Language', 'Error_Typo']. |
| 73 | + - If type is 'Date', name must only be one of ['Error_Date_Format_Inconsistent', 'Error_Date_Logic_Error']. |
| 74 | + - If type is 'Completeness', name must only be one of ['Error_Education_Missing', 'Error_Experience_Missing']. |
| 75 | +4. Assign a score to the resume according to the type. If the type is 'Good', score is 1, otherwise the score is 0. |
| 76 | +5. Provide a clear reason for the evaluation. |
| 77 | +6. Return the results in JSON format: {"score": 0/1, "type": "", "name": "", "reason": ""}. |
| 78 | +
|
| 79 | +# Warning |
| 80 | +Please remember to output only a JSON format data, without any additional content. |
| 81 | +
|
| 82 | +# Input content |
| 83 | +""" |
| 84 | + |
| 85 | + |
| 86 | +@Model.prompt_register("RESUME_QUALITY_EN", [], ['LLMResumeQuality']) |
| 87 | +class PromptResumeQualityEn(BasePrompt): |
| 88 | + """English prompt for resume quality evaluation.""" |
| 89 | + |
| 90 | + _metric_info = { |
| 91 | + "category": "Resume Quality Assessment Metrics", |
| 92 | + "metric_name": "PromptResumeQualityEn", |
| 93 | + "description": "Comprehensive resume quality evaluation covering privacy, contact, format, structure, professionalism, date, and completeness issues", |
| 94 | + "paper_title": "N/A", |
| 95 | + "paper_url": "", |
| 96 | + "paper_authors": "Dingo Team", |
| 97 | + "evaluation_results": "" |
| 98 | + } |
| 99 | + |
| 100 | + content = """ |
| 101 | +# Role |
| 102 | +You are an expert in resume quality evaluation. |
| 103 | +
|
| 104 | +# Background |
| 105 | +The resume is submitted by job seekers for employment opportunities. Your task is to evaluate the quality of the resume based on professional standards. |
| 106 | +
|
| 107 | +# Goals |
| 108 | +Your primary objective is to assess the quality of this resume. If the resume meets any of the following negative criteria, it will be considered as having quality issues. |
| 109 | +
|
| 110 | +# Criteria |
| 111 | +1. Privacy |
| 112 | + 1.1 Error_ID_Card: The resume contains ID card numbers or social security numbers, which is a serious privacy leak. |
| 113 | + 1.2 Error_Detailed_Address: The resume contains detailed address information (street, building number, apartment), which may leak privacy. |
| 114 | +
|
| 115 | +2. Contact |
| 116 | + 2.1 Error_Email_Missing: The resume does not contain a valid email address. |
| 117 | + 2.2 Error_Phone_Missing: The resume does not contain a valid phone number. |
| 118 | + 2.3 Error_Phone_Format_Error: The phone number format is incorrect or invalid. |
| 119 | +
|
| 120 | +3. Format |
| 121 | + 3.1 Error_Excessive_Whitespace: The resume contains excessive consecutive spaces (3 or more spaces). |
| 122 | + 3.2 Error_Markdown_Syntax_Error: The resume has Markdown syntax errors (e.g., too many # symbols, excessive * or _). |
| 123 | +
|
| 124 | +4. Structure |
| 125 | + 4.1 Error_Name_Missing: The resume does not have a clear name or heading in the first section. |
| 126 | + 4.2 Error_Section_Missing: The resume is missing required sections such as education or work experience. |
| 127 | + 4.3 Error_Heading_Level_Error: The resume has inconsistent or incorrect heading hierarchy. |
| 128 | +
|
| 129 | +5. Professionalism |
| 130 | + 5.1 Error_Emoji_Usage: The resume contains emoji characters, which reduces professionalism. |
| 131 | + 5.2 Error_Informal_Language: The resume uses informal or colloquial expressions. |
| 132 | + 5.3 Error_Typo: The resume contains obvious typos or grammatical errors. |
| 133 | +
|
| 134 | +6. Date |
| 135 | + 6.1 Error_Date_Format_Inconsistent: The resume uses inconsistent date formats (e.g., mixing "2020.01" and "2021-03"). |
| 136 | + 6.2 Error_Date_Logic_Error: The resume has date logic errors (e.g., graduation date earlier than enrollment date, end date earlier than start date). |
| 137 | +
|
| 138 | +7. Completeness |
| 139 | + 7.1 Error_Education_Missing: The resume does not contain education background information. |
| 140 | + 7.2 Error_Experience_Missing: The resume does not contain work experience or project experience information. |
| 141 | +
|
| 142 | +# Workflow |
| 143 | +1. Carefully read and understand the provided resume content, evaluate the quality based on the negative criteria above. |
| 144 | +2. Assign a type to the resume. |
| 145 | + - If the resume does not hit any negative criteria above, type must only be 'Good'. |
| 146 | + - Otherwise, type must only be one of the list ['Privacy', 'Contact', 'Format', 'Structure', 'Professionalism', 'Date', 'Completeness']. |
| 147 | +3. Assign a name to the resume. |
| 148 | + - If type is 'Good', name must only be 'None'. |
| 149 | + - If type is 'Privacy', name must only be one of ['Error_ID_Card', 'Error_Detailed_Address']. |
| 150 | + - If type is 'Contact', name must only be one of ['Error_Email_Missing', 'Error_Phone_Missing', 'Error_Phone_Format_Error']. |
| 151 | + - If type is 'Format', name must only be one of ['Error_Excessive_Whitespace', 'Error_Markdown_Syntax_Error']. |
| 152 | + - If type is 'Structure', name must only be one of ['Error_Name_Missing', 'Error_Section_Missing', 'Error_Heading_Level_Error']. |
| 153 | + - If type is 'Professionalism', name must only be one of ['Error_Emoji_Usage', 'Error_Informal_Language', 'Error_Typo']. |
| 154 | + - If type is 'Date', name must only be one of ['Error_Date_Format_Inconsistent', 'Error_Date_Logic_Error']. |
| 155 | + - If type is 'Completeness', name must only be one of ['Error_Education_Missing', 'Error_Experience_Missing']. |
| 156 | +4. Assign a score to the resume according to the type. If the type is 'Good', score is 1, otherwise the score is 0. |
| 157 | +5. Provide a clear reason for the evaluation. |
| 158 | +6. Return the results in JSON format: {"score": 0/1, "type": "", "name": "", "reason": ""}. |
| 159 | +
|
| 160 | +# Warning |
| 161 | +Please remember to output only a JSON format data, without any additional content. |
| 162 | +
|
| 163 | +# Input content |
| 164 | +""" |
0 commit comments