only_ever_generator 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap/app.js +6 -5
- package/dist/card_gen/generate_cards.js +8 -3
- package/dist/constants/prompt_data.js +6 -1
- package/dist/constants/prompts/card_gen_prompt.js +12 -12
- package/dist/constants/prompts/typology_prompt.js +45 -131
- package/package.json +1 -1
- package/src/bootstrap/app.ts +7 -6
- package/src/card_gen/generate_cards.ts +10 -3
- package/src/constants/prompt_data.ts +7 -1
- package/src/constants/prompts/card_gen_prompt.ts +12 -12
- package/src/constants/prompts/typology_prompt.ts +49 -148
package/dist/bootstrap/app.js
CHANGED
|
@@ -13,8 +13,8 @@ exports.OnlyEverGenerator = void 0;
|
|
|
13
13
|
const generate_cards_1 = require("../card_gen/generate_cards");
|
|
14
14
|
const parse_source_content_1 = require("../parse/parse_source_content");
|
|
15
15
|
const open_ai_service_1 = require("../services/open_ai_service");
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// import { returnCardGenPrompt } from "../constants/prompts/card_gen_prompt";
|
|
17
|
+
// import { returnTypologyPrompt } from "../constants/prompts/typology_prompt";
|
|
18
18
|
const generate_typology_1 = require("../typology_gen/generate_typology");
|
|
19
19
|
const generate_args_1 = require("../utils/generate_args");
|
|
20
20
|
const calculate_gap_fill_1 = require("../gap_fill/calculate_gap_fill");
|
|
@@ -41,8 +41,8 @@ class OnlyEverGenerator {
|
|
|
41
41
|
// parsedData.type == 'cards' ? this.typologyResponse = parsedData.taxonomy : this.typologyResponse = null;
|
|
42
42
|
this.typologyResponse = generationContent.content.taxonomy;
|
|
43
43
|
this.expectedFields = generationContent.content.fields; //returnFields();
|
|
44
|
-
this.promptForTypology =
|
|
45
|
-
this.promptForCardGen =
|
|
44
|
+
this.promptForTypology = generationContent.prompt.typology;
|
|
45
|
+
this.promptForCardGen = generationContent.prompt.card_generation;
|
|
46
46
|
}
|
|
47
47
|
generate() {
|
|
48
48
|
return __awaiter(this, arguments, void 0, function* (generate_typology = false, generate_card = false) {
|
|
@@ -94,7 +94,8 @@ class OnlyEverGenerator {
|
|
|
94
94
|
}
|
|
95
95
|
generateCard(prompt, additionalContent, isGapFill) {
|
|
96
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
|
|
97
|
+
var _a;
|
|
98
|
+
let generateCardsResp = yield new generate_cards_1.GenerateCards(this.openAiService).generateCards(prompt !== null && prompt !== void 0 ? prompt : "", JSON.stringify(this.parsedContent) + additionalContent, isGapFill, (_a = this.parsedContent.headings) !== null && _a !== void 0 ? _a : []);
|
|
98
99
|
// let response = await this.openAiService?.sendRequest(prompt,this.parsedContent);
|
|
99
100
|
// response['type'] = 'card_gen';
|
|
100
101
|
return generateCardsResp;
|
|
@@ -15,7 +15,7 @@ class GenerateCards {
|
|
|
15
15
|
constructor(openAiService) {
|
|
16
16
|
this.openAiService = openAiService;
|
|
17
17
|
}
|
|
18
|
-
generateCards(prompt, parsedContent, isGapFill) {
|
|
18
|
+
generateCards(prompt, parsedContent, isGapFill, headings) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
var _a, _b, _c;
|
|
21
21
|
let response = yield ((_a = this.openAiService) === null || _a === void 0 ? void 0 : _a.sendRequest(prompt, parsedContent));
|
|
@@ -31,7 +31,7 @@ class GenerateCards {
|
|
|
31
31
|
if (response.status_code == 200) {
|
|
32
32
|
response.metadata.status = "completed";
|
|
33
33
|
//return response;
|
|
34
|
-
return this.parse(response, isGapFill);
|
|
34
|
+
return this.parse(response, isGapFill, headings);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
37
|
response.metadata.status = "failed";
|
|
@@ -39,7 +39,7 @@ class GenerateCards {
|
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
parse(generatedData, isGapFill) {
|
|
42
|
+
parse(generatedData, isGapFill, headings) {
|
|
43
43
|
try {
|
|
44
44
|
const cardData = [];
|
|
45
45
|
let usage_data = generatedData.metadata;
|
|
@@ -50,6 +50,11 @@ class GenerateCards {
|
|
|
50
50
|
const type = generatedData.type;
|
|
51
51
|
if (unparsedTestCards !== undefined && unparsedTestCards.length != 0) {
|
|
52
52
|
for (let elem of unparsedTestCards) {
|
|
53
|
+
if (headings.includes(elem.card_reference)) {
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
elem.card_reference = '';
|
|
57
|
+
}
|
|
53
58
|
if (elem.type == "flash") {
|
|
54
59
|
cardData.push(this.parseFlashCard(elem));
|
|
55
60
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.returnPromptData = void 0;
|
|
4
|
+
const card_gen_prompt_1 = require("./prompts/card_gen_prompt");
|
|
5
|
+
const typology_prompt_1 = require("./prompts/typology_prompt");
|
|
4
6
|
const promptData = {
|
|
5
7
|
typology: {
|
|
6
8
|
role: `
|
|
@@ -293,6 +295,9 @@ const promptData = {
|
|
|
293
295
|
}
|
|
294
296
|
};
|
|
295
297
|
function returnPromptData() {
|
|
296
|
-
return
|
|
298
|
+
return {
|
|
299
|
+
"typology": (0, typology_prompt_1.returnTypologyPrompt)(),
|
|
300
|
+
"card_generation": (0, card_gen_prompt_1.returnCardGenPrompt)(''),
|
|
301
|
+
};
|
|
297
302
|
}
|
|
298
303
|
exports.returnPromptData = returnPromptData;
|
|
@@ -23,7 +23,7 @@ exports.returnCardGenPrompt = void 0;
|
|
|
23
23
|
// {
|
|
24
24
|
// "type": "flash" | "mcq" | "cloze" | "match",
|
|
25
25
|
// "card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "...": "...", "....": "..." },
|
|
26
|
-
// "card_reference": "
|
|
26
|
+
// "card_reference": "heading",
|
|
27
27
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
28
28
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
29
29
|
// "bloom_level": <1-5>
|
|
@@ -80,7 +80,7 @@ exports.returnCardGenPrompt = void 0;
|
|
|
80
80
|
// "front": "<content for the front>",
|
|
81
81
|
// "back": "<content for the back>"
|
|
82
82
|
// },
|
|
83
|
-
// "card_reference": "
|
|
83
|
+
// "card_reference": "heading",
|
|
84
84
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
85
85
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
86
86
|
// "bloom_level": <1-5>
|
|
@@ -98,7 +98,7 @@ exports.returnCardGenPrompt = void 0;
|
|
|
98
98
|
// "... up to 8 choices"
|
|
99
99
|
// ]
|
|
100
100
|
// },
|
|
101
|
-
// "card_reference": "
|
|
101
|
+
// "card_reference": "heading",
|
|
102
102
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
103
103
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
104
104
|
// "bloom_level": <1-5>
|
|
@@ -122,7 +122,7 @@ exports.returnCardGenPrompt = void 0;
|
|
|
122
122
|
// "... up to 8 choices"
|
|
123
123
|
// ]
|
|
124
124
|
// },
|
|
125
|
-
// "card_reference": "
|
|
125
|
+
// "card_reference": "heading",
|
|
126
126
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
127
127
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
128
128
|
// "bloom_level": <1-5>
|
|
@@ -141,14 +141,14 @@ exports.returnCardGenPrompt = void 0;
|
|
|
141
141
|
// "left_choice 2": "right_choice 2",
|
|
142
142
|
// "... up to 8 total pairs"
|
|
143
143
|
// },
|
|
144
|
-
// "card_reference": "
|
|
144
|
+
// "card_reference": "heading",
|
|
145
145
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
146
146
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
147
147
|
// "bloom_level": <1-5>
|
|
148
148
|
// }
|
|
149
149
|
// • Maximum character length for each item in a pair: 42
|
|
150
150
|
// `,
|
|
151
|
-
// reference : `Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows:
|
|
151
|
+
// reference : `Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows: ""main_heading, where #main_heading is optional.`,
|
|
152
152
|
// checkcoverage: `Once you are done generating the test cards. Go back and evaulate the full list of concepts and fact that include any of the missing concepts or facts along with the list that was provided as the input.
|
|
153
153
|
// Are there any concept or fact that don't have a test card yet? If yes, go back and create one.
|
|
154
154
|
// Once you are done creating come back to this step again to check if you have full coverage of all the concepts and facts in the source. You can stop generating test questions once you achieve full coverage.
|
|
@@ -184,7 +184,7 @@ json
|
|
|
184
184
|
{
|
|
185
185
|
"type": "flash" | "mcq" | "cloze" | "match",
|
|
186
186
|
"card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "right_choice 1": "...", "left_choice 1": "..." },
|
|
187
|
-
"card_reference": "
|
|
187
|
+
"card_reference": "heading",
|
|
188
188
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
189
189
|
"facts": ["Fact1", "Fact2", "..."]
|
|
190
190
|
}
|
|
@@ -248,7 +248,7 @@ json
|
|
|
248
248
|
"front": "<content for the front>",
|
|
249
249
|
"back": "<content for the back>"
|
|
250
250
|
},
|
|
251
|
-
"card_reference": "
|
|
251
|
+
"card_reference": "heading",
|
|
252
252
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
253
253
|
"facts": ["Fact1", "Fact2", "..."],
|
|
254
254
|
"bloom_level": <1-5>
|
|
@@ -267,7 +267,7 @@ json
|
|
|
267
267
|
"... up to 8 choices"
|
|
268
268
|
]
|
|
269
269
|
},
|
|
270
|
-
"card_reference": "
|
|
270
|
+
"card_reference": "heading",
|
|
271
271
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
272
272
|
"facts": ["Fact1", "Fact2", "..."],
|
|
273
273
|
"bloom_level": <1-5>
|
|
@@ -293,7 +293,7 @@ json
|
|
|
293
293
|
"... up to 8 choices"
|
|
294
294
|
]
|
|
295
295
|
},
|
|
296
|
-
"card_reference": "
|
|
296
|
+
"card_reference": "heading",
|
|
297
297
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
298
298
|
"facts": ["Fact1", "Fact2", "..."],
|
|
299
299
|
"bloom_level": <1-5>
|
|
@@ -313,14 +313,14 @@ json
|
|
|
313
313
|
"right_choice 2": "left_choice 2",
|
|
314
314
|
"... up to 8 total pairs"
|
|
315
315
|
},
|
|
316
|
-
"card_reference": "
|
|
316
|
+
"card_reference": "heading",
|
|
317
317
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
318
318
|
"facts": ["Fact1", "Fact2", "..."],
|
|
319
319
|
"bloom_level": <1-5>
|
|
320
320
|
}
|
|
321
321
|
• Maximum character length for each item in a pair: 42
|
|
322
322
|
|
|
323
|
-
Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows:
|
|
323
|
+
Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows: ""main_heading, where #main_heading is optional.
|
|
324
324
|
Once you are done generating the test cards. Go back and evaulate the full list of concepts and fact that include any of the missing concepts or facts along with the list that was provided as the input.
|
|
325
325
|
|
|
326
326
|
Are there any concept or fact that don't have a test card yet? If yes, go back and create one.
|
|
@@ -1,108 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// const typologyPromptString = `
|
|
3
|
-
// As a dedicated assistant at a learning company, your role involves analyzing educational content to categorize and summarize it. You will process content (in JSON format) that represents text and images from diverse sources such as PDFs, book chapters, videos, and websites. Follow these steps:
|
|
4
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
3
|
exports.returnTypologyPrompt = void 0;
|
|
6
|
-
|
|
7
|
-
// 2. Identify key concepts within the content.
|
|
8
|
-
// 3. Detect concrete facts that are empirically verified and relevant to the subject.
|
|
9
|
-
// 4. Decide whether the identified concepts and facts should be used to generate learning materials like flashcards based on their educational value.
|
|
10
|
-
// 5. If the generate_cards is true then summarize the content using a series of summary cards.
|
|
11
|
-
// Please format your findings in this JSON schema:
|
|
12
|
-
// json
|
|
13
|
-
// {
|
|
14
|
-
// "field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
15
|
-
// "concepts": ["concept1", "concept2", "concept3", "..."],
|
|
16
|
-
// "facts": ["fact1", "fact2", "fact3", "..."],
|
|
17
|
-
// "generate_cards": [
|
|
18
|
-
// state: true or false,
|
|
19
|
-
// false_reason: "reason for marking the source as false. Leave empty for true."
|
|
20
|
-
// ],
|
|
21
|
-
// "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
22
|
-
// }
|
|
23
|
-
// Further instruction on how to perform these tasks are below.
|
|
24
|
-
// Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
25
|
-
// 1. Sciences: Focus on Biology, Chemistry, Physics, Astronomy, Mathematics, and Computer Science.
|
|
26
|
-
// 2. Technology & Engineering: Emphasize Information Technology, Engineering disciplines, AI, and Robotics.
|
|
27
|
-
// 3. Humanities & Cultural Studies: Highlight History, Literature, Languages, Arts, Philosophy, and Anthropological Studies.
|
|
28
|
-
// 4. Social Sciences & Global Studies: Include Sociology, Psychology, Economics, Political Science, Anthropology, and International Relations.
|
|
29
|
-
// 5. Business & Management: Encompass Entrepreneurship, Marketing, Finance, Leadership, and Ethics.
|
|
30
|
-
// 6. Health & Medicine: Cover Medical Sciences, Public Health, Nutrition, Wellness, and Mental Health.
|
|
31
|
-
// 7. Environmental Studies & Earth Sciences: Discuss Ecology, Climate Science, Geology, and Environmental Policy.
|
|
32
|
-
// 8. Education, Learning & Personal Development: Talk about Educational Theories, Teaching Methods, and Personal Skills.
|
|
33
|
-
// 9. Creative & Performing Arts: Include Visual Arts, Music, Theater, Dance, and Design Principles.
|
|
34
|
-
// 10. Law, Governance & Ethics: Focus on Legal Studies, Public Administration, Policy Analysis, and Ethical Decision-Making.
|
|
35
|
-
// 11. Recreation, Lifestyle & Practical Skills: Highlight Hobbies, Sports, Travel, Lifestyle Choices, and Practical Skills.
|
|
36
|
-
// 12. Technology & Media Literacy: Discuss Digital Literacy, Media Studies, and the Impact of Digital Media.
|
|
37
|
-
// 13. Philosophy & Critical Thinking: Emphasize Moral Philosophy, Ethical Frameworks, and Critical Thinking.
|
|
38
|
-
// 14. Space & Astronomical Sciences: Focus on Space Exploration, Astronomy, and Astrophysics.
|
|
39
|
-
// 15. Agriculture & Food Sciences: Discuss Sustainable Farming, Food Technology, and Nutrition.
|
|
40
|
-
// 16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
|
|
41
|
-
// 17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
|
|
42
|
-
// 18. Other: Use for content that doesn’t fit into the above categories.
|
|
43
|
-
// Identify key concepts within the content after classifying the field. Concepts are the fundamental ideas or categories that form the basis of knowledge within any discipline. They help organize and explain information, making it accessible and relatable.
|
|
44
|
-
// 1. **Definition of a Concept**: Concepts should be significant ideas that recur within the content and are essential for understanding the main themes.
|
|
45
|
-
// 2. **Inclusion Criteria**: Include a concept only if it is discussed in detail, meaning it is explained thoroughly, tied to specific examples, or highlighted as a critical part of the subject matter.
|
|
46
|
-
// List the concepts in the following JSON format:
|
|
47
|
-
// json
|
|
48
|
-
// {
|
|
49
|
-
// "concepts": ["concept1", "concept2", "concept3", "..."]
|
|
50
|
-
// }
|
|
51
|
-
// After classifying the content and identifying key concepts, proceed to extract and list verifiable facts. Facts are objective statements that must be supported by empirical evidence or observation, such as specific data on events, people, numbers, dates, or well-established ideas.
|
|
52
|
-
// 1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
|
|
53
|
-
// 2. **Selection Criteria**: Choose facts based on their significance to the content's main themes or concepts, their educational value, or their foundational role in the subject.
|
|
54
|
-
// Record the facts in the following JSON format:
|
|
55
|
-
// json
|
|
56
|
-
// {
|
|
57
|
-
// "facts": ["fact1", "fact2", "fact3", "..."]
|
|
58
|
-
// }
|
|
59
|
-
// After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing materials. Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals. If you decide that testing cards don't need to be generated then please provide a reason in less than 90 characters.
|
|
60
|
-
// 1. **Value Assessment**: Determine if the concepts and facts are essential for understanding the broader topic, are likely to be used in practical scenarios, or help in achieving educational benchmarks.
|
|
61
|
-
// 2. **Criteria for Material Generation**: Generate testing materials if the concepts and facts are central to the content, have broad applicability, and are likely to reinforce or expand the learner’s knowledge significantly.
|
|
62
|
-
// Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
63
|
-
// json
|
|
64
|
-
// "generate_cards":
|
|
65
|
-
// { state: true or false,
|
|
66
|
-
// false_reason: "reason for marking the source as false. Leave empty for true."
|
|
67
|
-
// }
|
|
68
|
-
// After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards. These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
|
|
69
|
-
// 1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
70
|
-
// 2. **Summarization Objective**: Each card is a step in a journey through the content. The series should collectively summarize the source while emphasizing important learning points.
|
|
71
|
-
// 3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
72
|
-
// 4. **Engagement and Flow**: Write in an engaging style that maintains the user’s interest. Arrange the cards in a logical order that reflects the flow of the original content.
|
|
73
|
-
// Format your output in JSON as follows:
|
|
74
|
-
// json
|
|
75
|
-
// {
|
|
76
|
-
// "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
77
|
-
// }
|
|
78
|
-
// `;
|
|
79
|
-
const typologyPromptString = {
|
|
80
|
-
role: `
|
|
4
|
+
const typologyPromptString = `
|
|
81
5
|
As a dedicated assistant at a learning company, your role involves analyzing educational content to categorize and summarize it. You will process content (in JSON format) that represents text and images from diverse sources such as PDFs, book chapters, videos, and websites. Follow these steps:
|
|
82
6
|
|
|
83
7
|
1. Classify the content into one to three predefined fields of knowledge.
|
|
84
|
-
2.
|
|
85
|
-
3.
|
|
8
|
+
2. Identify key concepts within the content.
|
|
9
|
+
3. Detect concrete facts that are empirically verified and relevant to the subject.
|
|
86
10
|
4. Decide whether the identified concepts and facts should be used to generate learning materials like flashcards based on their educational value.
|
|
87
11
|
5. If the generate_cards is true then summarize the content using a series of summary cards.
|
|
88
12
|
|
|
89
13
|
Please format your findings in this JSON schema:
|
|
14
|
+
json
|
|
90
15
|
{
|
|
91
|
-
"field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
92
|
-
"concepts": ["concept1", "concept2", "concept3", "..."],
|
|
93
|
-
"facts": ["fact1", "fact2", "fact3", "..."],
|
|
94
|
-
"generate_cards":
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
16
|
+
"field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
17
|
+
"concepts": ["concept1", "concept2", "concept3", "..."],
|
|
18
|
+
"facts": ["fact1", "fact2", "fact3", "..."],
|
|
19
|
+
"generate_cards": [
|
|
20
|
+
state: true or false,
|
|
21
|
+
false_reason: "reason for marking the source as false. Leave empty for true."
|
|
22
|
+
],
|
|
23
|
+
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
99
24
|
}
|
|
100
25
|
|
|
101
|
-
|
|
102
26
|
Further instruction on how to perform these tasks are below.
|
|
103
|
-
|
|
104
|
-
fields: `
|
|
105
|
-
Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
27
|
+
Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
106
28
|
|
|
107
29
|
1. Sciences: Focus on Biology, Chemistry, Physics, Astronomy, Mathematics, and Computer Science.
|
|
108
30
|
2. Technology & Engineering: Emphasize Information Technology, Engineering disciplines, AI, and Robotics.
|
|
@@ -122,62 +44,54 @@ Further instruction on how to perform these tasks are below.
|
|
|
122
44
|
16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
|
|
123
45
|
17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
|
|
124
46
|
18. Other: Use for content that doesn’t fit into the above categories.
|
|
125
|
-
`,
|
|
126
|
-
concepts: `
|
|
127
|
-
Extract key concepts within the content after classifying the field. Please be as exhaustive as possible.
|
|
128
47
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
48
|
+
Identify key concepts within the content after classifying the field. Concepts are the fundamental ideas or categories that form the basis of knowledge within any discipline. They help organize and explain information, making it accessible and relatable.
|
|
49
|
+
|
|
50
|
+
1. **Definition of a Concept**: Concepts should be significant ideas that recur within the content and are essential for understanding the main themes.
|
|
51
|
+
2. **Inclusion Criteria**: Include a concept only if it is discussed in detail, meaning it is explained thoroughly, tied to specific examples, or highlighted as a critical part of the subject matter.
|
|
132
52
|
|
|
53
|
+
List the concepts in the following JSON format:
|
|
54
|
+
json
|
|
133
55
|
{
|
|
134
|
-
|
|
135
|
-
[
|
|
136
|
-
"concept1",
|
|
137
|
-
"concept2",
|
|
138
|
-
"concept3",
|
|
139
|
-
"..."
|
|
140
|
-
]
|
|
56
|
+
"concepts": ["concept1", "concept2", "concept3", "..."]
|
|
141
57
|
}
|
|
142
|
-
|
|
143
|
-
facts: `
|
|
144
|
-
After classifying the content and identifying key concepts, proceed to extract and list verifiable facts.
|
|
58
|
+
After classifying the content and identifying key concepts, proceed to extract and list verifiable facts. Facts are objective statements that must be supported by empirical evidence or observation, such as specific data on events, people, numbers, dates, or well-established ideas.
|
|
145
59
|
|
|
146
|
-
Definition of a Fact
|
|
147
|
-
Selection Criteria
|
|
148
|
-
Record the facts in the following JSON format:
|
|
60
|
+
1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
|
|
61
|
+
2. **Selection Criteria**: Choose facts based on their significance to the content's main themes or concepts, their educational value, or their foundational role in the subject.
|
|
149
62
|
|
|
63
|
+
Record the facts in the following JSON format:
|
|
64
|
+
json
|
|
150
65
|
{
|
|
151
|
-
|
|
66
|
+
"facts": ["fact1", "fact2", "fact3", "..."]
|
|
152
67
|
}
|
|
153
|
-
`,
|
|
154
|
-
generate: `
|
|
155
68
|
After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing materials. Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals. If you decide that testing cards don't need to be generated then please provide a reason in less than 90 characters.
|
|
156
69
|
|
|
157
|
-
Value Assessment
|
|
158
|
-
Criteria for Material Generation
|
|
159
|
-
Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
70
|
+
1. **Value Assessment**: Determine if the concepts and facts are essential for understanding the broader topic, are likely to be used in practical scenarios, or help in achieving educational benchmarks.
|
|
71
|
+
2. **Criteria for Material Generation**: Generate testing materials if the concepts and facts are central to the content, have broad applicability, and are likely to reinforce or expand the learner’s knowledge significantly.
|
|
160
72
|
|
|
73
|
+
Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
74
|
+
json
|
|
161
75
|
"generate_cards":
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
summarize: `
|
|
76
|
+
{ state: true or false,
|
|
77
|
+
false_reason: "reason for marking the source as false. Leave empty for true."
|
|
78
|
+
}
|
|
79
|
+
|
|
167
80
|
After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards. These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
|
|
168
81
|
|
|
169
|
-
Inclusion Criteria: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
170
|
-
Summarization Objective: Each card is a step in a journey through the content. The series should collectively summarize the source while emphasizing important learning points.
|
|
171
|
-
Character Limit: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
172
|
-
Engagement and Flow: Write in an engaging style that maintains the user’s interest. Arrange the cards in a logical order that reflects the flow of the original content.
|
|
173
|
-
Format your output in JSON as follows:
|
|
174
82
|
|
|
83
|
+
1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
84
|
+
2. **Summarization Objective**: Each card is a step in a journey through the content. The series should collectively summarize the source while emphasizing important learning points.
|
|
85
|
+
3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
86
|
+
4. **Engagement and Flow**: Write in an engaging style that maintains the user’s interest. Arrange the cards in a logical order that reflects the flow of the original content.
|
|
87
|
+
|
|
88
|
+
Format your output in JSON as follows:
|
|
89
|
+
json
|
|
175
90
|
{
|
|
176
|
-
|
|
91
|
+
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
177
92
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return typologyPrompt;
|
|
93
|
+
`;
|
|
94
|
+
function returnTypologyPrompt() {
|
|
95
|
+
return typologyPromptString;
|
|
182
96
|
}
|
|
183
97
|
exports.returnTypologyPrompt = returnTypologyPrompt;
|
package/package.json
CHANGED
package/src/bootstrap/app.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GenerateCards } from "../card_gen/generate_cards";
|
|
2
2
|
import { ParseSourceContent } from "../parse/parse_source_content";
|
|
3
3
|
import { OpenAiService } from "../services/open_ai_service";
|
|
4
|
-
import { returnCardGenPrompt } from "../constants/prompts/card_gen_prompt";
|
|
5
|
-
import { returnTypologyPrompt } from "../constants/prompts/typology_prompt";
|
|
4
|
+
// import { returnCardGenPrompt } from "../constants/prompts/card_gen_prompt";
|
|
5
|
+
// import { returnTypologyPrompt } from "../constants/prompts/typology_prompt";
|
|
6
6
|
import { GenerateTypology } from "../typology_gen/generate_typology";
|
|
7
7
|
import { GenerateArgs } from "../utils/generate_args";
|
|
8
8
|
import { gapFilling } from "../gap_fill/calculate_gap_fill";
|
|
@@ -48,8 +48,8 @@ export class OnlyEverGenerator {
|
|
|
48
48
|
this.typologyResponse = generationContent.content.taxonomy
|
|
49
49
|
|
|
50
50
|
this.expectedFields = generationContent.content.fields; //returnFields();
|
|
51
|
-
this.promptForTypology =
|
|
52
|
-
this.promptForCardGen =
|
|
51
|
+
this.promptForTypology = generationContent.prompt.typology;
|
|
52
|
+
this.promptForCardGen =generationContent.prompt.card_generation;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
|
|
@@ -124,8 +124,9 @@ export class OnlyEverGenerator {
|
|
|
124
124
|
async generateCard(prompt: string, additionalContent: string, isGapFill: boolean) {
|
|
125
125
|
let generateCardsResp = await new GenerateCards(this.openAiService).generateCards(
|
|
126
126
|
prompt ?? "",
|
|
127
|
-
this.parsedContent + additionalContent,
|
|
128
|
-
isGapFill
|
|
127
|
+
JSON.stringify(this.parsedContent) + additionalContent,
|
|
128
|
+
isGapFill,
|
|
129
|
+
this.parsedContent.headings ?? [],
|
|
129
130
|
);
|
|
130
131
|
|
|
131
132
|
// let response = await this.openAiService?.sendRequest(prompt,this.parsedContent);
|
|
@@ -7,7 +7,7 @@ export class GenerateCards {
|
|
|
7
7
|
this.openAiService = openAiService;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
async generateCards(prompt: string, parsedContent: string,
|
|
10
|
+
async generateCards(prompt: string, parsedContent: string,isGapFill: boolean,headings: Array<any>) {
|
|
11
11
|
let response = await this.openAiService?.sendRequest(prompt, parsedContent);
|
|
12
12
|
// console.log("response to card generation ", response);
|
|
13
13
|
response["type"] = isGapFill ? "gap_fill":"card_gen";
|
|
@@ -21,14 +21,14 @@ export class GenerateCards {
|
|
|
21
21
|
if(response.status_code == 200){
|
|
22
22
|
response.metadata.status = "completed";
|
|
23
23
|
//return response;
|
|
24
|
-
return this.parse(response, isGapFill);
|
|
24
|
+
return this.parse(response, isGapFill,headings);
|
|
25
25
|
} else {
|
|
26
26
|
response.metadata.status = "failed";
|
|
27
27
|
return response;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
parse(generatedData: any, isGapFill: boolean) {
|
|
31
|
+
parse(generatedData: any, isGapFill: boolean, headings:Array<any>) {
|
|
32
32
|
try{
|
|
33
33
|
const cardData = [];
|
|
34
34
|
let usage_data = generatedData.metadata;
|
|
@@ -39,6 +39,11 @@ export class GenerateCards {
|
|
|
39
39
|
const type = generatedData.type;
|
|
40
40
|
if(unparsedTestCards !== undefined && unparsedTestCards.length != 0) {
|
|
41
41
|
for (let elem of unparsedTestCards) {
|
|
42
|
+
if(headings.includes(elem.card_reference)){
|
|
43
|
+
|
|
44
|
+
}else{
|
|
45
|
+
elem.card_reference = '';
|
|
46
|
+
}
|
|
42
47
|
if (elem.type == "flash") {
|
|
43
48
|
cardData.push(this.parseFlashCard(elem));
|
|
44
49
|
} else if (elem.type == "mcq") {
|
|
@@ -249,3 +254,5 @@ return question;
|
|
|
249
254
|
return displayTitle;
|
|
250
255
|
}
|
|
251
256
|
}
|
|
257
|
+
|
|
258
|
+
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { returnCardGenPrompt } from "./prompts/card_gen_prompt";
|
|
2
|
+
import { returnTypologyPrompt } from "./prompts/typology_prompt";
|
|
3
|
+
|
|
1
4
|
const promptData: any = {
|
|
2
5
|
typology: {
|
|
3
6
|
role: `
|
|
@@ -293,5 +296,8 @@ const promptData: any = {
|
|
|
293
296
|
}
|
|
294
297
|
|
|
295
298
|
export function returnPromptData(){
|
|
296
|
-
return
|
|
299
|
+
return {
|
|
300
|
+
"typology": returnTypologyPrompt(),
|
|
301
|
+
"card_generation": returnCardGenPrompt(''),
|
|
302
|
+
};
|
|
297
303
|
}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
// {
|
|
26
26
|
// "type": "flash" | "mcq" | "cloze" | "match",
|
|
27
27
|
// "card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "...": "...", "....": "..." },
|
|
28
|
-
// "card_reference": "
|
|
28
|
+
// "card_reference": "heading",
|
|
29
29
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
30
30
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
31
31
|
// "bloom_level": <1-5>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
// "front": "<content for the front>",
|
|
95
95
|
// "back": "<content for the back>"
|
|
96
96
|
// },
|
|
97
|
-
// "card_reference": "
|
|
97
|
+
// "card_reference": "heading",
|
|
98
98
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
99
99
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
100
100
|
// "bloom_level": <1-5>
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
// "... up to 8 choices"
|
|
115
115
|
// ]
|
|
116
116
|
// },
|
|
117
|
-
// "card_reference": "
|
|
117
|
+
// "card_reference": "heading",
|
|
118
118
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
119
119
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
120
120
|
// "bloom_level": <1-5>
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
// "... up to 8 choices"
|
|
142
142
|
// ]
|
|
143
143
|
// },
|
|
144
|
-
// "card_reference": "
|
|
144
|
+
// "card_reference": "heading",
|
|
145
145
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
146
146
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
147
147
|
// "bloom_level": <1-5>
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
// "left_choice 2": "right_choice 2",
|
|
164
164
|
// "... up to 8 total pairs"
|
|
165
165
|
// },
|
|
166
|
-
// "card_reference": "
|
|
166
|
+
// "card_reference": "heading",
|
|
167
167
|
// "concepts": ["Concept1", "Concept2", "..."],
|
|
168
168
|
// "facts": ["Fact1", "Fact2", "..."],
|
|
169
169
|
// "bloom_level": <1-5>
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
|
|
172
172
|
// • Maximum character length for each item in a pair: 42
|
|
173
173
|
// `,
|
|
174
|
-
// reference : `Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows:
|
|
174
|
+
// reference : `Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows: ""main_heading, where #main_heading is optional.`,
|
|
175
175
|
// checkcoverage: `Once you are done generating the test cards. Go back and evaulate the full list of concepts and fact that include any of the missing concepts or facts along with the list that was provided as the input.
|
|
176
176
|
|
|
177
177
|
// Are there any concept or fact that don't have a test card yet? If yes, go back and create one.
|
|
@@ -213,7 +213,7 @@ json
|
|
|
213
213
|
{
|
|
214
214
|
"type": "flash" | "mcq" | "cloze" | "match",
|
|
215
215
|
"card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "right_choice 1": "...", "left_choice 1": "..." },
|
|
216
|
-
"card_reference": "
|
|
216
|
+
"card_reference": "heading",
|
|
217
217
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
218
218
|
"facts": ["Fact1", "Fact2", "..."]
|
|
219
219
|
}
|
|
@@ -277,7 +277,7 @@ json
|
|
|
277
277
|
"front": "<content for the front>",
|
|
278
278
|
"back": "<content for the back>"
|
|
279
279
|
},
|
|
280
|
-
"card_reference": "
|
|
280
|
+
"card_reference": "heading",
|
|
281
281
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
282
282
|
"facts": ["Fact1", "Fact2", "..."],
|
|
283
283
|
"bloom_level": <1-5>
|
|
@@ -296,7 +296,7 @@ json
|
|
|
296
296
|
"... up to 8 choices"
|
|
297
297
|
]
|
|
298
298
|
},
|
|
299
|
-
"card_reference": "
|
|
299
|
+
"card_reference": "heading",
|
|
300
300
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
301
301
|
"facts": ["Fact1", "Fact2", "..."],
|
|
302
302
|
"bloom_level": <1-5>
|
|
@@ -322,7 +322,7 @@ json
|
|
|
322
322
|
"... up to 8 choices"
|
|
323
323
|
]
|
|
324
324
|
},
|
|
325
|
-
"card_reference": "
|
|
325
|
+
"card_reference": "heading",
|
|
326
326
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
327
327
|
"facts": ["Fact1", "Fact2", "..."],
|
|
328
328
|
"bloom_level": <1-5>
|
|
@@ -342,14 +342,14 @@ json
|
|
|
342
342
|
"right_choice 2": "left_choice 2",
|
|
343
343
|
"... up to 8 total pairs"
|
|
344
344
|
},
|
|
345
|
-
"card_reference": "
|
|
345
|
+
"card_reference": "heading",
|
|
346
346
|
"concepts": ["Concept1", "Concept2", "..."],
|
|
347
347
|
"facts": ["Fact1", "Fact2", "..."],
|
|
348
348
|
"bloom_level": <1-5>
|
|
349
349
|
}
|
|
350
350
|
• Maximum character length for each item in a pair: 42
|
|
351
351
|
|
|
352
|
-
Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows:
|
|
352
|
+
Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows: ""main_heading, where #main_heading is optional.
|
|
353
353
|
Once you are done generating the test cards. Go back and evaulate the full list of concepts and fact that include any of the missing concepts or facts along with the list that was provided as the input.
|
|
354
354
|
|
|
355
355
|
Are there any concept or fact that don't have a test card yet? If yes, go back and create one.
|
|
@@ -1,121 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
// As a dedicated assistant at a learning company, your role involves analyzing educational content to categorize and summarize it. You will process content (in JSON format) that represents text and images from diverse sources such as PDFs, book chapters, videos, and websites. Follow these steps:
|
|
3
|
-
|
|
4
|
-
// 1. Classify the content into one to three predefined fields of knowledge.
|
|
5
|
-
// 2. Identify key concepts within the content.
|
|
6
|
-
// 3. Detect concrete facts that are empirically verified and relevant to the subject.
|
|
7
|
-
// 4. Decide whether the identified concepts and facts should be used to generate learning materials like flashcards based on their educational value.
|
|
8
|
-
// 5. If the generate_cards is true then summarize the content using a series of summary cards.
|
|
9
|
-
|
|
10
|
-
// Please format your findings in this JSON schema:
|
|
11
|
-
// json
|
|
12
|
-
// {
|
|
13
|
-
// "field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
14
|
-
// "concepts": ["concept1", "concept2", "concept3", "..."],
|
|
15
|
-
// "facts": ["fact1", "fact2", "fact3", "..."],
|
|
16
|
-
// "generate_cards": [
|
|
17
|
-
// state: true or false,
|
|
18
|
-
// false_reason: "reason for marking the source as false. Leave empty for true."
|
|
19
|
-
// ],
|
|
20
|
-
// "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
21
|
-
// }
|
|
22
|
-
|
|
23
|
-
// Further instruction on how to perform these tasks are below.
|
|
24
|
-
// Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
25
|
-
|
|
26
|
-
// 1. Sciences: Focus on Biology, Chemistry, Physics, Astronomy, Mathematics, and Computer Science.
|
|
27
|
-
// 2. Technology & Engineering: Emphasize Information Technology, Engineering disciplines, AI, and Robotics.
|
|
28
|
-
// 3. Humanities & Cultural Studies: Highlight History, Literature, Languages, Arts, Philosophy, and Anthropological Studies.
|
|
29
|
-
// 4. Social Sciences & Global Studies: Include Sociology, Psychology, Economics, Political Science, Anthropology, and International Relations.
|
|
30
|
-
// 5. Business & Management: Encompass Entrepreneurship, Marketing, Finance, Leadership, and Ethics.
|
|
31
|
-
// 6. Health & Medicine: Cover Medical Sciences, Public Health, Nutrition, Wellness, and Mental Health.
|
|
32
|
-
// 7. Environmental Studies & Earth Sciences: Discuss Ecology, Climate Science, Geology, and Environmental Policy.
|
|
33
|
-
// 8. Education, Learning & Personal Development: Talk about Educational Theories, Teaching Methods, and Personal Skills.
|
|
34
|
-
// 9. Creative & Performing Arts: Include Visual Arts, Music, Theater, Dance, and Design Principles.
|
|
35
|
-
// 10. Law, Governance & Ethics: Focus on Legal Studies, Public Administration, Policy Analysis, and Ethical Decision-Making.
|
|
36
|
-
// 11. Recreation, Lifestyle & Practical Skills: Highlight Hobbies, Sports, Travel, Lifestyle Choices, and Practical Skills.
|
|
37
|
-
// 12. Technology & Media Literacy: Discuss Digital Literacy, Media Studies, and the Impact of Digital Media.
|
|
38
|
-
// 13. Philosophy & Critical Thinking: Emphasize Moral Philosophy, Ethical Frameworks, and Critical Thinking.
|
|
39
|
-
// 14. Space & Astronomical Sciences: Focus on Space Exploration, Astronomy, and Astrophysics.
|
|
40
|
-
// 15. Agriculture & Food Sciences: Discuss Sustainable Farming, Food Technology, and Nutrition.
|
|
41
|
-
// 16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
|
|
42
|
-
// 17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
|
|
43
|
-
// 18. Other: Use for content that doesn’t fit into the above categories.
|
|
44
|
-
|
|
45
|
-
// Identify key concepts within the content after classifying the field. Concepts are the fundamental ideas or categories that form the basis of knowledge within any discipline. They help organize and explain information, making it accessible and relatable.
|
|
46
|
-
|
|
47
|
-
// 1. **Definition of a Concept**: Concepts should be significant ideas that recur within the content and are essential for understanding the main themes.
|
|
48
|
-
// 2. **Inclusion Criteria**: Include a concept only if it is discussed in detail, meaning it is explained thoroughly, tied to specific examples, or highlighted as a critical part of the subject matter.
|
|
49
|
-
|
|
50
|
-
// List the concepts in the following JSON format:
|
|
51
|
-
// json
|
|
52
|
-
// {
|
|
53
|
-
// "concepts": ["concept1", "concept2", "concept3", "..."]
|
|
54
|
-
// }
|
|
55
|
-
// After classifying the content and identifying key concepts, proceed to extract and list verifiable facts. Facts are objective statements that must be supported by empirical evidence or observation, such as specific data on events, people, numbers, dates, or well-established ideas.
|
|
56
|
-
|
|
57
|
-
// 1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
|
|
58
|
-
// 2. **Selection Criteria**: Choose facts based on their significance to the content's main themes or concepts, their educational value, or their foundational role in the subject.
|
|
59
|
-
|
|
60
|
-
// Record the facts in the following JSON format:
|
|
61
|
-
// json
|
|
62
|
-
// {
|
|
63
|
-
// "facts": ["fact1", "fact2", "fact3", "..."]
|
|
64
|
-
// }
|
|
65
|
-
// After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing materials. Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals. If you decide that testing cards don't need to be generated then please provide a reason in less than 90 characters.
|
|
66
|
-
|
|
67
|
-
// 1. **Value Assessment**: Determine if the concepts and facts are essential for understanding the broader topic, are likely to be used in practical scenarios, or help in achieving educational benchmarks.
|
|
68
|
-
// 2. **Criteria for Material Generation**: Generate testing materials if the concepts and facts are central to the content, have broad applicability, and are likely to reinforce or expand the learner’s knowledge significantly.
|
|
69
|
-
|
|
70
|
-
// Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
71
|
-
// json
|
|
72
|
-
// "generate_cards":
|
|
73
|
-
// { state: true or false,
|
|
74
|
-
// false_reason: "reason for marking the source as false. Leave empty for true."
|
|
75
|
-
// }
|
|
76
|
-
|
|
77
|
-
// After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards. These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// 1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
81
|
-
// 2. **Summarization Objective**: Each card is a step in a journey through the content. The series should collectively summarize the source while emphasizing important learning points.
|
|
82
|
-
// 3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
83
|
-
// 4. **Engagement and Flow**: Write in an engaging style that maintains the user’s interest. Arrange the cards in a logical order that reflects the flow of the original content.
|
|
84
|
-
|
|
85
|
-
// Format your output in JSON as follows:
|
|
86
|
-
// json
|
|
87
|
-
// {
|
|
88
|
-
// "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
89
|
-
// }
|
|
90
|
-
// `;
|
|
91
|
-
|
|
92
|
-
const typologyPromptString : any = {
|
|
93
|
-
role: `
|
|
1
|
+
const typologyPromptString = `
|
|
94
2
|
As a dedicated assistant at a learning company, your role involves analyzing educational content to categorize and summarize it. You will process content (in JSON format) that represents text and images from diverse sources such as PDFs, book chapters, videos, and websites. Follow these steps:
|
|
95
3
|
|
|
96
4
|
1. Classify the content into one to three predefined fields of knowledge.
|
|
97
|
-
2.
|
|
98
|
-
3.
|
|
5
|
+
2. Identify key concepts within the content.
|
|
6
|
+
3. Detect concrete facts that are empirically verified and relevant to the subject.
|
|
99
7
|
4. Decide whether the identified concepts and facts should be used to generate learning materials like flashcards based on their educational value.
|
|
100
8
|
5. If the generate_cards is true then summarize the content using a series of summary cards.
|
|
101
9
|
|
|
102
10
|
Please format your findings in this JSON schema:
|
|
11
|
+
json
|
|
103
12
|
{
|
|
104
|
-
"field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
105
|
-
"concepts": ["concept1", "concept2", "concept3", "..."],
|
|
106
|
-
"facts": ["fact1", "fact2", "fact3", "..."],
|
|
107
|
-
"generate_cards":
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
13
|
+
"field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
14
|
+
"concepts": ["concept1", "concept2", "concept3", "..."],
|
|
15
|
+
"facts": ["fact1", "fact2", "fact3", "..."],
|
|
16
|
+
"generate_cards": [
|
|
17
|
+
state: true or false,
|
|
18
|
+
false_reason: "reason for marking the source as false. Leave empty for true."
|
|
19
|
+
],
|
|
20
|
+
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
112
21
|
}
|
|
113
22
|
|
|
114
|
-
|
|
115
23
|
Further instruction on how to perform these tasks are below.
|
|
116
|
-
|
|
117
|
-
fields: `
|
|
118
|
-
Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
24
|
+
Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
119
25
|
|
|
120
26
|
1. Sciences: Focus on Biology, Chemistry, Physics, Astronomy, Mathematics, and Computer Science.
|
|
121
27
|
2. Technology & Engineering: Emphasize Information Technology, Engineering disciplines, AI, and Robotics.
|
|
@@ -135,63 +41,58 @@ Further instruction on how to perform these tasks are below.
|
|
|
135
41
|
16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
|
|
136
42
|
17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
|
|
137
43
|
18. Other: Use for content that doesn’t fit into the above categories.
|
|
138
|
-
`,
|
|
139
|
-
concepts: `
|
|
140
|
-
Extract key concepts within the content after classifying the field. Please be as exhaustive as possible.
|
|
141
44
|
|
|
142
|
-
|
|
143
|
-
Inclusion Criteria: Include a concept only if it is discussed in detail, meaning it is explained thoroughly, tied to specific examples, or highlighted as a critical part of the subject matter.
|
|
144
|
-
List the concepts in the following JSON format:
|
|
45
|
+
Identify key concepts within the content after classifying the field. Concepts are the fundamental ideas or categories that form the basis of knowledge within any discipline. They help organize and explain information, making it accessible and relatable.
|
|
145
46
|
|
|
47
|
+
1. **Definition of a Concept**: Concepts should be significant ideas that recur within the content and are essential for understanding the main themes.
|
|
48
|
+
2. **Inclusion Criteria**: Include a concept only if it is discussed in detail, meaning it is explained thoroughly, tied to specific examples, or highlighted as a critical part of the subject matter.
|
|
49
|
+
|
|
50
|
+
List the concepts in the following JSON format:
|
|
51
|
+
json
|
|
146
52
|
{
|
|
147
|
-
|
|
148
|
-
[
|
|
149
|
-
"concept1",
|
|
150
|
-
"concept2",
|
|
151
|
-
"concept3",
|
|
152
|
-
"..."
|
|
153
|
-
]
|
|
53
|
+
"concepts": ["concept1", "concept2", "concept3", "..."]
|
|
154
54
|
}
|
|
155
|
-
|
|
156
|
-
facts: `
|
|
157
|
-
After classifying the content and identifying key concepts, proceed to extract and list verifiable facts.
|
|
55
|
+
After classifying the content and identifying key concepts, proceed to extract and list verifiable facts. Facts are objective statements that must be supported by empirical evidence or observation, such as specific data on events, people, numbers, dates, or well-established ideas.
|
|
158
56
|
|
|
159
|
-
Definition of a Fact
|
|
160
|
-
Selection Criteria
|
|
161
|
-
Record the facts in the following JSON format:
|
|
57
|
+
1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
|
|
58
|
+
2. **Selection Criteria**: Choose facts based on their significance to the content's main themes or concepts, their educational value, or their foundational role in the subject.
|
|
162
59
|
|
|
60
|
+
Record the facts in the following JSON format:
|
|
61
|
+
json
|
|
163
62
|
{
|
|
164
|
-
|
|
63
|
+
"facts": ["fact1", "fact2", "fact3", "..."]
|
|
165
64
|
}
|
|
166
|
-
`,
|
|
167
|
-
generate: `
|
|
168
65
|
After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing materials. Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals. If you decide that testing cards don't need to be generated then please provide a reason in less than 90 characters.
|
|
169
66
|
|
|
170
|
-
Value Assessment
|
|
171
|
-
Criteria for Material Generation
|
|
172
|
-
Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
67
|
+
1. **Value Assessment**: Determine if the concepts and facts are essential for understanding the broader topic, are likely to be used in practical scenarios, or help in achieving educational benchmarks.
|
|
68
|
+
2. **Criteria for Material Generation**: Generate testing materials if the concepts and facts are central to the content, have broad applicability, and are likely to reinforce or expand the learner’s knowledge significantly.
|
|
173
69
|
|
|
70
|
+
Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
71
|
+
json
|
|
174
72
|
"generate_cards":
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
summarize:`
|
|
73
|
+
{ state: true or false,
|
|
74
|
+
false_reason: "reason for marking the source as false. Leave empty for true."
|
|
75
|
+
}
|
|
76
|
+
|
|
180
77
|
After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards. These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
|
|
181
78
|
|
|
182
|
-
Inclusion Criteria: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
183
|
-
Summarization Objective: Each card is a step in a journey through the content. The series should collectively summarize the source while emphasizing important learning points.
|
|
184
|
-
Character Limit: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
185
|
-
Engagement and Flow: Write in an engaging style that maintains the user’s interest. Arrange the cards in a logical order that reflects the flow of the original content.
|
|
186
|
-
Format your output in JSON as follows:
|
|
187
79
|
|
|
80
|
+
1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
81
|
+
2. **Summarization Objective**: Each card is a step in a journey through the content. The series should collectively summarize the source while emphasizing important learning points.
|
|
82
|
+
3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
83
|
+
4. **Engagement and Flow**: Write in an engaging style that maintains the user’s interest. Arrange the cards in a logical order that reflects the flow of the original content.
|
|
84
|
+
|
|
85
|
+
Format your output in JSON as follows:
|
|
86
|
+
json
|
|
188
87
|
{
|
|
189
|
-
|
|
88
|
+
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
190
89
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
194
95
|
|
|
195
|
-
export function returnTypologyPrompt(
|
|
196
|
-
return
|
|
96
|
+
export function returnTypologyPrompt(){
|
|
97
|
+
return typologyPromptString;
|
|
197
98
|
}
|