Compare commits
No commits in common. "5286b2cdc75e5e7779a59ae95fd3a4b470ea3548" and "08d6cddb6751a6cfc3bec120223daea5b7f47561" have entirely different histories.
5286b2cdc7
...
08d6cddb67
@ -15,8 +15,7 @@ WHERE timestamp >= now() - INTERVAL 30 DAY
|
|||||||
'требования', 'обязанности', 'условия', 'компания', 'офис',
|
'требования', 'обязанности', 'условия', 'компания', 'офис',
|
||||||
'удаленно', 'гибкий график', 'полный день', 'частичная занятость',
|
'удаленно', 'гибкий график', 'полный день', 'частичная занятость',
|
||||||
'резюме', 'собеседование', 'junior', 'middle', 'senior'
|
'резюме', 'собеседование', 'junior', 'middle', 'senior'
|
||||||
]) >= 5 AND position(message, 'О себе') = 0 AND position(message, 'Обо мне') = 0
|
]) >= 5 AND position(message, 'О себе') = 0 AND position(message, 'Обо мне') = 0 AND position(message, '#ищу') = 0
|
||||||
AND position(message, '#ищу') = 0 AND position(message, 'умею') = 0
|
|
||||||
AND id NOT IN %(exist_points)s
|
AND id NOT IN %(exist_points)s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@ -106,15 +106,15 @@ def add_vectors(collection_name: str, _id: int, features: dict, payload: dict):
|
|||||||
|
|
||||||
|
|
||||||
def search_similarities(query_filter: Filter, cv_id: int):
|
def search_similarities(query_filter: Filter, cv_id: int):
|
||||||
cv = client.retrieve(
|
vectors = client.retrieve(
|
||||||
collection_name="cvs",
|
collection_name="cvs",
|
||||||
ids=[cv_id],
|
ids=[cv_id],
|
||||||
with_vectors=True,
|
with_vectors=True,
|
||||||
)[0]
|
)[0].vector
|
||||||
|
|
||||||
max_similarities = {}
|
max_similarities = {}
|
||||||
vacancies_content = {}
|
vacancies_content = {}
|
||||||
for name, vec in cv.vector.items():
|
for name, vec in vectors.items():
|
||||||
if any(v != 0 for v in vec):
|
if any(v != 0 for v in vec):
|
||||||
results = client.query_points(
|
results = client.query_points(
|
||||||
collection_name="vacancies",
|
collection_name="vacancies",
|
||||||
@ -140,15 +140,11 @@ def search_similarities(query_filter: Filter, cv_id: int):
|
|||||||
total = sum(feature_sims[feature] * weights.get(feature, 1) for feature in feature_sims)
|
total = sum(feature_sims[feature] * weights.get(feature, 1) for feature in feature_sims)
|
||||||
scored.append({"id": vid, "score": total, "content": vacancies_content[vid]["content"], "link": vacancies_content[vid]["link"]})
|
scored.append({"id": vid, "score": total, "content": vacancies_content[vid]["content"], "link": vacancies_content[vid]["link"]})
|
||||||
|
|
||||||
scored.sort(key=lambda x: x["score"], reverse=True)
|
|
||||||
|
|
||||||
prompt = f"""
|
prompt = f"""
|
||||||
Резюме: {cv.payload['content']}
|
Среди вакансий ниже выбери одну наиболее релевантную и выведи ее индекс.
|
||||||
|
|
||||||
Среди вакансий ниже выбери одну наиболее релевантную и выведи ее индекс(от 0 до 9).
|
|
||||||
Если среди вакансий нет подходящих, то верни -1.
|
Если среди вакансий нет подходящих, то верни -1.
|
||||||
В ответе выведи только число.
|
В ответе выведи только число.
|
||||||
{scored[:10]}
|
{scored}
|
||||||
"""
|
"""
|
||||||
openai_client = ChatOpenAI(model_name="gpt-5-mini", reasoning_effort="minimal", temperature=0, seed=42, top_p=1)
|
openai_client = ChatOpenAI(model_name="gpt-5-mini", reasoning_effort="minimal", temperature=0, seed=42, top_p=1)
|
||||||
response = openai_client.invoke(prompt)
|
response = openai_client.invoke(prompt)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user