Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ UPLOAD_FOLDER = "/tmp/uploads"
|
|
9 |
os.makedirs(UPLOAD_FOLDER, exist_ok=True) # ← Move this AFTER defining UPLOAD_FOLDER
|
10 |
|
11 |
from utils.image_processor import extract_text_from_image
|
|
|
12 |
from utils.xlnet_model import get_similarity_score
|
13 |
from werkzeug.utils import secure_filename
|
14 |
import shutil
|
@@ -52,7 +53,8 @@ async def evaluate(
|
|
52 |
student_text = extract_text_from_image(paths["student"])
|
53 |
reference_text = extract_text_from_image(paths["reference"])
|
54 |
|
55 |
-
score =
|
|
|
56 |
# 🎯 Bonus adjustment
|
57 |
if score >= 75:
|
58 |
score += 20
|
|
|
9 |
os.makedirs(UPLOAD_FOLDER, exist_ok=True) # ← Move this AFTER defining UPLOAD_FOLDER
|
10 |
|
11 |
from utils.image_processor import extract_text_from_image
|
12 |
+
from utils.xlnet_model import get_model_prediction
|
13 |
from utils.xlnet_model import get_similarity_score
|
14 |
from werkzeug.utils import secure_filename
|
15 |
import shutil
|
|
|
53 |
student_text = extract_text_from_image(paths["student"])
|
54 |
reference_text = extract_text_from_image(paths["reference"])
|
55 |
|
56 |
+
score = get_model_prediction(question_text, student_text, reference_text)
|
57 |
+
|
58 |
# 🎯 Bonus adjustment
|
59 |
if score >= 75:
|
60 |
score += 20
|