Binary classifier that determines whether a job title belongs to an IT/tech role or not. Built on top of
intfloat/e5-base-v2 embeddings with a logistic regression head, exported to ONNX for fast, lightweight inference with no heavy ML dependencies at runtime.
1from sentence_transformers import SentenceTransformer
2import onnxruntime as ort
3import numpy as np
4
5encoder = SentenceTransformer("intfloat/e5-base-v2")
6sess = ort.InferenceSession("e5_it_classifier.onnx")
7
8def classify(title: str) -> dict:
9 emb = encoder.encode(["query: " + title], normalize_embeddings=True)
10 probs = sess.run(["probabilities"], {"input": emb.astype(np.float32)})[0]
11 return {
12 "label": "IT" if probs[0][1] > probs[0][0] else "Non-IT",
13 "it_probability": float(probs[0][1]),
14 }
15
16print(classify("Senior Software Engineer")) # IT
17print(classify("Regional Sales Manager")) # Non-IT
1import { pipeline } from "@huggingface/transformers";
2import * as ort from "onnxruntime-node";
3
4const extractor = await pipeline("feature-extraction", "intfloat/e5-base-v2", { quantized: false });
5const session = await ort.InferenceSession.create("./e5_it_classifier.onnx");
6
7async function classify(title: string) {
8 const output = await extractor("query: " + title, { pooling: "mean", normalize: true });
9
10 const results = await session.run({
11 input: new ort.Tensor("float32", output.data as Float32Array, [1, 768]),
12 });
13
14 const probs = results.probabilities.data as Float32Array;
15 return {
16 label: probs[1] > probs[0] ? "IT" : "Non-IT",
17 it_probability: probs[1],
18 };
19}
20
21console.log(await classify("Senior Software Engineer")); // IT
22console.log(await classify("Regional Sales Manager")); // Non-IT
1bun add @huggingface/transformers onnxruntime-node
2# or
3npm install @huggingface/transformers onnxruntime-node
Designed for automated job pipeline filtering — quickly classifying job titles as IT or non-IT before downstream enrichment or processing steps. Works well as a lightweight pre-filter given that it only requires a job title with no description needed.