@@ -35,7 +35,7 @@ Crypto friendly, professional, innovative
35
35
36
36
Check our [ Presentation] ( https://youtu.be/aX_DIQi7F48 )
37
37
38
- # Contributor Guide
38
+ # Contributor Guide
39
39
40
40
** Revolutination Project Contributor Guide**
41
41
@@ -46,8 +46,8 @@ Welcome to the Revolutination community! We appreciate your interest in contribu
46
46
1 . [ Getting Started] ( #getting-started )
47
47
2 . [ Code of Conduct] ( #code-of-conduct )
48
48
3 . [ How to Contribute] ( #how-to-contribute )
49
- - [ Reporting Issues] ( #reporting-issues )
50
- - [ Submitting Pull Requests] ( #submitting-pull-requests )
49
+ - [ Reporting Issues] ( #reporting-issues )
50
+ - [ Submitting Pull Requests] ( #submitting-pull-requests )
51
51
4 . [ Development Setup] ( #development-setup )
52
52
5 . [ Coding Standards] ( #coding-standards )
53
53
6 . [ Documentation] ( #documentation )
@@ -159,9 +159,9 @@ Revolutination is a smart, simple, yet powerful product that can unlock the bene
159
159
160
160
Join us at [ Discord] ( https://discord.gg/4ndeMBx3 )
161
161
162
- # Revolutination AI Agent
162
+ # Revolutination AI Agent
163
163
164
- ## Tutorials:
164
+ ## Tutorials:
165
165
166
166
# Recommendation
167
167
@@ -190,22 +190,22 @@ user_similarity = cosine_similarity(user_service_matrix)
190
190
def generate_recommendations (user_id , top_n = 5 ):
191
191
# Get index of the user
192
192
user_index = user_service_matrix.index.get_loc(user_id)
193
-
193
+
194
194
# Calculate similarity scores with other users
195
195
similarity_scores = user_similarity[user_index]
196
-
196
+
197
197
# Get top similar users
198
198
top_similar_users = similarity_scores.argsort()[:- top_n- 1 :- 1 ]
199
-
199
+
200
200
# Get services rated by similar users
201
201
services_rated_by_similar_users = user_service_matrix.iloc[top_similar_users].dropna(axis = 1 )
202
-
202
+
203
203
# Calculate average rating for each service
204
204
service_avg_ratings = services_rated_by_similar_users.mean()
205
-
205
+
206
206
# Sort services based on average ratings
207
207
recommended_services = service_avg_ratings.sort_values(ascending = False )[:top_n]
208
-
208
+
209
209
return recommended_services
210
210
211
211
# Generate recommendations for a user
@@ -264,15 +264,15 @@ for pattern in patterns:
264
264
def chatbot (text ):
265
265
doc = nlp(text)
266
266
matches = matcher(doc)
267
-
267
+
268
268
for match_id, start, end in matches:
269
269
if nlp.vocab.strings[match_id] == " GREETING" :
270
270
return responses[" greeting" ]
271
271
elif nlp.vocab.strings[match_id] == " RECOMMENDATION" :
272
272
return responses[" recommendation" ]
273
273
elif nlp.vocab.strings[match_id] == " GOODBYE" :
274
274
return responses[" goodbye" ]
275
-
275
+
276
276
return " I'm sorry, I didn't understand. Can you please rephrase your query?"
277
277
278
278
# Sample conversation
@@ -293,6 +293,7 @@ print("Chatbot: ", chatbot_response)
293
293
```
294
294
295
295
Output:
296
+
296
297
```
297
298
User: Hello
298
299
Chatbot: Hello! How can I assist you today?
@@ -321,10 +322,10 @@ model.fit(data)
321
322
def detect_anomaly (user_data ):
322
323
# Predict anomaly score
323
324
anomaly_score = model.decision_function(user_data)
324
-
325
+
325
326
# Set anomaly threshold
326
327
threshold = - 0.5
327
-
328
+
328
329
# Check if anomaly score exceeds threshold
329
330
if anomaly_score < threshold:
330
331
# Send alert message
0 commit comments