Reduce threshold for vacancy duplicates
All checks were successful
release / docker (push) Successful in 34s
All checks were successful
release / docker (push) Successful in 34s
This commit is contained in:
parent
ffffa973a6
commit
7cce1cdc04
@ -5,8 +5,8 @@ from qdrant_client import QdrantClient
|
|||||||
from qdrant_client.models import Filter
|
from qdrant_client.models import Filter
|
||||||
from vacancies.main.models import VacancyFeatures
|
from vacancies.main.models import VacancyFeatures
|
||||||
from vacancies.conf.settings import QDRANT_URL
|
from vacancies.conf.settings import QDRANT_URL
|
||||||
from vacancies.main.models import CustomerCV, RecommendedVacancy
|
from vacancies.main.models import RecommendedVacancy
|
||||||
from qdrant_client.models import Filter, HasIdCondition
|
from qdrant_client.models import HasIdCondition
|
||||||
|
|
||||||
qdrant_client = QdrantClient(url=QDRANT_URL)
|
qdrant_client = QdrantClient(url=QDRANT_URL)
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ def add_vectors(collection_name: str, _id: int, features: dict, payload: dict):
|
|||||||
scored.append({"id": vid, "score": total})
|
scored.append({"id": vid, "score": total})
|
||||||
|
|
||||||
scored.sort(key=lambda x: x["score"], reverse=True)
|
scored.sort(key=lambda x: x["score"], reverse=True)
|
||||||
if scored and scored[0]["score"] > 98: # threshold
|
if scored and scored[0]["score"] > 90: # threshold
|
||||||
return
|
return
|
||||||
|
|
||||||
qdrant_client.upsert(
|
qdrant_client.upsert(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user