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 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: "document", "handbook", "manual", "policy file", "Expert Data", or any source reference
 
 
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"]),