This commit is contained in:
ahmed531998 2023-04-18 13:13:36 +02:00
parent 723054ca90
commit d5fe9eaced
1 changed files with 7 additions and 3 deletions

View File

@ -23,9 +23,13 @@ class Recommender:
if cosine_similarity(np.array(self.retriever.encode([tag])),
np.array(self.retriever.encode([interest]))) > score:
if self._new(username, material):
print('hi')
self.curr_recommendations[username] = self.curr_recommendations[username].append(material) if username not in self.curr_recommendations else [material]
self.recommended[username] = self.recommended[username].append(False) if username not in self.recommended else [False]
#print('hi')
if username in self.curr_recommendations:
self.curr_recommendations[username].append(material)
self.recommended[username].append(False)
else:
self.curr_recommendations[username] = [material]
self.recommended[username] = [False]
def generate_recommendations(self, username, interests, new_material):
for interest in interests: