Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,22 +4,14 @@ from difflib import SequenceMatcher
|
|
| 4 |
|
| 5 |
# List of commands
|
| 6 |
commands = [
|
| 7 |
-
"
|
| 8 |
-
" سم
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
" سم بلاک کی انکوائری",
|
| 13 |
-
" سم کا شمارہ غلط",
|
| 14 |
-
"موبائل پر مختلف پیکیجز کی تفصیلات انٹرنیٹ پیکیج",
|
| 15 |
-
"بجٹ کے مطابق ایک سستا پیکیج",
|
| 16 |
-
" چالان جمع کرنا",
|
| 17 |
-
"اپنے چالان کی رقم جمع",
|
| 18 |
-
|
| 19 |
-
|
| 20 |
]
|
| 21 |
replies = [
|
| 22 |
-
"کیا آپ پیکیجز کی معلومات حاصل کرنا چاہتے ہیں؟","کیا آپ سم
|
| 23 |
"کیا آپ چالان جمع کروانا چاہتے ہیں؟"
|
| 24 |
]
|
| 25 |
# Function to find the most similar command
|
|
@@ -33,14 +25,7 @@ def find_most_similar_command(statement, command_list):
|
|
| 33 |
if similarity > highest_similarity:
|
| 34 |
highest_similarity = similarity
|
| 35 |
best_match = command
|
| 36 |
-
|
| 37 |
-
reply=replies[1]
|
| 38 |
-
elif i>6 and i<9:
|
| 39 |
-
reply=replies[2]
|
| 40 |
-
elif i>8 and i<10:
|
| 41 |
-
reply=replies[3]
|
| 42 |
-
else:
|
| 43 |
-
reply=replies[0]
|
| 44 |
i+=1
|
| 45 |
|
| 46 |
return best_match,reply
|
|
|
|
| 4 |
|
| 5 |
# List of commands
|
| 6 |
commands = [
|
| 7 |
+
"نمائندے ایجنٹ نمائندہ"
|
| 8 |
+
" سم ایکٹیویٹ ",
|
| 9 |
+
" سم بلاک بند ",
|
| 10 |
+
"موبائل پیکیجز انٹرنیٹ پیکیج",
|
| 11 |
+
" چالان جمع ",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
]
|
| 13 |
replies = [
|
| 14 |
+
"کیا آپ پیکیجز کی معلومات حاصل کرنا چاہتے ہیں؟","کیا آپ سم بلاک کرنا چاہتے ہیں؟","کیا آپ سم ایکٹیویٹ کرنا چاہتے ہیں؟" ,"کیا آپ نمائندے سے بات کرنا چاہتے ہیں؟",
|
| 15 |
"کیا آپ چالان جمع کروانا چاہتے ہیں؟"
|
| 16 |
]
|
| 17 |
# Function to find the most similar command
|
|
|
|
| 25 |
if similarity > highest_similarity:
|
| 26 |
highest_similarity = similarity
|
| 27 |
best_match = command
|
| 28 |
+
reply=replies[i]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
i+=1
|
| 30 |
|
| 31 |
return best_match,reply
|