🚀 句子相似度模型項目
本項目基於 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 年成立以來保持兩位數的年增長率,正在不斷擴大團隊。該職位主要負責將公司的會計系統提升到新水平,並管理與上市母公司的集成工作,同時列出了職位職責、最低任職資格等內容。
通過本模型,可以計算源句子與這些待比較句子之間的相似度,從而為相關的文本匹配、信息檢索等應用提供支持。