Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -75,7 +75,7 @@ def evaluate_response(response: str) -> dict:
|
|
75 |
if re.search(r"reference|source|citation|http", response, re.IGNORECASE):
|
76 |
references = 5
|
77 |
else:
|
78 |
-
references =
|
79 |
|
80 |
# Overall Quality: a naive combination
|
81 |
# We'll penalize if the text is too short or if it's obviously incomplete
|
@@ -83,7 +83,7 @@ def evaluate_response(response: str) -> dict:
|
|
83 |
# If it ends with ... maybe it's incomplete
|
84 |
overall = 0
|
85 |
else:
|
86 |
-
overall = 5 if (relevance >= 4 and depth >= 4 and references >= 4) else
|
87 |
|
88 |
# Summation
|
89 |
total_score = relevance + depth + clarity + references + overall
|
|
|
75 |
if re.search(r"reference|source|citation|http", response, re.IGNORECASE):
|
76 |
references = 5
|
77 |
else:
|
78 |
+
references = 0
|
79 |
|
80 |
# Overall Quality: a naive combination
|
81 |
# We'll penalize if the text is too short or if it's obviously incomplete
|
|
|
83 |
# If it ends with ... maybe it's incomplete
|
84 |
overall = 0
|
85 |
else:
|
86 |
+
overall = 5 if (relevance >= 4 and depth >= 4 and references >= 4) else 0
|
87 |
|
88 |
# Summation
|
89 |
total_score = relevance + depth + clarity + references + overall
|