Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,10 +42,25 @@ def summarize(file, n_words):
|
|
42 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=3000, chunk_overlap=200)
|
43 |
chunks = text_splitter.create_documents([text])
|
44 |
template = '''
|
45 |
-
Your task is to
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
'''
|
50 |
prompt = PromptTemplate(
|
51 |
template=template,
|
|
|
42 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=3000, chunk_overlap=200)
|
43 |
chunks = text_splitter.create_documents([text])
|
44 |
template = '''
|
45 |
+
You are a commentator. Your task is to write a report on an essay.
|
46 |
+
When presented with the essay, come up with interesting questions to ask, and answer each question.
|
47 |
+
Afterward, combine all the information and write a report in the markdown format.
|
48 |
+
|
49 |
+
# Essay:
|
50 |
+
{TEXT}
|
51 |
+
|
52 |
+
# Instructions:
|
53 |
+
## Summarize:
|
54 |
+
In clear and concise language, summarize the key points and themes presented in the essay.
|
55 |
+
|
56 |
+
## Interesting Questions:
|
57 |
+
Generate three distinct and thought-provoking questions that can be asked about the content of the essay. For each question:
|
58 |
+
- After "Q: ", describe the problem
|
59 |
+
- After "A: ", provide a detailed explanation of the problem addressed in the question.
|
60 |
+
- Enclose the ultimate answer in <>.
|
61 |
+
|
62 |
+
## Write a report
|
63 |
+
Using the essay summary and the answers to the interesting questions, create a comprehensive report in Markdown format.
|
64 |
'''
|
65 |
prompt = PromptTemplate(
|
66 |
template=template,
|