MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / extract_keywords

Function extract_keywords

worked/example/raw/processor.py:20–29  ·  view source on GitHub ↗

Pull non-stopword tokens from text, deduplicated.

(text: str)

Source from the content-addressed store, hash-verified

18
19
20def extract_keywords(text: str) -> list:
21 """Pull non-stopword tokens from text, deduplicated."""
22 tokens = re.findall(r"\b[a-z]{3,}\b", normalize_text(text))
23 seen = set()
24 keywords = []
25 for t in tokens:
26 if t not in STOPWORDS and t not in seen:
27 seen.add(t)
28 keywords.append(t)
29 return keywords
30
31
32def enrich_document(doc: dict) -> dict:

Callers 1

enrich_documentFunction · 0.85

Calls 1

normalize_textFunction · 0.85

Tested by

no test coverage detected