Skip to content

Commit fa91225

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2479eef commit fa91225

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

machine_learning/cosine_similarity.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import numpy as np
33
import spacy
44

5+
56
class CosineSimilarity:
67
"""
78
Cosine Similarity Algorithm
@@ -179,5 +180,7 @@ def cosine_similarity_percentage(self, text1: str, text2: str) -> float:
179180
text1 = "The biggest Infrastructure in the World is Burj Khalifa"
180181
text2 = "The name of the talllest Tower in the world is Burj Khalifa"
181182

182-
similarity_percentage = CosineSimilarity().cosine_similarity_percentage(text1, text2)
183+
similarity_percentage = CosineSimilarity().cosine_similarity_percentage(
184+
text1, text2
185+
)
183186
print(f"Cosine Similarity: {similarity_percentage:.2f}%")

0 commit comments

Comments
 (0)