Views
No views yet
thenlper/gte-base optimized for Linux Command Intent and Semantic Similarity, following the methodology of the CmdCaliper research paper (Empirical Software Engineering & Cybersecurity).SentenceTransformer)thenlper/gte-base1from sentence_transformers import SentenceTransformer, util
2
3# Load model
4model = SentenceTransformer("Ameya-Kawade/cmdcaliper")
5
6# Commands to compare
7commands = [
8 "find /var/log -type f -name '*.log'",
9 "ls -la /var/log/*.log",
10 "apt-get update && apt-get upgrade -y",
11 "docker system prune -a --volumes",
12]
13
14# Compute embeddings
15embeddings = model.encode(commands, normalize_embeddings=True)
16
17# Compute similarity matrix
18similarity = util.cos_sim(embeddings, embeddings)
19print(similarity)