Martechsol commited on
Commit Β·
a045fe5
1
Parent(s): 8a2c74f
Fix intent map: compound keywords, follow-up starters, prorata robustness
Browse files- app/services/llm.py +3 -1
- app/services/rag_pipeline.py +15 -2
app/services/llm.py
CHANGED
|
@@ -249,7 +249,9 @@ STRICT QUALITY RULES
|
|
| 249 |
β ALWAYS TRY TO GUIDE β if you can't answer directly, guide the user to the Portal, trouble ticket system, Supervising Authority, or HR department.
|
| 250 |
β "I don't have that information" is ONLY for questions where NO guidance or reasoning is possible.
|
| 251 |
β Never cut a sentence mid-way β always complete every sentence fully
|
| 252 |
-
β NEVER mention: "
|
|
|
|
|
|
|
| 253 |
β Use <b>bold</b> for names, numbers, dates, leave types, and all key terms
|
| 254 |
β Use <br> between list items for clean vertical spacing
|
| 255 |
β Tone: formal, warm, and professional - never robotic, never chatty
|
|
|
|
| 249 |
β ALWAYS TRY TO GUIDE β if you can't answer directly, guide the user to the Portal, trouble ticket system, Supervising Authority, or HR department.
|
| 250 |
β "I don't have that information" is ONLY for questions where NO guidance or reasoning is possible.
|
| 251 |
β Never cut a sentence mid-way β always complete every sentence fully
|
| 252 |
+
β NEVER mention: "Expert Data", "context", "chunks", "retrieval", or any internal system reference
|
| 253 |
+
β NEVER say things like "according to the document" or "the handbook says" β present information as direct company knowledge
|
| 254 |
+
β Exception: If the user asks when policies were updated/revised, you MAY reference "company policies" or "HR guidelines" and state the date if found in Expert Data
|
| 255 |
β Use <b>bold</b> for names, numbers, dates, leave types, and all key terms
|
| 256 |
β Use <br> between list items for clean vertical spacing
|
| 257 |
β Tone: formal, warm, and professional - never robotic, never chatty
|
app/services/rag_pipeline.py
CHANGED
|
@@ -70,7 +70,9 @@ _INTENT_MAP: List[tuple] = [
|
|
| 70 |
("lunch", ["lunch dinner break 1 hour morning evening shift"]),
|
| 71 |
("break", ["smoking breaks 3 breaks workday 5 minutes lunch dinner"]),
|
| 72 |
("saturday", ["saturday half day first saturday off workweek schedule"]),
|
| 73 |
-
# ββ Salary / Pay ββ
|
|
|
|
|
|
|
| 74 |
("salary", ["salary structure payroll compensation amount deduction", "monthly pay increment"]),
|
| 75 |
("advance", ["advance salary loan request limit deduction eligibility committee"]),
|
| 76 |
("loan", ["loans advance salary request limit deduction eligibility committee 6 months"]),
|
|
@@ -126,7 +128,11 @@ _INTENT_MAP: List[tuple] = [
|
|
| 126 |
("pro-rata", ["pro-rata leaves salary final settlement confirmation probation days worked", "leave encashment pro-rata calculation separation"]),
|
| 127 |
("settlement", ["final settlement salary adjustments loans pro-rata leaves separation", "before after salary processed"]),
|
| 128 |
("return of", ["return of property identification health insurance card vehicle separation"]),
|
| 129 |
-
# ββ Probation / Confirmation / Permanent ββ
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
("probat", ["probation period 90 days evaluation initial confirmation confirmed", "orientation training supervising authority performance dismissal employment"]),
|
| 131 |
("permanent", ["confirmation confirmed probation period 90 days evaluation performance", "permanent employee orientation initial evaluation supervising authority"]),
|
| 132 |
("confirm", ["confirmation confirmed probation period 90 days evaluation performance", "salary increment pro-rata leaves permanent employee"]),
|
|
@@ -169,6 +175,13 @@ _INTENT_MAP: List[tuple] = [
|
|
| 169 |
("copyright", ["copyright violation ownership work intellectual property prohibited"]),
|
| 170 |
("data theft", ["data theft stealing digital records company property prohibited"]),
|
| 171 |
("orientation", ["orientation training initial evaluation period 90 days probation"]),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
# ββ Broad overview / Meta queries ββ
|
| 173 |
("polic", ["employee benefits leaves salary attendance work rules disciplinary procedures", "workplace orientation separation confirmation grievance"]),
|
| 174 |
("rule", ["work rules disciplinary procedures level 1 2 3 employee responsibilities", "attendance leave policy code of conduct"]),
|
|
|
|
| 70 |
("lunch", ["lunch dinner break 1 hour morning evening shift"]),
|
| 71 |
("break", ["smoking breaks 3 breaks workday 5 minutes lunch dinner"]),
|
| 72 |
("saturday", ["saturday half day first saturday off workweek schedule"]),
|
| 73 |
+
# ββ Salary / Pay (compound first) ββ
|
| 74 |
+
("salary increment",["salary increment raise confirmation review performance appraisal",
|
| 75 |
+
"revised salary effective date annual raise percentage"]),
|
| 76 |
("salary", ["salary structure payroll compensation amount deduction", "monthly pay increment"]),
|
| 77 |
("advance", ["advance salary loan request limit deduction eligibility committee"]),
|
| 78 |
("loan", ["loans advance salary request limit deduction eligibility committee 6 months"]),
|
|
|
|
| 128 |
("pro-rata", ["pro-rata leaves salary final settlement confirmation probation days worked", "leave encashment pro-rata calculation separation"]),
|
| 129 |
("settlement", ["final settlement salary adjustments loans pro-rata leaves separation", "before after salary processed"]),
|
| 130 |
("return of", ["return of property identification health insurance card vehicle separation"]),
|
| 131 |
+
# ββ Probation / Confirmation / Permanent (compound first) ββ
|
| 132 |
+
("after probation",["confirmation confirmed benefits leaves entitlement salary increment permanent",
|
| 133 |
+
"post probation confirmation 90 days employee rights"]),
|
| 134 |
+
("after confirm", ["confirmation confirmed benefits leaves entitlement salary increment permanent",
|
| 135 |
+
"post confirmation employee rights benefits entitlement"]),
|
| 136 |
("probat", ["probation period 90 days evaluation initial confirmation confirmed", "orientation training supervising authority performance dismissal employment"]),
|
| 137 |
("permanent", ["confirmation confirmed probation period 90 days evaluation performance", "permanent employee orientation initial evaluation supervising authority"]),
|
| 138 |
("confirm", ["confirmation confirmed probation period 90 days evaluation performance", "salary increment pro-rata leaves permanent employee"]),
|
|
|
|
| 175 |
("copyright", ["copyright violation ownership work intellectual property prohibited"]),
|
| 176 |
("data theft", ["data theft stealing digital records company property prohibited"]),
|
| 177 |
("orientation", ["orientation training initial evaluation period 90 days probation"]),
|
| 178 |
+
# ββ Meta / Document queries ββ
|
| 179 |
+
("update", ["updated revised version date employee handbook policy effective",
|
| 180 |
+
"MartechSol handbook revision date year"]),
|
| 181 |
+
("version", ["updated revised version date employee handbook policy effective",
|
| 182 |
+
"MartechSol handbook revision date year"]),
|
| 183 |
+
("revised", ["updated revised version date employee handbook policy effective",
|
| 184 |
+
"MartechSol handbook revision date year"]),
|
| 185 |
# ββ Broad overview / Meta queries ββ
|
| 186 |
("polic", ["employee benefits leaves salary attendance work rules disciplinary procedures", "workplace orientation separation confirmation grievance"]),
|
| 187 |
("rule", ["work rules disciplinary procedures level 1 2 3 employee responsibilities", "attendance leave policy code of conduct"]),
|