Skip to content

Commit

Permalink
remove print
Browse files Browse the repository at this point in the history
  • Loading branch information
ofilangi committed Jan 20, 2025
1 parent b388890 commit 4dc80b6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/albert_igepp.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"encodeur" : "sentence-transformers/all-MiniLM-L6-v2",
"threshold_similarity_tag_chunk" : 0.60,
"threshold_similarity_tag" : 0.95,
"threshold_similarity_tag" : 0.15,
"batch_size" : 32,

"populate_owl_tag_embeddings" : {
Expand Down
2 changes: 1 addition & 1 deletion config/planteome-demo-only-TO-0000394.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"encodeur" : "sentence-transformers/all-MiniLM-L6-v2",
"threshold_similarity_tag_chunk" : 0.10,
"threshold_similarity_tag_chunk" : 0.70,
"threshold_similarity_tag" : 0.80,
"batch_size" : 32,

Expand Down
6 changes: 0 additions & 6 deletions llm_semantic_annotator/similarity/model_embedding_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,13 @@ def compare_tags_with_chunks(self, tag_embeddings, chunks_embeddings):

for doi, chunks_embedding in tqdm(list(chunks_embeddings.items())):
chunks_matrix = torch.stack(chunks_embedding).to(device)
print("----------------####################################-----------")
print(doi,chunks_matrix)
print("------------TTTT---------------")
print(tag_embeddings_matrix)
print("---------------------------")
# Calcul vectorisé des similarités sur GPU
# Normaliser les vecteurs pour le calcul de la similarité cosinus
chunks_norm = F.normalize(chunks_matrix, p=2, dim=1)
tags_norm = F.normalize(tag_embeddings_matrix, p=2, dim=1)

# Calcul de la similarité cosinus
similarities = torch.mm(chunks_norm, tags_norm.t())
print(similarities)
max_similarities, _ = torch.max(similarities, dim=0)

# Filtrage des similarités au-dessus du seuil
Expand Down

0 comments on commit 4dc80b6

Please sign in to comment.