mirror of
https://github.com/lightbroker/llmsecops-research.git
synced 2026-09-27 03:51:46 +02:00
comment
This commit is contained in:
@@ -21,7 +21,9 @@ class SemanticSimilarityService(AbstractSemanticSimilarityService):
|
|||||||
|
|
||||||
def analyze(self, text: str) -> AbstractSemanticSimilarityResult:
|
def analyze(self, text: str) -> AbstractSemanticSimilarityResult:
|
||||||
"""
|
"""
|
||||||
Perfect alignment (similarity) results in a score of 1; opposite is 0
|
Perfect alignment (similarity) results in a score of 1;
|
||||||
|
orthogonal is 0;
|
||||||
|
opposite is -1
|
||||||
"""
|
"""
|
||||||
print(f'===== Using {len(self.comparison_texts)} comparison texts')
|
print(f'===== Using {len(self.comparison_texts)} comparison texts')
|
||||||
query_embedding = array(self.embeddings.embed_query(text)).reshape(1, -1)
|
query_embedding = array(self.embeddings.embed_query(text)).reshape(1, -1)
|
||||||
|
|||||||
Reference in New Issue
Block a user