From 9eb018f49469fc926da92a0d63b9557282a4f7f8 Mon Sep 17 00:00:00 2001 From: Ahmad Haidar Date: Wed, 15 Jan 2025 12:03:56 +0300 Subject: [PATCH] chore(agents-api): remove clean parameter from ``extract_keywords`` --- agents-api/agents_api/common/nlp.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/agents-api/agents_api/common/nlp.py b/agents-api/agents_api/common/nlp.py index 6c5f49f74..aea2380d8 100644 --- a/agents-api/agents_api/common/nlp.py +++ b/agents-api/agents_api/common/nlp.py @@ -42,7 +42,7 @@ def clean_keyword(kw: str) -> str: def extract_keywords( - doc: Doc, top_n: int = 25, clean: bool = True, split_chunks: bool = False + doc: Doc, top_n: int = 25, split_chunks: bool = False ) -> list[str]: """Optimized keyword extraction with minimal behavior change.""" excluded_labels = { @@ -114,10 +114,7 @@ def extract_keywords( remaining_slots = max(0, top_n - len(top_keywords)) top_keywords += [kw for kw, _ in freq.most_common(remaining_slots)] - if clean: - return [clean_keyword(kw) for kw in top_keywords] - return top_keywords - + return [clean_keyword(kw) for kw in top_keywords] @lru_cache(maxsize=1000) def text_to_tsvector_query(