Correct dentist ads the AI labeled as general physician
CI/CD / CI · dotnet build (push) Successful in 1m57s
CI/CD / Deploy · hamkadr (push) Has been cancelled

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 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-21 17:59:24 +03:30
parent 5c04658faf
commit d39546389e
@@ -581,11 +581,18 @@ public class IngestionService
} }
if (pubRoles.Count == 0) pubRoles.Add(roles.First()); if (pubRoles.Count == 0) pubRoles.Add(roles.First());
// Specialist guard: the model sometimes labels a clearly-specialist ad («پزشک متخصص …»، // Doctor-role guard: the AI tends to default an unclear (or even a clearly NON-GP) doctor ad
// «فلوشیپ»، «فوق تخصص») as «پزشک عمومی» — making the title/filters wrong (an ENT post showing // to «پزشک عمومی» — a dentist ad («دعوت به همکاری دندانپزشک») published as «استخدام پزشک
// as «استخدام پزشک عمومی»). When the primary role is GP but the ad text says specialist, swap it. // عمومی», an ENT/specialist ad likewise. When the chosen role is a generic doctor but the ad
if (pubRoles[0].Name == "پزشک عمومی" && LooksSpecialist(raw.RawText)) // 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, "پزشک متخصص", "پزشک"); pubRoles[0] = ResolveOrCreateRole(roles, "پزشک متخصص", "پزشک");
}
var city = cities.FirstOrDefault(c => c.Name == cityName) var city = cities.FirstOrDefault(c => c.Name == cityName)
?? cities.FirstOrDefault(c => c.IsActive) ?? cities.First(); ?? cities.FirstOrDefault(c => c.IsActive) ?? cities.First();