Skip to content

Commit 98ef1ba

Browse files
authored
Update functions.py
1 parent 60546ae commit 98ef1ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/core/AIfriend/functions.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def key_bert(user_id, database, model_ST, model_W2V, category):
195195
# Cosine similarity calculation (document, keyword)
196196
distances = cosine_similarity(doc_embedding, candidate_embeddings)
197197
keywords = [candidates[index] for index in distances.argsort()[0][-top_n:]]
198-
print(keywords)
198+
# print(keywords)
199199

200200
"""# **Maximal Marginal Relevance**"""
201201

@@ -227,12 +227,12 @@ def key_bert(user_id, database, model_ST, model_W2V, category):
227227
for ctg in category:
228228
for word in keyword_mmr:
229229
score = model_W2V.wv.similarity(ctg, word)
230-
print(ctg, word, score)
230+
# print(ctg, word, score)
231231

232232
if score > 0.8 and max_score < score:
233233
max_score = score
234234
max_ctg = ctg
235235
max_kw = word
236236

237-
print(max_ctg, max_kw, max_score)
237+
# print(max_ctg, max_kw, max_score)
238238
return max_ctg

0 commit comments

Comments
 (0)