🚀 句子相似度模型项目
本项目基于 sentence-transformers
,可用于句子相似度计算和特征提取,能有效处理各类文本信息,为相关领域的应用提供有力支持。
📦 模型信息
属性 |
详情 |
模型类型 |
基于 sentence-transformers/paraphrase-mpnet-base-v2 的微调模型 |
训练数据规模 |
6241 |
损失函数 |
余弦相似度损失(CosineSimilarityLoss) |
💻 使用示例
基础用法
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('your_model_path')
source_sentence = "Professional SummarySeeking a position as an electrical engineer at the management level. Licensed Professional Electrical Engineer with over fifteen years of extensive and progressive professional experience in the Mass Transit and Electric Power Utility Industries. Currently serve as a lead engineer and technical expert for supporting and coordinating multiple complex electrical engineering projects for all Pepco's transmission and distribution substations."
sentences = ["Centurion Consulting Group is looking for a Software Development Manager This is a DIRECT HIRE and requires a local candidate in Mclean, VA. This role is a hybrid role.", "Position: Cost Accountant Reports to: President The CompanyWith double-digit annual growth rate since our founding in 1998, we are continuing to expand our dynamic team. As a contract manufacturer for in-vitro diagnostics, we make sure great products get made. The Natech learning organization develops collaborative problem solvers who help our customers launch and scale new medical devices."]
source_embedding = model.encode(source_sentence)
sentence_embeddings = model.encode(sentences)
高级用法
import concurrent.futures
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('your_model_path')
source_sentence = "Professional SummarySeeking a position as an electrical engineer at the management level. Licensed Professional Electrical Engineer with over fifteen years of extensive and progressive professional experience in the Mass Transit and Electric Power Utility Industries. Currently serve as a lead engineer and technical expert for supporting and coordinating multiple complex electrical engineering projects for all Pepco's transmission and distribution substations."
sentences = ["Centurion Consulting Group is looking for a Software Development Manager This is a DIRECT HIRE and requires a local candidate in Mclean, VA. This role is a hybrid role.", "Position: Cost Accountant Reports to: President The CompanyWith double-digit annual growth rate since our founding in 1998, we are continuing to expand our dynamic team. As a contract manufacturer for in-vitro diagnostics, we make sure great products get made. The Natech learning organization develops collaborative problem solvers who help our customers launch and scale new medical devices."]
def encode_sentence(sentence):
return model.encode(sentence)
with concurrent.futures.ThreadPoolExecutor() as executor:
sentence_embeddings = list(executor.map(encode_sentence, sentences))
source_embedding = model.encode(source_sentence)
📚 详细文档
源句子详情
源句子是一份电气工程师的专业履历,涵盖了其职业目标、工作经验、项目管理、沟通能力等多个方面的信息,展示了其在电气工程项目中的丰富经验和专业技能。
待比较句子详情
- 第一句:Centurion 咨询集团正在招聘软件开发经理,该职位为直接招聘,要求应聘者为弗吉尼亚州麦克莱恩市的本地人员,工作模式为混合办公。详细说明了该职位的主要职责、基本任职资格等信息。
- 第二句:招聘成本会计师,该公司自 1998 年成立以来保持两位数的年增长率,正在不断扩大团队。该职位主要负责将公司的会计系统提升到新水平,并管理与上市母公司的集成工作,同时列出了职位职责、最低任职资格等内容。
通过本模型,可以计算源句子与这些待比较句子之间的相似度,从而为相关的文本匹配、信息检索等应用提供支持。