JobTitleTransformer
JobTitleTransformer is an enterprise-grade, hybrid NLP pipeline designed to ingest, sanitize, and normalize highly unstructured, multi-lingual healthcare job titles into a standardized corporate taxonomy.
Built for seamless integration into broader ETL workflows, this library ensures high-quality Data Modeling for Downstream Platforms , including Data Lakes, Data Hubs, Data Warehouses, Data Marts, and Semantic Models.
🏗️ Pipeline Architecture
The transformation engine operates in a deterministic-to-probabilistic cascading sequence to balance execution speed with high recall:
-
Vectorized Text Preprocessing: Utilizes Pandas vectorized string operations for high-performance HTML entity decoding (
html.unescape), Unicode normalization (NFKD), and automated noise/garbage character removal via compiled Regular Expressions. -
Deterministic Rules Engine: Executes 100+ modular taxonomy scripts utilizing exact-match dictionary hashing and complex RegEx patterns for rapid, precise mapping of known variants, typos, and edge cases.
-
Machine Learning Semantic Search (Fallback): Unmatched string records are passed to an
AI fallback layer. The pipeline generates vector embeddings using SBERT (all-MiniLM-L6-v2) and performs an L2 distance vector search viaFacebook AI Similarity Search (FAISS)to semantically map unmatched job titles to the closest valid business category. -
Automated Data Integrity Gates: Implements strict pre- and post-execution dataframe row-count validations to guarantee idempotency and zero data loss during transformations.
⚠️ Domain Constraint:** The taxonomy dictionary and ML embeddings are strictly optimized for the Healthcare and Medical sectors.
⚙️ Installation
pip install jobtitletransformer
⚠️ Requirements:
- Python 3.9+
- pandas
- sentence-transformers
- faiss-cpu
All dependencies install automatically with pip install jobtitletransformer
🚀 Integration & Usage
Critical Dataframe Contract: This library currently expects the input dataframe to be instantiated as df and the target text column to be explicitly named speciality.
# Environment & Installation Diagnostics
# The following checks verify that the package is correctly installed
# and accessible within your active Python environment.
import sys
import importlib.util
print("sys.path:", sys.path)
# Verify the package specification exists before attempting import
spec = importlib.util.find_spec("JobTitleTransformer")
print("JobTitleTransformer found at:", spec.origin if spec else "NOT FOUND")
# Import the core package
import JobTitleTransformer # note: the import name is case-sensitive
print("JobTitleTransformer loaded from:", JobTitleTransformer.__file__)
# Data Ingestion
import pandas as pd
# Load your raw dataset.
# Note: This can be adapted for SQL queries, JSON, or any Pandas-supported format.
raw_data = pd.read_csv("raw_healthcare_contacts.csv")
# Schema Enforcement
# The pipeline relies on a strict schema contract:
# The dataframe must be named 'df' and the target column must be 'speciality'.
# We append .copy() to ensure we are working with a fresh dataframe in memory
# and to prevent Pandas 'SettingWithCopy' warnings downstream.
df = raw_data.rename(columns={"job_title": "speciality"}).copy()
# Pipeline Execution
# Pass the dataframe into the transformation hub.
# The engine will sequentially execute RegEx dictionaries -> SBERT embeddings -> FAISS matching.
# It prints CLI diagnostics during execution and returns the fully normalized dataframe.
enriched_df = JobTitleTransformer.run_pipeline(df)
🧪 Testing
The deterministic rule engine is covered by an automated test suite (known mappings, typos, multilingual variants, HTML entities, and row-preservation checks). GitHub Actions runs it on every pull request across Python 3.9–3.13 and verifies that the package builds.
pip install pandas termcolor tabulate unidecode pytest
pip install --no-deps -e .
pytest
🧠 Author & Maintainer
Prasanna - Senior Data Engineer & Analytics Specialist
🌐 GitHub: PrasannaDataBus
Metadata
Release files for jobtitletransformer 0.1.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| jobtitletransformer-0.1.23.tar.gz | 88.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jobtitletransformer-0.1.23-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 272.4 kB
Release files / jobtitletransformer-0.1.23.tar.gz
| Download URL | jobtitletransformer-0.1.23.tar.gz |
|---|---|
| Size | 88.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6c4372b0489cde0231347f53e896cc1501d286d4ce06028577ee3be8f0cf9cf
|
|
BLAKE2b-256 checksum How to use checksums |
0c205eda89d6741be46f1c790412fe9c63b1f8c4311e844ffbe4976bf0dfa9a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.10
|
Release files / jobtitletransformer-0.1.23-py3-none-any.whl
| Download URL | jobtitletransformer-0.1.23-py3-none-any.whl |
|---|---|
| Size | 184.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43ca097245b157ff3ed4ede8f2851a5f877dbb7f006f4577128318420024b563
|
|
BLAKE2b-256 checksum How to use checksums |
37f620ba53cfae4c515265570d11d067449bcca0adbb1eb6e3428c76e091c28b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.10
|
Security for jobtitletransformer 0.1.23
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.