Update app.py
Browse files
app.py
CHANGED
@@ -96,8 +96,11 @@ def get_refs(docs, res):
|
|
96 |
doc = docs[i].to_dict()
|
97 |
ref_id = doc['meta']['ref_id']
|
98 |
if ref_id in ref_ids:
|
|
|
|
|
|
|
99 |
result_str += "**Ref. " + str(ref_id) + " [" + doc['meta']['country'] + " " + doc['meta']['document'] + ' p' + str(doc['meta']['page']) + "]:** " + "*'" + doc['content'] + "'*<br> <br>" # Add <br> for a line break
|
100 |
-
|
101 |
return result_str
|
102 |
|
103 |
# define a special function for putting the prompt together (as we can't use haystack)
|
|
|
96 |
doc = docs[i].to_dict()
|
97 |
ref_id = doc['meta']['ref_id']
|
98 |
if ref_id in ref_ids:
|
99 |
+
if doc['meta']['document'] == "Supplementary":
|
100 |
+
result_str += "**Ref. " + str(ref_id) + " [" + doc['meta']['country'] + " " + doc['meta']['document'] + ':' + doc['meta']['file_name'] + ' p' + str(doc['meta']['page']) + "]:** " + "*'" + doc['content'] + "'*<br> <br>" # Add <br> for a line break
|
101 |
+
else:
|
102 |
result_str += "**Ref. " + str(ref_id) + " [" + doc['meta']['country'] + " " + doc['meta']['document'] + ' p' + str(doc['meta']['page']) + "]:** " + "*'" + doc['content'] + "'*<br> <br>" # Add <br> for a line break
|
103 |
+
|
104 |
return result_str
|
105 |
|
106 |
# define a special function for putting the prompt together (as we can't use haystack)
|