Skip to content

Commit 9b5f427

Browse files
committed
🐛 fixed the comment similarity bug
1 parent fb20baa commit 9b5f427

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def calculateSimilarity(files, pcomment):
6161
commentsWeight = float(userpref['comment_weight']) # In percentage
6262
commentMatrix = irp.createTermDocumentMatrix(corpusComment)
6363
commentMatrix = irp.applyWeighting(commentMatrix, 'idf')
64-
simComments = irp.calculateSimilarity(commentMatrix)
64+
simComments = irp.calculateSimilarityByEuclideanMethod(
65+
commentMatrix, sigma=0.3)
6566
simCode = ((commentsWeight * simComments) +
6667
(100 - commentsWeight) * simCode) / 100
6768

0 commit comments

Comments
 (0)