Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 16
How to use Fatin757/modernbert-job-role-matcher with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Fatin757/modernbert-job-role-matcher")
sentences = [
"The Mergers and Acquisitions Partner/Mergers and Acquisitions Director is a team leader in charge of various functions including generating and growing the business, quality control, providing technical leadership as well as sourcing appropriate staff for the team. He/She is given the signing authority for any client deliverables in a consultancy role, or responsibility for corporate development in-house. He/She is responsible for the quality of technical output, and risk management for the business. The Mergers and Acquisitions Partner/Mergers and Acquisitions Director is an expert in mergers and acquisitions and should possess considerable transaction experience. He has strong commercial acumen and strong quantitative skills. He is responsible for marketing and business development, client and stakeholder relationship management, and making decisions on engagements and client acceptance. He may work in an internal role within an organisation or in an advisory role in a professional services firm. He may also be a generalist or specialist in areas such as infrastructure advisory or project finance. In order to perform his duties effectively, he needs to stay up-to-date with current events and be well-connected with key executives within his sector. He maintains a global perspective and leverages his cross-border knowledge to help drive successful project outcomes. He manages multiple projects simultaneously and is able to lead teams effectively.",
"M&A Specialist",
" Chief Technology Officer (CTO) - Engineering Focus",
"The Key Grip oversees the execution of camera positioning, mounting, movements and manoeuvres for all cameras in order to achieve the production requirements. He/She is responsible for supervising the installation of structures and equipment that will help achieve the special camera movements required. He also executes the camera positioning, mounting, movements and manoeuvres for the main camera. During rehearsals, he is required to monitor the camera movements and propose changes that will enhance the quality of the shoot. He needs to be creative and inventive in order to manage the mounting of equipment and camera for difficult shots.\n\nThe work involves physically demanding tasks especially the handling of the heavy equipment used in the construction of the structures. He may be required to work outdoors and may be required to travel depending on the location of the shoot or production.\n\nHe should possess knowledge of the camera and mounting equipment construction structures as well as the camera effects from the different construction structures. He is required to possess effective teamwork, be diplomatic and tactful when working with the crew to achieve the creative vision. He is also required to have strong people management capabilities in order to lead the grip team and provide additional coaching when required."
]
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("Fatin757/modernbert-job-role-matcher")
# Run inference
sentences = [
'The Research Executive is responsible for analysing and presenting market insights and trends for the purpose of product and experience development. He/She plans and coordinates the research and development activities, develops robust methodologies to gather and process data that provides insights into emerging industry and facilitate knowledge sharing. He is responsible for overseeing the robustness and integrity of the data and information collection processes and for ensuring that programme contents are in line with the market-driven insights.\n\nAnalytical and logical, he is highly proficient in the development and utilisation of research methods. He works with both internal and external stakeholders in directing and executing research and development activities, and is able to effectively communicate and break down complex data to relevant stakeholders.',
'Industry Trends Researcher',
'The Business Development Director/Country Route Development Director/Trade Lane Director/Freight Trade Director is responsible for developing new strategic business opportunities, client bases and managing business resources, including manpower and assets. He/She is also responsible for managing and engaging complex key accounts to develop trade development strategies and to develop strategic customer relationships.\n\nResourceful and analytical, he is required to manage resources and obtain buy-in from internal and external stakeholders. He is also expected to lead a department and make business decisions independently.\n',
]
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.965 |
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
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). |
Port Vessel Navigator |
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 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. |
Room Reservations Manager |
The Site Reliability Engineering Manager drives the strategy for system operations and maintenance, ensuring highly reliable and scalable systems. He/She addresses multi-faceted issues and presents solutions to enhance and improve systems’ health and performance. He champions automation in developing resilient systems. |
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. |
Quality Assurance Engineer |
The Head - Analytics and Customer Insights is responsible for the strategic leadership of all customer and market research and analytics. He/She translates articulated and/or unarticulated business needs and hypotheses into research plans and methods that create business insights. He collaborates with other stakeholders and/or departments to set up the multi-platform customer measurement infrastructure and devises approaches for measuring the effectiveness of content, platforms and campaigns. |
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 |
|---|---|---|
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. |
Room Sales Coordinator |
The Executive (Load Control) determines load sheet requirements with airlines and develops manpower plans to support load control operations. He/She performs regular audits to ensure that the calculation of load limits, distribution and flight performance data complies with Standard Operating Procedures (SOPs). He also recommends enhancements to address areas of non-compliance and improves operational efficiencies. He develops SOPs to ensure alignment with safety and regulatory requirements, and is responsible for manpower deployment, developing on-the-job training programmes and workplace learning plans. |
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 ... |
Data Compliance Officer |
The Customer Service Manager is responsible for managing overall customer service excellence, developing and reviewing process reviews and innovation frameworks and implementing customer service process review initiatives. He/She is also responsible for managing overall service quality and customer relationship management resources, including manpower, internal assets and external vendors. |
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). |
Maritime Craft Handler |
The Senior Executive - Product Management manages the development, launch and ongoing evolution of specific products for the organisation. He/She supports the development of the product's strategic roadmap with key market and research inputs. He collaborates with various teams to implement product improvements and new features by driving ongoing modifications or project implementation. He manages product feedback and translates it into product requirements for implementation by technical teams. He also collaborates with operations teams to understand product operations and scope for improvement. |
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: 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.3274 | 0.9800 |
| 2.0 | 100 | 17.5594 | 4.1967 | 0.9700 |
| 3.0 | 150 | - | 4.1762 | 0.965 |
@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