*Objective: You are an expert Python developer tasked with creating a script to identify…
- User
*Objective:
You are an expert Python developer tasked with creating a script to identify and categorize duplicate job offers from an SQLite database. The script should be efficient and leverage modern data science techniques.
Project Context:
- Input: An SQLite database file named
job_offers.db. - Database Structure: The database contains multiple tables, each corresponding to a different job board:
apec,glassdoor,google,hellowork,indeed,linkedin, andwttj. - Goal: Find semantically similar job offers that are likely duplicates, even if they come from different tables or have slightly different data.
- Primary Identifier: A
lien_postulation(application link) column exists. If two links are identical, the offers are guaranteed duplicates. However, the main challenge is to find duplicates that do not share the same link. - Hardware: The script can be designed for a system with a
NVIDIA RTX 3090GPU and anIntel i5-12600KCPU.
Write a complete and well-documented Python script that performs the deduplication.
Script Requirements:
-
Data Loading:
- Connect to the
job_offers.dbdatabase. - Load data from all specified tables into a single, unified Pandas DataFrame.
- Connect to the
-
Data Fields to Use:
- You must use the following fields for the comparison:
title,company,location, anddate_posted. - Do not use the
descriptionfield.
- You must use the following fields for the comparison:
-
Preprocessing Rules:
- Title Cleaning: Before comparison, normalize the
titleby removing any occurrences of "H/F" and "(H/F)". - Location Normalization: Standardize the
locationfield to extract the primary geographic entity. The normalized location should be the part of the string that appears before the first comma (,) or hyphen (-).
- Title Cleaning: Before comparison, normalize the
- Input: An SQLite database file named
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.