Views
No views yet
title_feature is a fine-tuned multi-label sequence classification model used to extract attributes and features embedded within job posting titles (such as employment type).> 0.98) is recommended for pulling out multi-label attributes.1import torch
2import numpy as np
3from transformers import AutoModelForSequenceClassification, AutoTokenizer
4
5model_name = "loyoladatamining/title_feature"
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7tokenizer = AutoTokenizer.from_pretrained(model_name)
8
9# Sample input title from a job posting
10title = "Remote Senior Software Engineer Full-Time"
11
12# Tokenize and infer
13inputs = tokenizer(
14 title,
15 truncation=True,
16 max_length=32,
17 padding="max_length",
18 return_tensors="pt"
19)
20
21with torch.no_grad():
22 outputs = model(inputs.input_ids)
23 logits = outputs.logits
24
25# Apply thresholding for multi-label retrieval
26for l in logits:
27 probabilities = torch.sigmoid(l.cpu()).numpy()
28 active_indices = np.where(probabilities > 0.9)[0]
29
30 # Map index integers back to the feature labels
31 extracted_features = sorted([model.config.id2label[idx] for idx in active_indices])
32
33 # Optional handling for when "none" is predicted along with others
34 if "none" in extracted_features and len(extracted_features) > 1:
35 extracted_features = [x for x in extracted_features if x != "none"]
36
37 print(f"Extracted Features: {';'.join(extracted_features)}")extracted_features would then read:FT;RemFT) and remote work eligible (Rem).@article{meisenbacher2025extracting,
title={Extracting O* NET Features from the NLx Corpus to Build Public Use Aggregate Labor Market Data},
author={Meisenbacher, Stephen and Nestorov, Svetlozar and Norlander, Peter},
year={2025}
}