From d39546389edcea0464697e0e75e9fdb60932bc3a Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Sun, 21 Jun 2026 17:59:24 +0330 Subject: [PATCH] Correct dentist ads the AI labeled as general physician MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends the doctor-role guard: the AI defaults unclear (and even clearly non-GP) doctor ads to «پزشک عمومی», so a dentist ad («دعوت به همکاری دندانپزشک») published as «استخدام پزشک عمومی». When the chosen role is a generic doctor but the ad text says «دندانپزشک», correct it to دندانپزشک (specialist correction stays for «متخصص/فوق تخصص/فلوشیپ»). Applies to new ingests. Co-Authored-By: Claude Opus 4.8 --- .../Services/Scraping/IngestionService.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/JobsMedical.Web/Services/Scraping/IngestionService.cs b/src/JobsMedical.Web/Services/Scraping/IngestionService.cs index 6ba428f..9188f3b 100644 --- a/src/JobsMedical.Web/Services/Scraping/IngestionService.cs +++ b/src/JobsMedical.Web/Services/Scraping/IngestionService.cs @@ -581,11 +581,18 @@ public class IngestionService } if (pubRoles.Count == 0) pubRoles.Add(roles.First()); - // Specialist guard: the model sometimes labels a clearly-specialist ad («پزشک متخصص …»، - // «فلوشیپ»، «فوق تخصص») as «پزشک عمومی» — making the title/filters wrong (an ENT post showing - // as «استخدام پزشک عمومی»). When the primary role is GP but the ad text says specialist, swap it. - if (pubRoles[0].Name == "پزشک عمومی" && LooksSpecialist(raw.RawText)) - pubRoles[0] = ResolveOrCreateRole(roles, "پزشک متخصص", "پزشک"); + // Doctor-role guard: the AI tends to default an unclear (or even a clearly NON-GP) doctor ad + // to «پزشک عمومی» — a dentist ad («دعوت به همکاری دندانپزشک») published as «استخدام پزشک + // عمومی», an ENT/specialist ad likewise. When the chosen role is a generic doctor but the ad + // text unambiguously names a more specific role the model missed, correct it. + if (pubRoles[0].Name is "پزشک عمومی" or "پزشک متخصص") + { + var t = NormalizeFa(raw.RawText); + if (t.Contains("دندانپزشک") || t.Contains("دندان پزشک")) + pubRoles[0] = ResolveOrCreateRole(roles, "دندانپزشک", "دندانپزشک"); + else if (pubRoles[0].Name == "پزشک عمومی" && LooksSpecialist(raw.RawText)) + pubRoles[0] = ResolveOrCreateRole(roles, "پزشک متخصص", "پزشک"); + } var city = cities.FirstOrDefault(c => c.Name == cityName) ?? cities.FirstOrDefault(c => c.IsActive) ?? cities.First();