Views
No views yet
sushanrai/CVE_BERT_DMSVgoogle-bert/bert-base-uncasedgoogle-bert/bert-base-uncased using the SentenceTransformers framework. It is trained on Common Vulnerabilities and Exposures (CVE) data for semantic search and similarity tasks. The model maps CVE descriptions into dense vector embeddings to facilitate information retrieval, similarity detection, and clustering.1import torch
2from sentence_transformers import SentenceTransformer, util
3
4# Load the model and embeddings
5device = "cuda" if torch.cuda.is_available() else "cpu"
6model = SentenceTransformer("sushanrai/CVE_BERT_DMSV", device=device)
7data = torch.load("cve_embeddings.pt")
8cve_embeddings = data["embeddings"]
9cve_texts = data["cve_texts"]
10
11# Encode a query
12query = "buffer overflow in FTP server"
13query_embedding = model.encode(query, convert_to_tensor=True)
14
15# Semantic search
16cos_scores = util.pytorch_cos_sim(query_embedding, cve_embeddings)[0]
17top_results = torch.topk(cos_scores, k=5)
18
19for score, idx in zip(top_results.values, top_results.indices):
20 print(f"CVE: {cve_texts[idx]}, Score: {score:.4f}")MultipleNegativesRankingLoss, a contrastive loss suitable for semantic search and retrieval tasks. This enables the model to learn meaningful vector representations that place similar descriptions closer in vector space.@misc{sushanrai2025cvebert,
title={CVE-BERT-DMSV: A SentenceTransformer Model for Semantic Search over CVEs},
author={HACKDMSV},
year={2025},
url={https://huggingface.co/sushanrai/CVE_BERT_DMSV}
}sentence-transformers cve cybersecurity semantic-search bert vulnerability