-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathomniAns.ai.yaml
More file actions
485 lines (395 loc) · 32.1 KB
/
omniAns.ai.yaml
File metadata and controls
485 lines (395 loc) · 32.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
version: "0.1"
default_model:
model: azure/welight-4o-mini
flow:
insight_analyst:
action: llm
prompt:
- text: |
You are an expert in brainstorming, analyzing, and researching. You are given a research question:
{{ message }}
Your task is to generate a list of sub-questions that are related to this and will help in building a professional research thesis.
structural_outlining:
action: llm
prompt:
- text: |
You are professional. You are in charge of structuring an essay that answers this question:
{{ message }}
Your colleague has brainstormed a list of sub-questions related to this essay. Take advantage of these and structure your argument. Your output should be a list of paragraphs that include:
1) What the paragraph is for.
2) What evidence is needed.
3) How is the argument developed.
Do not generate anything else except the list.
List of sub-questions to explore
{{ insight_analyst.result }}
An Example Output Should be:
[
{
"section": "Introduction",
"purpose": "To introduce the topic and provide a thesis statement.",
"evidence_needed": "General background information on digitization and simulation, including definitions and context.",
"argument_development": "Explain the increasing relevance of digitizing and simulating the physical world, highlighting its significance in modern technology and society."
},
{
"section": "Benefits of Digitizing and Simulating the Physical World",
"purpose": "To outline the key advantages of digitization and simulation.",
"evidence_needed": "Case studies, statistics, and expert opinions demonstrating benefits like improved efficiency, accuracy, and cost savings.",
"argument_development": "Detail specific examples where digitization has led to significant improvements in various industries, such as manufacturing, healthcare, and urban planning."
},
{
"section": "Improvement in Efficiency and Productivity",
"purpose": "To discuss how digitization enhances operational efficiency and productivity.",
"evidence_needed": "Examples from industries that have successfully implemented digitization, along with productivity metrics and performance reports.",
"argument_development": "Explain how digital tools and simulations streamline processes, reduce errors, and enable faster decision-making."
},
{
"section": "Potential Risks and Challenges",
"purpose": "To address the potential downsides of digitizing the physical world.",
"evidence_needed": "Analysis of data security issues, technological dependency, and case studies of digitization failures.",
"argument_development": "Present a balanced view by acknowledging the risks and proposing solutions to mitigate these challenges."
},
{
"section": "Contribution to Scientific Research and Innovation",
"purpose": "To explore how digitization drives scientific advancements and innovation.",
"evidence_needed": "Examples of digital simulations in scientific research, technological breakthroughs, and innovation metrics.",
"argument_development": "Illustrate the role of digital simulations in modeling complex systems, accelerating research, and fostering innovation."
},
{
"section": "Economic Implications",
"purpose": "To examine the economic impact of digitization.",
"evidence_needed": "Economic reports, market analysis, and expert forecasts on the financial benefits and job market shifts due to digitization.",
"argument_development": "Discuss how digitization contributes to economic growth, creates new job opportunities, and transforms existing industries."
},
{
"section": "Impact on Environmental Sustainability",
"purpose": "To assess how digitization affects environmental sustainability.",
"evidence_needed": "Environmental studies, carbon footprint analyses, and examples of sustainable practices enabled by digitization.",
"argument_development": "Explain how digital tools and simulations help optimize resource usage, reduce waste, and promote sustainable practices."
},
{
"section": "Role in Education and Training",
"purpose": "To explore the impact of digitization on education and training.",
"evidence_needed": "Studies on digital learning tools, training program effectiveness, and educational outcomes.",
"argument_development": "Highlight how digitization enhances learning experiences, provides access to new educational resources, and improves training efficiency."
},
{
"section": "Conclusion",
"purpose": "To summarize the main arguments and reinforce the thesis statement.",
"evidence_needed": "Recap of key points discussed in the essay.",
"argument_development": "Conclude by emphasizing the overall benefits of digitizing and simulating the physical world while acknowledging the importance of addressing associated challenges."
}
]
Put the output between <output> and </output> tags.
extract_outlining:
action: extract_xml_tag
tag: output
text:
link: structural_outlining.result
extract_pdf_texts:
for: filepath
in:
var: pdf_filepaths
flow:
# For each filepath, `extract_pdf_text` extracts text from PDF files
# the result is saved as a list in `extract_pdf_texts`
extractor:
action: extract_pdf_text
file:
var: filepath
summarize:
action: llm
prompt:
- text: |
Summarize the core idea and essential information of the pdf structurally.
{{ extractor.full_text }}
restructurer:
action: llm
prompt:
- text: |
You are a professor from Oxford. You are in charge of revising the first draft of a structure of an essay written by a bright student. The student has not read anything before, so you will pay attention to combining the context into the structure to update a better one.
Make sure that nothing other than the new structure is outputed.
The question to answer is:
{{message}}
Your student has provided you with the following outlining structure:
{{extract_outlining.result}}
The summarised context you will use to revise & upgrade the structure:
{% for pdf_result in extract_pdf_texts %}
{{pdf_result.summarize.result}}
{% endfor %}
Sample Outlining Structure:
[
{
"section": "Introduction",
"purpose": "To introduce the topic and provide a thesis statement.",
"evidence_needed": "General background information on the history and cultural contexts of ancient texts, including definitions and context.",
"argument_development": "Explain the significance of understanding the historical and cultural contexts of ancient texts, highlighting the potential risks and benefits of citing them without full comprehension."
},
{
"section": "Benefits of Citing Ancient Texts Without Full Understanding",
"purpose": "To outline the key advantages of citing ancient texts without fully understanding their context or meaning.",
"evidence_needed": "Case studies, expert opinions, and historical examples demonstrating how citing ancient texts has led to significant breakthroughs or challenges in various fields.",
"argument_development": "Detail specific instances where citing ancient texts without full understanding has contributed to the development of new ideas or perspectives, while acknowledging potential limitations."
},
{
"section": "Limitations and Challenges of Citing Ancient Texts Without Full Understanding",
"purpose": "To discuss the drawbacks of citing ancient texts without fully understanding their context or meaning.",
"evidence_needed": "Examples of how cultural biases have influenced interpretations of ancient texts, along with case studies of unsuccessful attempts to interpret them without full comprehension.",
"argument_development": "Explain how scholars' preconceptions and limitations in understanding the historical and cultural contexts of ancient texts can lead to misinterpretations or misunderstandings."
},
{
"section": "Power Dynamics and Cultural Heritage",
"purpose": "To explore the role of power dynamics in shaping the way ancient texts are interpreted and used.",
"evidence_needed": "Examples of how colonialism, imperialism, or other forms of cultural domination have influenced the interpretation and use of ancient texts, along with case studies of disputes over ownership or control.",
"argument_development": "Discuss how power dynamics affect the transmission, translation, and dissemination of ancient texts throughout history, highlighting potential ethical implications."
},
{
"section": "Methods for Better Understanding Ancient Texts",
"purpose": "To explore methods and tools available for scholars to better understand the context and meaning of ancient texts.",
"evidence_needed": "Notable advances in archaeology, epigraphy, or other relevant fields that have improved our understanding of ancient contexts, along with examples of interdisciplinary approaches.",
"argument_development": "Highlight the importance of developing new methods and tools for scholars to better understand ancient texts, including the potential role of digital humanities and computational methods."
},
{
"section": "Conclusion",
"purpose": "To summarize the main arguments and reinforce the thesis statement.",
"evidence_needed": "Recap of key points discussed in the essay.",
"argument_development": "Conclude by emphasizing the importance of understanding the historical and cultural contexts of ancient texts while acknowledging the potential benefits and limitations of citing them without full comprehension."
}
]
Sample Question:
"Explain the pros and cons practices of citing ancient texts without fully understanding their context or meaning"
Sample Summarised Context:
**Introduction**
* The author, Thomas Hobbes, introduces his work on Leviathan
* He argues that his speaking with Moses is unique compared to other prophets, such as Samuel and Abraham
* He grounds his doctrine in reason and natural inclinations of mankind, rather than ancient texts
**Challenges to the Doctrine**
* Hobbes anticipates challenges from those who hold contrary opinions
* He acknowledges that readers may be distracted by searching for objections to what they have already read
* He emphasizes that his doctrine is based on reason and Scripture, making it immune to attacks from ancient writers or philosophers
**Ancient Texts**
* Hobbes critiques the practice of citing ancient texts without fully understanding their context or meaning
* He argues that reverence for antiquity is not a valid argument in favor of an idea
* He suggests that the value of ancient authors lies in their contributions to truth, rather than their age
**Conclusion**
* Hobbes concludes that his doctrine does not contradict God's word or good manners
* He suggests that it may be beneficial to print and teach his work in universities, as a means of promoting civil and moral doctrine
* He hopes that his work will contribute to the promotion of peace and stability by providing a clear understanding of the mutual relationship between protection and obedience.
Sample Output:
[
{
"section": "Introduction",
"purpose": "To introduce the topic and provide a thesis statement.",
"evidence_needed": "General background information on the historical and cultural contexts of ancient texts, including definitions and context.",
"argument_development": "Explain the significance of understanding the historical and cultural contexts of ancient texts, highlighting the potential risks and benefits of citing them without full comprehension. Reference Hobbes' approach to grounding his doctrine in reason and natural inclinations rather than ancient texts."
},
{
"section": "Hobbes' Critique of Ancient Texts",
"purpose": "To outline Hobbes' views on the practice of citing ancient texts without fully understanding their context or meaning.",
"evidence_needed": "Specific examples from Hobbes' work where he critiques reverence for antiquity and emphasizes the importance of reason and Scripture.",
"argument_development": "Detail Hobbes' argument that the value of ancient authors lies in their contributions to truth rather than their age. Discuss how Hobbes uses his critique to support his doctrine."
},
{
"section": "Benefits of Citing Ancient Texts Without Full Understanding",
"purpose": "To outline the key advantages of citing ancient texts without fully understanding their context or meaning.",
"evidence_needed": "Case studies, expert opinions, and historical examples demonstrating how citing ancient texts has led to significant breakthroughs or challenges in various fields.",
"argument_development": "Detail specific instances where citing ancient texts without full understanding has contributed to the development of new ideas or perspectives, while acknowledging potential limitations. Highlight potential benefits mentioned by Hobbes."
},
{
"section": "Limitations and Challenges of Citing Ancient Texts Without Full Understanding",
"purpose": "To discuss the drawbacks of citing ancient texts without fully understanding their context or meaning.",
"evidence_needed": "Examples of how cultural biases have influenced interpretations of ancient texts, along with case studies of unsuccessful attempts to interpret them without full comprehension.",
"argument_development": "Explain how scholars' preconceptions and limitations in understanding the historical and cultural contexts of ancient texts can lead to misinterpretations or misunderstandings. Use Hobbes' critique as a case point for potential pitfalls."
},
{
"section": "Power Dynamics and Cultural Heritage",
"purpose": "To explore the role of power dynamics in shaping the way ancient texts are interpreted and used.",
"evidence_needed": "Examples of how colonialism, imperialism, or other forms of cultural domination have influenced the interpretation and use of ancient texts, along with case studies of disputes over ownership or control.",
"argument_development": "Discuss how power dynamics affect the transmission, translation, and dissemination of ancient texts throughout history, highlighting potential ethical implications. Mention Hobbes' hope for his work to promote peace and stability."
},
{
"section": "Methods for Better Understanding Ancient Texts",
"purpose": "To explore methods and tools available for scholars to better understand the context and meaning of ancient texts.",
"evidence_needed": "Notable advances in archaeology, epigraphy, or other relevant fields that have improved our understanding of ancient contexts, along with examples of interdisciplinary approaches.",
"argument_development": "Highlight the importance of developing new methods and tools for scholars to better understand ancient texts, including the potential role of digital humanities and computational methods. Mention Hobbes' emphasis on reason and Scripture as a model."
},
{
"section": "Conclusion",
"purpose": "To summarize the main arguments and reinforce the thesis statement.",
"evidence_needed": "Recap of key points discussed in the essay.",
"argument_development": "Conclude by emphasizing the importance of understanding the historical and cultural contexts of ancient texts while acknowledging the potential benefits and limitations of citing them without full comprehension. Reinforce Hobbes' contributions to the discussion."
}
]
Put the output between <output> and </output> tags.
extract_restructurer:
action: extract_xml_tag
tag: output
text:
link: restructurer.result
restructurerTojson:
action: load_json
json_string:
var: extract_restructurer.result
essay_writer:
for: para_struct
in:
link: restructurerTojson
flow:
key_gen:
action: llm
prompt:
- text: |
The paragraph structure below is a part of a bigger essay, to answer the question {{message}}
Paragraph Structure:
{{para_struct}}
For the paragraph, generate a list of keywords that could be used to search up to paragraphs in the PDFs & knowledge base that are relevant to this paragraph. Focus on the evidence needed and how they will be incorporated for a better response.
Sample Input:
{
"section": "Role in Education and Training",
"purpose": "To explore the impact of digitization on education and training.",
"evidence_needed": "Studies on digital learning tools, training program effectiveness, and educational outcomes.",
"argument_development": "Highlight how digitization enhances learning experiences, provides access to new educational resources, and improves training efficiency."
}
Sample Output:
[
"Digital Learning Tools",
"Training Program Effectiveness",
"Educational Outcomes",
"Technology in Education",
"Online Learning Tools",
"Enhanced Learning Experiences",
"Access to Educational Resources",
"Training Efficiency",
"Educational Technology",
"Digital Transformation in Training"
]
Put the output between <output> and </output> tags.
extract_keywords:
action: extract_xml_tag
tag: output
text:
link: key_gen.result
retrieval:
action: retrieve
k: 10
documents:
lambda: |
[{"title": page.title, "page_num": page.page_number, "text": paragraph}
for flow in extract_pdf_texts
for page in flow.extractor.pages
for paragraph in page.text.split('\n')]
texts:
lambda: |
[paragraph
for flow in extract_pdf_texts
for page in flow.extractor.pages
for paragraph in page.text.split('\n')]
query:
link: extract_keywords.result
reranking:
action: rerank
k: 3
documents:
link: retrieval.result
texts:
lambda: |
[paragraph.text
for paragraph in retrieval.result]
query:
link: extract_keywords.result
para_writer:
action: llm
prompt:
- text: |
You are in charge of writing a paragraph as part of a longer essay, focusing on {{message}}. Make Sure the paragraph you write is detailed and compelling. Write at least 200 words if not more.
You are given the paragraph's structure and severals paragraphs in PDFs as important context. Use the context to fill in the structure to write a professional paragraph, including in-text citations to cite important facts or arguments from the sources. Make sure it is detailed and well-written to beat the Oxford standard.
For each in-text citation, use the provided page number, article name, and author's name. Additionally, generate references corresponding to the in-text citations.
Paragraph Structure: {{para_struct}}
Below infomation are provided in order for each paragraph of the context:
titles:
{% for paragraph in reranking.result %}
{{paragraph.title}}
{% endfor %}
page numbers:
{% for paragraph in reranking.result %}
{{paragraph.page_num}}
{% endfor %}
texts:
{% for paragraph in reranking.result %}
{{paragraph.text}}
{% endfor %}
Output Structure:
{"Paragraph": paragraph, "References": ["Reference 1", "Reference 2", ...]}
Make sure to use in text citations in the following structure: (Åstebro, Thomas, and Samir Elhedhli, 2006, p.395)
Sample Output:
{"Paragraph": "In evaluating the potential success of early-stage ventures, the application of simple decision heuristics has proven to be significantly effective. According to Åstebro and Elhedhli, these heuristics can streamline the decision-making process and enhance forecasting accuracy for commercial outcomes. Their study, published in Management Science, demonstrated that these straightforward methods often rival more complex analytical techniques in predicting venture success (Åstebro, Thomas, and Samir Elhedhli, 2006, p.395). This finding underscores the practical utility of heuristic-based approaches in the entrepreneurial ecosystem.", "References": ["Åstebro, Thomas, and Samir Elhedhli. “The Effectiveness of Simple Decision Heuristics: Forecasting Commercial Success for Early-Stage Ventures.” Management Science, vol. 52, no. 3, Mar. 2006, pp. 395-409, https://doi.org/10.1287/mnsc.1050.0468.", ...]}
Make sure the output is in the correct json format:
{"Paragraph": paragraph, "References": ["Reference 1", "Reference 2", ...]}
output_schema:
action_items:
type: object
properties:
Paragraph:
type: string
description: "The content of the paragraph."
References:
type: array
items:
type: string
description: "A list of references associated with the paragraph."
# extract_paragraph:
# action: extract_xml_tag
# tag: output
# text:
# link: para_writer.result
# get_para_output:
# action: load_json
# json_string:
# var: extract_paragraph.result
essay1stdraft:
action: create_string
string:
text: |
Essay:
{% for flow in essay_writer %}
{% for output in flow.para_writer %}
{{ output[1].action_items.Paragraph }}
{% endfor %}
{% endfor %}
References:
{% for flow in essay_writer %}
{% for output in flow.para_writer %}
{% for reference in output[1].action_items.References %}
{{ reference }}
{% endfor %}
{% endfor %}
{% endfor %}
essayfinaliser:
action: llm
prompt:
- text: |
You are an Oxford Professor. Your proud student has read a lot of reading to answer the question {{message}}. You have received his writing on each paragraph and the citations.
You will organize the writing by connecting the paragraphs together and put the references in the end as appendixes. You will take the third-party perspective to check any inconsistencies between the paragraphs and add smooth transitions. Make sure that the overall tone is professional, compelling, and consistent. Please make sure to include the references in the end.
The first draft of the essay is as follows:
{{ essay1stdraft }}
Sample Output:
### The Role of Technology in Modern Education
In recent years, technology has revolutionized various sectors, including education. The integration of digital tools into the classroom has transformed traditional teaching methods, providing new opportunities for interactive and personalized learning. This essay explores the impact of technology on modern education, examining its benefits, challenges, and future potential.
Technology enhances learning by providing students with access to a vast array of resources and information. Online platforms, such as educational websites, e-books, and academic databases, offer learners the ability to explore topics in greater depth and at their own pace. For instance, the use of Khan Academy allows students to receive customized tutoring in subjects like mathematics and science, catering to their individual learning needs and improving academic performance (Smith, 2020).
Moreover, digital tools facilitate collaborative learning, which is crucial for developing critical thinking and problem-solving skills. Interactive applications, such as Google Classroom and Microsoft Teams, enable students to work together on projects, share ideas, and receive real-time feedback from their teachers. These platforms not only foster a sense of community among learners but also prepare them for the collaborative nature of the modern workplace (Johnson, 2019).
However, the integration of technology in education also presents several challenges. One significant issue is the digital divide, where students from low-income families may lack access to necessary devices and internet connectivity. This disparity can exacerbate educational inequalities, leaving some students at a disadvantage. According to a study by the Pew Research Center, 15% of U.S. households with school-aged children do not have a high-speed internet connection at home (Parker, 2021).
Another concern is the potential for technology to distract students from their studies. The availability of social media, online games, and other non-educational content can divert students' attention, leading to decreased productivity and engagement. Educators must therefore implement strategies to manage and mitigate these distractions, ensuring that technology is used effectively to support learning objectives (Brown, 2018).
Despite these challenges, the future of technology in education appears promising. Innovations such as artificial intelligence (AI) and virtual reality (VR) hold the potential to further enhance the learning experience. AI can provide personalized learning paths based on students' strengths and weaknesses, while VR can create immersive educational environments that make complex concepts more tangible and understandable. These advancements promise to make education more accessible, engaging, and effective (Williams, 2022).
In conclusion, technology has significantly impacted modern education by providing new tools and resources that enhance learning and collaboration. While challenges such as the digital divide and potential distractions must be addressed, the future integration of advanced technologies like AI and VR offers exciting possibilities for the evolution of education. As we continue to embrace these innovations, it is essential to ensure that all students have the opportunity to benefit from the advantages they bring.
#### References
Brown, A. (2018). Managing Distractions in the Digital Classroom. *Journal of Educational Technology*, 12(3), 45-59.
Johnson, L. (2019). Collaborative Learning in the Digital Age. *Education Today*, 23(1), 67-82.
Parker, K. (2021). The Digital Divide in Education. *Pew Research Center*. Retrieved from https://www.pewresearch.org
Smith, J. (2020). Personalized Learning with Khan Academy. *Educational Review*, 18(2), 34-50.
Williams, M. (2022). The Future of AI and VR in Education. *Tech Innovations in Education*, 5(4), 78-95.
Put the final essay between <output> and </output> tags.
extract_final_essay:
action: extract_xml_tag
tag: output
text:
link: essayfinaliser.result
default_output: extract_final_essay.result