frimeet-api-nlp / app /modules /groups /infrastructure /semantic_document.py
AlleksDev's picture
Add: Global search
e1e72a4 unverified
Raw
History Blame Contribute Delete
449 Bytes
from app.shared.nlp.embeddings.weighted_document import build_weighted_document
GROUP_SEARCH_DOCUMENT_VERSION = "group-search-v1"
GROUP_SEARCH_FIELD_WEIGHTS = {"name": 8, "description": 3}
def build_group_search_document(name: str, description: str) -> str:
return build_weighted_document(
[
(name, GROUP_SEARCH_FIELD_WEIGHTS["name"]),
(description, GROUP_SEARCH_FIELD_WEIGHTS["description"]),
]
)