fix: narrow company registration intent
This commit is contained in:
@@ -13,11 +13,11 @@ from search.minjust_opensearch import APP_VERSION, request_json
|
||||
def company_registration_clauses(language: str, query: str) -> list[dict]:
|
||||
tokens = set(re.findall(r"\w+", query.casefold()))
|
||||
intent = {
|
||||
"ru": ("осоо", ("как", "порядок", "процедура"), ("откр", "созд", "зарегистр"), "Действует"),
|
||||
"ky": ("жчк", ("кантип", "тартиби"), ("ач", "түз", "кат"), "Күчүндө"),
|
||||
"ru": ("осоо", ("как", "порядок", "процедура"), ("откр", "созд", "зарегистр"), ("счет", "счёт", "филиал"), "Действует"),
|
||||
"ky": ("жчк", ("кантип", "тартиби"), ("ач", "түз", "кат"), ("эсеп", "эсеб", "филиал"), "Күчүндө"),
|
||||
}[language]
|
||||
entity, procedure_terms, action_prefixes, status = intent
|
||||
if entity not in tokens or not tokens.intersection(procedure_terms) or not any(
|
||||
entity, procedure_terms, action_prefixes, excluded_terms, status = intent
|
||||
if entity not in tokens or any(token.startswith(term) for token in tokens for term in excluded_terms) or not tokens.intersection(procedure_terms) or not any(
|
||||
token.startswith(prefix) for token in tokens for prefix in action_prefixes
|
||||
):
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user