Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 13
How to use dpravinv/modernbert-job-role-matcher with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("dpravinv/modernbert-job-role-matcher")
sentences = [
"Logistics Services Manager",
"The Logistics Contracts Manager/Logistics Programme Manager is responsible for managing multiple logistics programmes and related customer service activities. He/She is also responsible for managing the contracts to ensure customer requirements are met and managing overall programme resources, including manpower, internal assets and external vendors.\n\nAnalytical and logical, he is required to manage resources and obtain buy-in from internal and external stakeholders. He is also expected to lead programmes and make business decisions independently.",
"The Quality Engineer identifies user requirements and expectations to inform quality standards for end-products, and analyses product development processes to identify relevant quality standards. He/She incorporates relevant and suitable international standards into product development processes, quality standards and testing processes. He identifies quality-testing types and variations based on business needs and requirements and develops testing processes. He identifies suitable measures of quality for testing and contributes to the development of test scenarios and plans. He conducts various quality tests, and analyses data to identify operating and usage conditions in which performance of quality measures starts to decline. He also automates quality testing for applicable and suitable tests.\n\nHe works in a team setting and is proficient in programming languages required by the organisation. He is familiar with international quality standards, and uses test automation frameworks and tools, as well as applicable quality testing and analysis tools. \n\nThe Quality Engineer possesses strong analytical ability with excellent communication and interpersonal skills. He is highly meticulous in nature, curious and work dynamically.",
"The Customer Services Agent provides assistance to customers at check-in counters. He/She ensures that passengers details match the information on travel documents and handles customer issues regarding flight operations and automated check-in systems. To maintain a safe working environment, he complies with all safety and/or security standards and reports safety and/or security breaches to officers and supervisors.\n\nThe Customer Services Agent demonstrates professional behaviour when responding to passenger complaints and acts as a service ambassador for the organisation. He works in shifts to accommodate round-the-clock flight arrivals and departures. He is physically strong to assist passengers with lifting of their baggage. Furthermore, he is service-oriented, possesses good communication skills as well as handles passengers with special needs in an appropriate manner."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model finetuned from nomic-ai/modernbert-embed-base. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: ModernBertModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("dpravinv/modernbert-job-role-matcher")
# Run inference
sentences = [
'Senior Aerospace Quality Control Engineer',
"The Senior NDT Level 3 Engineer (Aircraft Maintenance) manages non-destructive testing (NDT) operations for assessing the quality of aircraft structures. He/She establishes new NDT techniques and qualifies new procedures. He drives compliance of all NDT inspections with the requirements of customers, original equipment manufacturer (OEM) and EN 4179, NAS 410, NADCAP as appropriate. He drives collaboration with workshops and engineering teams for failure investigations and recommends engineering solutions for structural flaws and defects. He develops special process control plans and manages equipment maintenance and operator certification programmes. He also monitors results of NDT for trends and corrective actions, and leads technical audits to ensure compliance with relevant standards and NDT requirements. He reviews compliance with airworthiness and legislative requirements, while proposing enhancements to the organisation's standard operating procedures (SOPs), and safety, health and quality systems. He proactively contributes to the development of lean and sustainability practices, and conducts research and digital innovation in NDT for continuous process improvements. As a team leader, he appraises staff performance and conducts coaching and training for level 1 and level 2 NDT personnel. He is able to work cross-functionally, employing critical reasoning, analytical thinking and problem-solving skills to identify deviations and mitigate potential quality risks in aircraft maintenance processes.",
'The Automation Coordinator/Robot Coordinator oversees automated equipment and robots used in manufacturing processes. He/She is the primary responder, responsible for troubleshooting automated production systems and performing preventive and predictive maintenance on equipment. He also contributes to process optimisation by managing data from automated manufacturing systems to facilitate real-time insight gathering and decision-making.\n\nHe may be required to work on rotating shifts in a factory setting, and under strict compliance to workplace safety and health requirements, organisational quality control and other parameters.\n\nHe is able to work independently, and as part of a team, to achieve production and quality targets, and interact effectively with others to ensure that all issues are resolved appropriately and efficiently.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
TripletEvaluator| Metric | Value |
|---|---|
| cosine_accuracy | 0.98 |
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
Port Vessel Navigator |
The Helmsman manoeuvres and handles boats or crafts operating within the Port Limit of Singapore Territorial Waters. He/She is able to use the craft's navigational, fire-fighting and safety equipment and appreciate weather conditions, tides and tidal currents. He also performs basic chartwork, monitors and anticipates potential problems that may arise during daily operations and alerts the relevant authorities to them. He must pass a colour vision test and fulfil the requirements of the Port Limit Helmsman Licence issued by the Maritime and Port Authority of Singapore (MPA). |
The Associate Counsellor assists in providing counselling services and support to individuals and families experiencing socioemotional and mental health challenges. This includes case management for cases of low complexity and risk and provision of clinical services through various modes of counselling such as face-to-face or online counselling and group work.He/She may also support department research through data collection and coordinate internal and external training/programmes. |
Room Reservations Manager |
The Reservations Executive/Reservations Supervisor is responsible for supervising the operations of the department in selling rooms and managing room inventory to maximise sales. He/She ensures that all guest requests, concerns and feedback relating to rooms reservations are addressed in a timely and professional manner and collaborates with relevant departments on booking requirements and special guest requests to provide a seamless guest experience. |
The Membership Director/Assistant Director assumes overall responsibility in driving member attraction, recruitment and retention. He/she develops membership development and engagement strategies with the support of member research. He works with multiple stakeholders to advocate for member needs and interests to the relevant government agencies. He also oversees the execution and delivery of membership activities and events. The Membership Director/Assistant Director is highly driven, detail-oriented and strategic in handling all aspects of member relations. He is articulate and has excellent communication and people management skills to develop and maintain strong relationships among various stakeholders. He is able to multi-task and rally his team to deliver excellent membership experiences. |
Quality Assurance Engineer |
The Quality Engineer identifies user requirements and expectations to inform quality standards for end-products, and analyses product development processes to identify relevant quality standards. He/She incorporates relevant and suitable international standards into product development processes, quality standards and testing processes. He identifies quality-testing types and variations based on business needs and requirements and develops testing processes. He identifies suitable measures of quality for testing and contributes to the development of test scenarios and plans. He conducts various quality tests, and analyses data to identify operating and usage conditions in which performance of quality measures starts to decline. He also automates quality testing for applicable and suitable tests. |
The Industry Development Director/Assistant Director plays a key role in collaborating with key government agencies and other organisations to drive industry development and transformation. He/she collaborates with multiple stakeholders to represent the industry needs and interests at relevant platforms. He drives industry innovation and adoption of technology, and oversees the execution and delivery of local industry projects and initiatives. He also builds effective relationships with strategic partners and stakeholders to identify growth opportunities for the industry.The Industry Development Director/Assistant Director is an effective communicator and presenter, able to develop strong working relationships with relevant stakeholders and strategic partners. He has good listening skills and is analytical and professional in addressing the concerns of the industry. He is forward-looking, able to set out a clear strategic direction and inspire the team towards achieving desired outcome... |
TripletLoss with these parameters:{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 5
}
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
Room Sales Coordinator |
The Reservations Executive/Reservations Supervisor is responsible for supervising the operations of the department in selling rooms and managing room inventory to maximise sales. He/She ensures that all guest requests, concerns and feedback relating to rooms reservations are addressed in a timely and professional manner and collaborates with relevant departments on booking requirements and special guest requests to provide a seamless guest experience. |
The Technician supports the team to perform routine bus servicing and preventive corrective maintenance activities. His/Her duties include preparation of work activities, perform assigned servicing and maintenance tasks of different bus sub-systems, perform general housekeeping of workshop tools and equipment as well as adheres to Workplace Safety and Health (WSH) procedures. He may be deployed to support on-the-road bus breakdown assistance and recovery. |
Data Compliance Officer |
The Data Protection Officer executes data governance policies and procedures. He/She ensures the Data Protection Act is implemented and enforced in the organisation, and amongst the respective teams and users. He collaborates with business and project teams in projects and ensures alignment and compliance with the organisation's data protection guidelines and policies, and with industry standards and guidelines. He also directs a team of professionals and third-party vendors or service providers to achieve organisational goals in accordance with the data governance and data protection policies. He manages risks and data breach incidents. The Data Protection Officer is knowledgeable in areas of data governance, compliance and data protection policies and frameworks, and works within and across teams to mitigate data breaches. He is expected to be proficient in the requirements under the Personal Data Protection Act 2012. The Data Protection Officer adopts a broad and global perspective ... |
The Senior Process Safety Engineer provides technical advice and guidance on process safety-related activities. He/She leads the implementation of the Process Safety Management (PSM) framework in the organisation, and reviews plant safeguarding system requirements to ensure compliance with process safety standards. In addition, he provides technical input for the development and maintenance of the organisations Major Hazard Installation (MHI) Safety Case. |
Maritime Craft Handler |
The Helmsman manoeuvres and handles boats or crafts operating within the Port Limit of Singapore Territorial Waters. He/She is able to use the craft's navigational, fire-fighting and safety equipment and appreciate weather conditions, tides and tidal currents. He also performs basic chartwork, monitors and anticipates potential problems that may arise during daily operations and alerts the relevant authorities to them. He must pass a colour vision test and fulfil the requirements of the Port Limit Helmsman Licence issued by the Maritime and Port Authority of Singapore (MPA). |
The Head of Design strategises the design and development of the product line lifecycle, including the end-to-end iterative design process. He/She establishes design policy principles to drive product development in the conceptualisation and design phase, including endorsement of design strategies, and achieving design solutions based on insights researched by the team |
TripletLoss with these parameters:{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 5
}
eval_strategy: epochper_device_train_batch_size: 4per_device_eval_batch_size: 4gradient_accumulation_steps: 4learning_rate: 2e-05lr_scheduler_type: cosinewarmup_ratio: 0.1load_best_model_at_end: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 4per_device_eval_batch_size: 4per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 4eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 3max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters: auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | Validation Loss | cosine_accuracy |
|---|---|---|---|---|
| 1.0 | 50 | - | 4.3018 | 0.9800 |
| 2.0 | 100 | 4.3737 | 4.1720 | 0.9850 |
| 3.0 | 150 | - | 4.1523 | 0.98 |
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
@misc{hermans2017defense,
title={In Defense of the Triplet Loss for Person Re-Identification},
author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
year={2017},
eprint={1703.07737},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Base model
answerdotai/ModernBERT-base