Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,11 +71,11 @@ def summarize_data(docs,llm_model,chain_type='refine'):
|
|
| 71 |
output_key="output_text",
|
| 72 |
)
|
| 73 |
summary = chain({"input_documents": docs}, return_only_outputs=True)
|
| 74 |
-
output_text = summary["output_text"].replace('\n
|
| 75 |
|
| 76 |
consice_sumary = re.search("CONCISE SUMMARY:.*\.*$", output_text).group(0)
|
| 77 |
dash_id = consice_sumary.find('-')
|
| 78 |
-
return consice_sumary[:dash_id]
|
| 79 |
# matches = re.finditer(regex, output_text, re.DOTALL)
|
| 80 |
# for matchNum, match in enumerate(matches, start=1):
|
| 81 |
# for groupNum in range(0, len(match.groups())):
|
|
|
|
| 71 |
output_key="output_text",
|
| 72 |
)
|
| 73 |
summary = chain({"input_documents": docs}, return_only_outputs=True)
|
| 74 |
+
output_text = summary["output_text"].replace('\n',' ')
|
| 75 |
|
| 76 |
consice_sumary = re.search("CONCISE SUMMARY:.*\.*$", output_text).group(0)
|
| 77 |
dash_id = consice_sumary.find('-')
|
| 78 |
+
return consice_sumary[:dash_id].replace(' ','\n')
|
| 79 |
# matches = re.finditer(regex, output_text, re.DOTALL)
|
| 80 |
# for matchNum, match in enumerate(matches, start=1):
|
| 81 |
# for groupNum in range(0, len(match.groups())):
|