sdg-hub 0.1.0a4__py3-none-any.whl → 0.1.1__py3-none-any.whl
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.
- sdg_hub/_version.py +2 -2
- sdg_hub/blocks/__init__.py +35 -5
- sdg_hub/blocks/block.py +58 -16
- sdg_hub/blocks/llmblock.py +121 -193
- sdg_hub/blocks/utilblocks.py +500 -43
- sdg_hub/checkpointer.py +139 -0
- sdg_hub/configs/annotations/detailed_annotations.yaml +28 -0
- sdg_hub/configs/annotations/simple_annotations.yaml +9 -0
- sdg_hub/configs/knowledge/atomic_facts.yaml +1 -0
- sdg_hub/configs/knowledge/detailed_summary.yaml +1 -0
- sdg_hub/configs/knowledge/extractive_summary.yaml +1 -0
- sdg_hub/configs/knowledge/generate_questions.yaml +82 -0
- sdg_hub/configs/knowledge/generate_responses.yaml +86 -0
- sdg_hub/configs/skills/contexts.yaml +18 -11
- sdg_hub/configs/skills/evaluate_freeform_pair.yaml +79 -12
- sdg_hub/configs/skills/evaluate_freeform_questions.yaml +60 -28
- sdg_hub/configs/skills/evaluate_grounded_pair.yaml +95 -30
- sdg_hub/configs/skills/freeform_questions.yaml +21 -16
- sdg_hub/configs/skills/freeform_responses.yaml +19 -25
- sdg_hub/configs/skills/router.yaml +53 -6
- sdg_hub/flow.py +351 -21
- sdg_hub/flow_runner.py +216 -0
- sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml +26 -9
- sdg_hub/flows/generation/skills/{agentic_improve_skill.yaml → improve_responses.yaml} +26 -31
- sdg_hub/flows/generation/skills/synth_skills.yaml +4 -4
- sdg_hub/pipeline.py +67 -12
- sdg_hub/prompts.py +21 -0
- sdg_hub/sdg.py +128 -86
- sdg_hub/utils/config_validation.py +91 -0
- sdg_hub/utils/validation_result.py +10 -0
- sdg_hub-0.1.1.dist-info/METADATA +190 -0
- sdg_hub-0.1.1.dist-info/RECORD +86 -0
- {sdg_hub-0.1.0a4.dist-info → sdg_hub-0.1.1.dist-info}/WHEEL +1 -1
- sdg_hub/blocks/filterblock.py +0 -76
- sdg_hub/blocks/iterblock.py +0 -31
- sdg_hub/blocks/rmblocks.py +0 -194
- sdg_hub/configs/annotations/simple.yaml +0 -10
- sdg_hub/configs/knowledge/data_recipe/default_recipe.yaml +0 -3
- sdg_hub/configs/skills/data_recipe/default_recipe.yaml +0 -6
- sdg_hub/flows/annotation/emotion/detailed_description.yaml +0 -19
- sdg_hub/flows/annotation/emotion/detailed_description_icl.yaml +0 -19
- sdg_hub/flows/annotation/emotion/simple.yaml +0 -19
- sdg_hub/utils/chunking.py +0 -73
- sdg_hub/utils/docprocessor.py +0 -357
- sdg_hub/utils/parse_and_convert.py +0 -392
- sdg_hub-0.1.0a4.dist-info/METADATA +0 -309
- sdg_hub-0.1.0a4.dist-info/RECORD +0 -90
- /sdg_hub/configs/{knowledge/data_recipe → reasoning}/__init__.py +0 -0
- /sdg_hub/configs/skills/{_G_.yaml → icl_examples/STEM.yaml} +0 -0
- /sdg_hub/configs/skills/{data_recipe → icl_examples}/__init__.py +0 -0
- /sdg_hub/configs/skills/{_A_.yaml → icl_examples/coding.yaml} +0 -0
- /sdg_hub/configs/skills/{_B_.yaml → icl_examples/extraction.yaml} +0 -0
- /sdg_hub/configs/skills/{_C_.yaml → icl_examples/humanities.yaml} +0 -0
- /sdg_hub/configs/skills/{_D_.yaml → icl_examples/math.yaml} +0 -0
- /sdg_hub/configs/skills/{_E_.yaml → icl_examples/reasoning.yaml} +0 -0
- /sdg_hub/configs/skills/{_F_.yaml → icl_examples/roleplay.yaml} +0 -0
- /sdg_hub/configs/skills/{_H_.yaml → icl_examples/writing.yaml} +0 -0
- {sdg_hub-0.1.0a4.dist-info → sdg_hub-0.1.1.dist-info}/licenses/LICENSE +0 -0
- {sdg_hub-0.1.0a4.dist-info → sdg_hub-0.1.1.dist-info}/top_level.txt +0 -0
@@ -1,39 +1,104 @@
|
|
1
|
-
system: You are a
|
1
|
+
system: You are a highly knowledgeable and impartial AI Assistant tasked with evaluating the quality of responses to user questions.
|
2
2
|
|
3
3
|
introduction: |
|
4
|
-
Please act as an
|
4
|
+
Please act as an objective evaluator and assess the quality of the AI Assistant's answer to the user's question. Your job is to determine whether the answer is complete, correct, relevant, safe, and well-written according to the task. Use the scoring rubric below and assign a score from 1 to 3.
|
5
|
+
|
5
6
|
principles: |
|
6
|
-
|
7
|
+
Use the following 3-point scale to score the answer:
|
8
|
+
|
9
|
+
**1 — Poor Quality**
|
10
|
+
- The answer is factually incorrect, off-topic, incomplete, or nonsensical.
|
11
|
+
- It may contain hallucinations, hanging statements, or irrelevant content.
|
12
|
+
- It does not align with the task description or question intent.
|
7
13
|
|
8
|
-
2
|
14
|
+
**2 — Acceptable but Minimal**
|
15
|
+
- The answer is correct and safe, but short and lacks depth or clarity.
|
16
|
+
- It may be technically correct but overly terse or missing explanation.
|
17
|
+
- It satisfies the user's question at a surface level without context.
|
9
18
|
|
10
|
-
3
|
19
|
+
**3 — Excellent Answer**
|
20
|
+
- The answer is complete, correct, relevant, and insightful.
|
21
|
+
- It provides clear reasoning, well-structured writing, and deep understanding.
|
22
|
+
- It directly addresses the question with expert-level knowledge.
|
11
23
|
|
12
24
|
examples: |
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
Example 1 — Score: 1 (Poor Quality)
|
26
|
+
|
27
|
+
Task Description: Summarize the key point of a news paragraph in one sentence.
|
28
|
+
|
29
|
+
[Start of Context]
|
30
|
+
The mayor of Springfield unveiled a new plan to reduce urban pollution, which includes a ban on gas-powered scooters, expansion of bike lanes, and free public transit passes for residents.
|
31
|
+
[End of Context]
|
32
|
+
|
33
|
+
[Start of Question]
|
34
|
+
What is the main point of the paragraph?
|
35
|
+
[End of Question]
|
36
|
+
|
37
|
+
[Start of Answer]
|
38
|
+
Scooters are fun but kind of dangerous if you go too fast lol.
|
39
|
+
[End of Answer]
|
40
|
+
|
41
|
+
[Start of Evaluation]
|
42
|
+
The answer is irrelevant and nonsensical in context. It does not reflect the content of the paragraph and includes casual language and commentary that breaks task intent. It is an example of a hallucinated, off-topic response.
|
43
|
+
[End of Evaluation]
|
44
|
+
|
45
|
+
[Start of Score]
|
46
|
+
1
|
47
|
+
[End of Score]
|
48
|
+
|
49
|
+
Example 2 — Score: 2 (Acceptable but Minimal)
|
50
|
+
|
51
|
+
Task Description: Summarize the key point of a news paragraph in one sentence.
|
52
|
+
|
53
|
+
[Start of Context]
|
54
|
+
The mayor of Springfield unveiled a new plan to reduce urban pollution, which includes a ban on gas-powered scooters, expansion of bike lanes, and free public transit passes for residents.
|
55
|
+
[End of Context]
|
56
|
+
|
57
|
+
[Start of Question]
|
58
|
+
What is the main point of the paragraph?
|
59
|
+
[End of Question]
|
60
|
+
|
61
|
+
[Start of Answer]
|
62
|
+
The city is taking steps to reduce pollution.
|
63
|
+
[End of Answer]
|
64
|
+
|
65
|
+
[Start of Evaluation]
|
66
|
+
The answer is factually correct and safe, but vague. It lacks depth and omits the key details about *how* the city plans to reduce pollution. It does not demonstrate full understanding of the context or question.
|
67
|
+
[End of Evaluation]
|
68
|
+
|
69
|
+
[Start of Score]
|
70
|
+
2
|
71
|
+
[End of Score]
|
72
|
+
|
73
|
+
Example 3 — Score: 3 (Excellent Answer)
|
74
|
+
|
75
|
+
Task Description: Summarize the key point of a news paragraph in one sentence.
|
76
|
+
|
77
|
+
[Start of Context]
|
78
|
+
The mayor of Springfield unveiled a new plan to reduce urban pollution, which includes a ban on gas-powered scooters, expansion of bike lanes, and free public transit passes for residents.
|
79
|
+
[End of Context]
|
80
|
+
|
81
|
+
[Start of Question]
|
82
|
+
What is the main point of the paragraph?
|
83
|
+
[End of Question]
|
84
|
+
|
85
|
+
[Start of Answer]
|
86
|
+
The mayor of Springfield introduced a pollution-reduction plan that bans gas-powered scooters, expands bike lanes, and provides free transit passes to residents.
|
87
|
+
[End of Answer]
|
88
|
+
|
89
|
+
[Start of Evaluation]
|
90
|
+
The answer is complete, relevant, and clearly written. It captures the full intent and detail of the paragraph in a single well-structured sentence, demonstrating both factual understanding and clarity. It aligns perfectly with the task instruction.
|
91
|
+
[End of Evaluation]
|
92
|
+
|
93
|
+
[Start of Score]
|
94
|
+
3
|
95
|
+
[End of Score]
|
32
96
|
|
33
97
|
generation: |
|
34
|
-
|
35
|
-
|
36
|
-
|
98
|
+
Now begin your evaluation of the following QA pair. Use the rubric above and be objective and concise in your reasoning.
|
99
|
+
|
100
|
+
Task Description: {{task_description}}
|
101
|
+
|
37
102
|
[Start of Context]
|
38
103
|
{{ context }}
|
39
104
|
[End of Context]
|
@@ -46,9 +111,9 @@ generation: |
|
|
46
111
|
{{ response }}
|
47
112
|
[End of Answer]
|
48
113
|
|
49
|
-
*
|
50
|
-
*
|
51
|
-
|
114
|
+
* Provide your evaluation between [Start of Evaluation] and [End of Evaluation] tags.
|
115
|
+
* Provide the score between [Start of Score] and [End of Score] tags.
|
116
|
+
* Do not include any content outside these tags.
|
52
117
|
|
53
118
|
start_tags: ["[Start of Evaluation]", "[Start of Score]"]
|
54
119
|
end_tags: ["[End of Evaluation]", "[End of Score]"]
|
@@ -1,29 +1,34 @@
|
|
1
|
-
system: You are a
|
1
|
+
system: You are a highly intelligent and helpful AI Assistant specializing in generating well-crafted questions tailored to specific tasks.
|
2
2
|
|
3
3
|
introduction: |
|
4
|
-
|
4
|
+
Your task is to generate {{num_samples}} diverse and well-structured questions for the following task:
|
5
|
+
"{{task_description}}"
|
5
6
|
|
6
7
|
principles: |
|
7
|
-
Please follow these
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
* Return each question between [Start of Question] and [End of Question] tags.
|
8
|
+
Please follow these strict guidelines when generating each question:
|
9
|
+
* Each question must be directly related to the task description.
|
10
|
+
* Use correct grammar, spelling, and punctuation.
|
11
|
+
* Questions must be clear, natural-sounding, and human-like.
|
12
|
+
* Do **not** include answers, explanations, or commentary—only the question.
|
13
|
+
* Ensure **maximum diversity** in wording and perspective—no repetitive or template-based phrasing.
|
14
|
+
* Each question must strictly follow the **exact same format and style** as shown in the example.
|
15
|
+
* Do **not deviate** from the example structure in any way.
|
16
|
+
* Wrap each question between `[Start of Question]` and `[End of Question]` tags.
|
17
17
|
|
18
18
|
examples: |
|
19
|
-
To
|
20
|
-
|
19
|
+
To guide you, here is an example of a correctly formatted question:
|
20
|
+
|
21
21
|
[Start of Question]
|
22
|
-
{{
|
22
|
+
{{seed_question}}
|
23
23
|
[End of Question]
|
24
24
|
|
25
25
|
generation: |
|
26
|
-
Now generate {{
|
26
|
+
Now generate {{num_samples}} such questions.
|
27
|
+
Ensure that each one is:
|
28
|
+
- Fully relevant to the task description.
|
29
|
+
- Consistent with the example format.
|
30
|
+
- Clearly enclosed between [Start of Question] and [End of Question] tags.
|
31
|
+
Do not include any content outside these tags.
|
27
32
|
|
28
33
|
start_tags: ["[Start of Question]"]
|
29
34
|
end_tags: ["[End of Question]"]
|
@@ -1,45 +1,39 @@
|
|
1
|
-
system: You are a
|
1
|
+
system: You are a highly knowledgeable and precise AI Assistant tasked with generating high-quality responses based strictly on user prompts.
|
2
2
|
|
3
|
-
introduction:
|
3
|
+
introduction: |
|
4
|
+
Your task is to carefully read and understand the user's prompt, and generate a well-structured response that directly addresses it.
|
4
5
|
|
5
6
|
principles: |
|
6
|
-
Please follow these
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
7
|
+
Please follow these strict guidelines when generating your response:
|
8
|
+
* The response must be directly relevant to the given question and accurately fulfill its intent.
|
9
|
+
* The response should be clear, natural, and human-like in tone.
|
10
|
+
* You must strictly follow the **exact structure and formatting** shown in the example.
|
11
|
+
* Do **not** add any extra commentary, explanations, greetings, or metadata.
|
12
|
+
* The response must be enclosed between `[Start of Response]` and `[End of Response]` tags.
|
13
|
+
* Do **not** deviate from the formatting under any circumstance.
|
12
14
|
|
13
15
|
examples: |
|
14
|
-
|
15
|
-
{% if seed_samples is defined %}
|
16
|
-
{% for sample in seed_samples %}
|
17
|
-
[Start of Question]
|
18
|
-
{{ sample.seed_question }}
|
19
|
-
[End of Question]
|
16
|
+
Below is an example of a properly formatted question and response:
|
20
17
|
|
21
|
-
[Start of Response]
|
22
|
-
{{ sample.seed_response }}
|
23
|
-
[End of Response]
|
24
|
-
{% endfor %}
|
25
|
-
{% else %}
|
26
18
|
[Start of Question]
|
27
|
-
{{
|
19
|
+
{{seed_question}}
|
28
20
|
[End of Question]
|
29
21
|
|
30
22
|
[Start of Response]
|
31
|
-
{{
|
23
|
+
{{seed_response}}
|
32
24
|
[End of Response]
|
33
|
-
{% endif %}
|
34
25
|
|
35
26
|
generation: |
|
36
|
-
Now generate a response to the following prompt.
|
27
|
+
Now generate a response to the following prompt. Make sure the response:
|
28
|
+
- Accurately addresses the question.
|
29
|
+
- Strictly follows the example format and style.
|
30
|
+
- Appears **only** between [Start of Response] and [End of Response] tags.
|
37
31
|
|
38
32
|
[Start of Question]
|
39
|
-
{{
|
33
|
+
{{question}}
|
40
34
|
[End of Question]
|
41
35
|
|
42
|
-
Return the response between
|
36
|
+
Return only the response between the tags. Do not add anything outside.
|
43
37
|
|
44
38
|
start_tags: ["[Start of Response]"]
|
45
39
|
end_tags: ["[End of Response]"]
|
@@ -1,12 +1,59 @@
|
|
1
|
-
system:
|
1
|
+
system: |
|
2
|
+
You are a skill classifier. Given a question or task, classify it into exactly one of the following categories:
|
3
|
+
- coding: Questions about programming, software development, algorithms, or technical implementation.
|
4
|
+
- extraction: Tasks that require identifying and pulling out specific pieces of information from text or data, without analysis or transformation. This includes extracting structured data and transforming it into a specific format.
|
5
|
+
- humanities: Questions about economics, social sciences, literature, history, philosophy, or arts that require analysis, comparison, or evaluation.
|
6
|
+
- math: Questions requiring mathematical calculations, proofs, probability, or numerical reasoning.
|
7
|
+
- reasoning: Tasks requiring logical deduction, problem-solving, or analytical thinking.
|
8
|
+
- roleplay: Scenarios requiring adopting a specific role, perspective, or character.
|
9
|
+
- stem: Questions about science, technology, engineering, or mathematics that require explaining technical or scientific concepts.
|
10
|
+
- writing: Tasks that require creating new content, compositions, or text generation.
|
2
11
|
|
3
|
-
|
12
|
+
Only output the category name, and nothing else. Please do not output anything except one of these exact words.
|
4
13
|
|
5
|
-
|
14
|
+
introduction: |
|
15
|
+
Classify the given question into one of the predefined categories based on its primary focus and requirements.
|
6
16
|
|
7
|
-
|
17
|
+
principles: |
|
18
|
+
1. Each question should be classified into exactly one category.
|
19
|
+
2. Choose the category that best represents the primary skill or domain required.
|
20
|
+
3. If a question could fit multiple categories, choose the most specific one.
|
21
|
+
4. Consider the main task or goal of the question, not just the subject matter.
|
22
|
+
5. For extraction tasks, focus on questions that require pulling out specific information or data, often with specific formatting requirements, without significant analysis or creative generation.
|
23
|
+
6. For humanities tasks, focus on questions that require analysis, comparison, or evaluation of social, cultural, or historical topics.
|
24
|
+
7. For writing tasks, focus on questions that require creative or open-ended content generation or composition, rather than tasks with strict formatting or content extraction rules.
|
8
25
|
|
9
|
-
|
26
|
+
examples: |
|
27
|
+
Question: Extract and categorize the health-related themes, such as 'symptoms', 'treatments', and 'prevention'
|
28
|
+
Category: extraction
|
29
|
+
|
30
|
+
Question: Summarize the story with three bullet points using only nouns and adjectives, without verbs.
|
31
|
+
Category: extraction
|
32
|
+
|
33
|
+
Question: Can you analyze the relationship between economic indicators like GDP, interest rates, and consumer behavior?
|
34
|
+
Category: humanities
|
35
|
+
|
36
|
+
Question: Calculate the area of a triangle with base 6 units and height 8 units
|
37
|
+
Category: math
|
38
|
+
|
39
|
+
Question: Suppose you are in a marathon and you just passed the person in third place. What position are you in?
|
40
|
+
Category: reasoning
|
41
|
+
|
42
|
+
Question: You are a medieval blacksmith. Describe your typical workday and the challenges you face
|
43
|
+
Category: roleplay
|
44
|
+
|
45
|
+
Question: In the realm of quantum mechanics, what is wave-particle duality, and how does it contribute to the understanding of quantum systems?
|
46
|
+
Category: STEM
|
47
|
+
|
48
|
+
Question: Write a travel blog post about exploring the ancient temples and street food scene in Bangkok, Thailand
|
49
|
+
Category: writing
|
50
|
+
|
51
|
+
generation: |
|
52
|
+
Question: {{ question }}
|
53
|
+
|
54
|
+
Based on the above question, classify it into exactly one of these categories: coding, extraction, humanities, math, reasoning, roleplay, STEM, or writing.
|
55
|
+
|
56
|
+
Category:
|
10
57
|
|
11
58
|
start_tags: [""]
|
12
|
-
end_tags: [""]
|
59
|
+
end_tags: [""]
|