Commit ·
62f9b6c
1
Parent(s): 52b8525
update
Browse files- README.md +8 -0
- Sample queries.txt +0 -17
- sample_queries.py +26 -0
- test_sample.py +12 -0
README.md
CHANGED
|
@@ -6,6 +6,7 @@ Live App Link: https://huggingface.co/spaces/WalidAlHassan/AEA
|
|
| 6 |
---
|
| 7 |
|
| 8 |
# 🛠️ Full Guideline for Setting Up the FastApi Project on Server
|
|
|
|
| 9 |
# 1. Install Tesseract OCR with Bengali language pack
|
| 10 |
sudo apt install -y tesseract-ocr && sudo apt install -y tesseract-ocr-ben
|
| 11 |
|
|
@@ -31,6 +32,13 @@ python pdf_parsing_n_create_vector_db.py
|
|
| 31 |
# 8. Run project
|
| 32 |
python main_api.py
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
---
|
| 35 |
|
| 36 |
# Must Answer Questions
|
|
|
|
| 6 |
---
|
| 7 |
|
| 8 |
# 🛠️ Full Guideline for Setting Up the FastApi Project on Server
|
| 9 |
+
Open a new terminal then follow the instruction below
|
| 10 |
# 1. Install Tesseract OCR with Bengali language pack
|
| 11 |
sudo apt install -y tesseract-ocr && sudo apt install -y tesseract-ocr-ben
|
| 12 |
|
|
|
|
| 32 |
# 8. Run project
|
| 33 |
python main_api.py
|
| 34 |
|
| 35 |
+
# 9. Auto test using post method
|
| 36 |
+
Open a new terminal in the AEA-10MS directory then run
|
| 37 |
+
|
| 38 |
+
python test_sample.py
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
# Sample query are in the sample_queries.py file
|
| 42 |
---
|
| 43 |
|
| 44 |
# Must Answer Questions
|
Sample queries.txt
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
English: According to Anupam, who is considered a handsome man?
|
| 2 |
-
Bangla: অনুপমের ভাষায় সুপুরুষ কাকে বলা হয়েছে?
|
| 3 |
-
|
| 4 |
-
English: Whom does Anupam refer to as his goddess of fortune?
|
| 5 |
-
Bangla: কাকে অনুপমের ভাগ্যদেবতা বলে উল্লেখ করা হয়েছে?
|
| 6 |
-
|
| 7 |
-
English: What was Kalyani's actual age at the time of marriage?
|
| 8 |
-
Bangla: বিয়ের সময় কল্যাণীর প্রকৃত বয়স কত ছিল?
|
| 9 |
-
|
| 10 |
-
English: What profession was Anupam's father associated with?
|
| 11 |
-
Bangla: অনুপমের পিতা কোন পেশার সঙ্গে যুক্ত ছিলেন?
|
| 12 |
-
|
| 13 |
-
English: From which region was the girl Anupam was about to marry?
|
| 14 |
-
Bangla: অনুপম যাকে বিয়ে করতে যাচ্ছিল সেই মেয়েটি কোন অঞ্চলের ছিল?
|
| 15 |
-
|
| 16 |
-
English: What happened as a result of the misunderstanding about the jewelry?
|
| 17 |
-
Bangla: গহনার ভুল বোঝাবুঝির ফলে কী ঘটে?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sample_queries.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
questions = [
|
| 2 |
+
{
|
| 3 |
+
"english": "According to Anupam, who is considered a handsome man?",
|
| 4 |
+
"bangla": "অনুপমের ভাষায় সুপুরুষ কাকে বলা হয়েছে?"
|
| 5 |
+
},
|
| 6 |
+
{
|
| 7 |
+
"english": "Whom does Anupam refer to as his goddess of fortune?",
|
| 8 |
+
"bangla": "কাকে অনুপমের ভাগ্যদেবতা বলে উল্লেখ করা হয়েছে?"
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
"english": "What was Kalyani's actual age at the time of marriage?",
|
| 12 |
+
"bangla": "বিয়ের সময় কল্যাণীর প্রকৃত বয়স কত ছিল?"
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"english": "What profession was Anupam's father associated with?",
|
| 16 |
+
"bangla": "অনুপমের পিতা কোন পেশার সঙ্গে যুক্ত ছিলেন?"
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"english": "From which region was the girl Anupam was about to marry?",
|
| 20 |
+
"bangla": "অনুপম যাকে বিয়ে করতে যাচ্ছিল সেই মেয়েটি কোন অঞ্চলের ছিল?"
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"english": "What happened as a result of the misunderstanding about the jewelry?",
|
| 24 |
+
"bangla": "গহনার ভুল বোঝাবুঝির ফলে কী ঘটে?"
|
| 25 |
+
}
|
| 26 |
+
]
|
test_sample.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
from sample_queries import questions
|
| 3 |
+
|
| 4 |
+
url = "http://127.0.0.1:5656/ask"
|
| 5 |
+
|
| 6 |
+
for q in questions:
|
| 7 |
+
payload = {"query": q['english']}
|
| 8 |
+
response = requests.post(url, json=payload)
|
| 9 |
+
print(f"English Query: {q['english']}, Response: {response.json()}")
|
| 10 |
+
payload = {"query": q['bangla']}
|
| 11 |
+
response = requests.post(url, json=payload)
|
| 12 |
+
print(f"Bangla Query: {q['bangla']}, Response: {response.json()}")
|