bikram-riverus commited on
Commit
faab731
1 Parent(s): e1572d2
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -8,7 +8,9 @@ nlp = spacy.load("en_core_web_sm")
8
  model = SentenceTransformer("rufimelo/Legal-BERTimbau-sts-base")
9
 
10
  def compute_similarity(left_text: str, right_text: str) -> np.ndarray:
 
11
  embeddings = model.encode([left_text, right_text])
 
12
  similarity = cosine_similarity(embeddings[: 1], embeddings[1 :])
13
 
14
  return similarity
 
8
  model = SentenceTransformer("rufimelo/Legal-BERTimbau-sts-base")
9
 
10
  def compute_similarity(left_text: str, right_text: str) -> np.ndarray:
11
+ print("computing embeddings...")
12
  embeddings = model.encode([left_text, right_text])
13
+ print("computing similarity...")
14
  similarity = cosine_similarity(embeddings[: 1], embeddings[1 :])
15
 
16
  return similarity