Skip to content

Commit

Permalink
chore(agents-api): remove clean parameter from extract_keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad-mtos committed Jan 15, 2025
1 parent e73d786 commit 9eb018f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions agents-api/agents_api/common/nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 9eb018f

Please sign in to comment.