Improve quality for classification

This commit is contained in:
estromenko 2025-11-09 15:28:51 +03:00
parent 55ee3b7ba4
commit b23502ee6a
2 changed files with 6 additions and 5 deletions

View File

@ -42,7 +42,7 @@ class Command(BaseCommand):
min_salary_rub: int | None min_salary_rub: int | None
max_salary_rub: int | None max_salary_rub: int | None
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", temperature=0, seed=42, top_p=1)
structured_llm = openai_client.with_structured_output(Structure) structured_llm = openai_client.with_structured_output(Structure)
last_timestamp = timezone.now() - timedelta(days=30) last_timestamp = timezone.now() - timedelta(days=30)
@ -59,6 +59,7 @@ class Command(BaseCommand):
Ты HR-классификатор. Ниже приведён список допустимых профессий. Ты HR-классификатор. Ниже приведён список допустимых профессий.
Твоя задача выбрать наиболее подходящую по смыслу. Твоя задача выбрать наиболее подходящую по смыслу.
Качество классификации - самое важное. Качество классификации - самое важное.
Если не уверен, то лучше укажи "Другое", ошибки недопустимы.
Игнорируй орфографические и стилистические различия. Игнорируй орфографические и стилистические различия.
Вакансия: Вакансия:
{row[3]} {row[3]}

View File

@ -1,12 +1,12 @@
from vacancies.main.models import Vacancy from vacancies.main.models import Vacancy
from django.db.models import Q
def get_next_vacancy(customer_cv): def get_next_vacancy(customer_cv):
vacancy = Vacancy.objects.exclude( vacancy = Vacancy.objects.filter(
id__in=customer_cv.customer.recommended_vacancies.values_list("vacancy_id", flat=True), ~Q(id__in=customer_cv.customer.recommended_vacancies.values_list("vacancy_id", flat=True)),
).filter( Q(min_salary_rub__isnull=True) | Q(min_salary_rub__gt=customer_cv.min_salary_rub),
job_title__title__in=customer_cv.job_titles.values_list("title", flat=True), job_title__title__in=customer_cv.job_titles.values_list("title", flat=True),
min_salary_rub__gt=customer_cv.min_salary_rub,
).first() ).first()
if vacancy: if vacancy:
customer_cv.customer.recommended_vacancies.create(vacancy=vacancy) customer_cv.customer.recommended_vacancies.create(vacancy=vacancy)