sdg-hub 0.1.4__py3-none-any.whl → 0.2.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/__init__.py +28 -1
- sdg_hub/_version.py +2 -2
- sdg_hub/core/__init__.py +22 -0
- sdg_hub/core/blocks/__init__.py +58 -0
- sdg_hub/core/blocks/base.py +313 -0
- sdg_hub/core/blocks/deprecated_blocks/__init__.py +29 -0
- sdg_hub/core/blocks/deprecated_blocks/combine_columns.py +93 -0
- sdg_hub/core/blocks/deprecated_blocks/duplicate_columns.py +88 -0
- sdg_hub/core/blocks/deprecated_blocks/filter_by_value.py +103 -0
- sdg_hub/core/blocks/deprecated_blocks/flatten_columns.py +94 -0
- sdg_hub/core/blocks/deprecated_blocks/llmblock.py +479 -0
- sdg_hub/core/blocks/deprecated_blocks/rename_columns.py +88 -0
- sdg_hub/core/blocks/deprecated_blocks/sample_populator.py +58 -0
- sdg_hub/core/blocks/deprecated_blocks/selector.py +97 -0
- sdg_hub/core/blocks/deprecated_blocks/set_to_majority_value.py +88 -0
- sdg_hub/core/blocks/evaluation/__init__.py +9 -0
- sdg_hub/core/blocks/evaluation/evaluate_faithfulness_block.py +564 -0
- sdg_hub/core/blocks/evaluation/evaluate_relevancy_block.py +564 -0
- sdg_hub/core/blocks/evaluation/verify_question_block.py +564 -0
- sdg_hub/core/blocks/filtering/__init__.py +12 -0
- sdg_hub/core/blocks/filtering/column_value_filter.py +188 -0
- sdg_hub/core/blocks/llm/__init__.py +27 -0
- sdg_hub/core/blocks/llm/client_manager.py +398 -0
- sdg_hub/core/blocks/llm/config.py +336 -0
- sdg_hub/core/blocks/llm/error_handler.py +368 -0
- sdg_hub/core/blocks/llm/llm_chat_block.py +542 -0
- sdg_hub/core/blocks/llm/llm_chat_with_parsing_retry_block.py +491 -0
- sdg_hub/core/blocks/llm/prompt_builder_block.py +368 -0
- sdg_hub/core/blocks/llm/text_parser_block.py +357 -0
- sdg_hub/core/blocks/registry.py +331 -0
- sdg_hub/core/blocks/transform/__init__.py +23 -0
- sdg_hub/core/blocks/transform/duplicate_columns.py +88 -0
- sdg_hub/core/blocks/transform/index_based_mapper.py +225 -0
- sdg_hub/core/blocks/transform/melt_columns.py +126 -0
- sdg_hub/core/blocks/transform/rename_columns.py +69 -0
- sdg_hub/core/blocks/transform/text_concat.py +102 -0
- sdg_hub/core/blocks/transform/uniform_col_val_setter.py +101 -0
- sdg_hub/core/flow/__init__.py +20 -0
- sdg_hub/core/flow/base.py +1209 -0
- sdg_hub/core/flow/checkpointer.py +333 -0
- sdg_hub/core/flow/metadata.py +389 -0
- sdg_hub/core/flow/migration.py +198 -0
- sdg_hub/core/flow/registry.py +393 -0
- sdg_hub/core/flow/validation.py +277 -0
- sdg_hub/{utils → core/utils}/__init__.py +7 -4
- sdg_hub/core/utils/datautils.py +63 -0
- sdg_hub/core/utils/error_handling.py +208 -0
- sdg_hub/core/utils/flow_id_words.yaml +231 -0
- sdg_hub/core/utils/flow_identifier.py +94 -0
- sdg_hub/{utils → core/utils}/path_resolution.py +2 -2
- sdg_hub/core/utils/yaml_utils.py +59 -0
- sdg_hub/flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/atomic_facts.yaml +40 -0
- sdg_hub/flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/detailed_summary.yaml +13 -0
- sdg_hub/flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/evaluate_faithfulness.yaml +64 -0
- sdg_hub/flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/evaluate_question.yaml +29 -0
- sdg_hub/flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/evaluate_relevancy.yaml +81 -0
- sdg_hub/flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/extractive_summary.yaml +13 -0
- sdg_hub/flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/flow.yaml +192 -0
- sdg_hub/flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/generate_questions_responses.yaml +54 -0
- sdg_hub-0.2.1.dist-info/METADATA +221 -0
- sdg_hub-0.2.1.dist-info/RECORD +68 -0
- sdg_hub/blocks/__init__.py +0 -42
- sdg_hub/blocks/block.py +0 -96
- sdg_hub/blocks/llmblock.py +0 -375
- sdg_hub/blocks/openaichatblock.py +0 -556
- sdg_hub/blocks/utilblocks.py +0 -597
- sdg_hub/checkpointer.py +0 -139
- sdg_hub/configs/annotations/cot_reflection.yaml +0 -34
- sdg_hub/configs/annotations/detailed_annotations.yaml +0 -28
- sdg_hub/configs/annotations/detailed_description.yaml +0 -10
- sdg_hub/configs/annotations/detailed_description_icl.yaml +0 -32
- sdg_hub/configs/annotations/simple_annotations.yaml +0 -9
- sdg_hub/configs/knowledge/__init__.py +0 -0
- sdg_hub/configs/knowledge/atomic_facts.yaml +0 -46
- sdg_hub/configs/knowledge/auxilary_instructions.yaml +0 -35
- sdg_hub/configs/knowledge/detailed_summary.yaml +0 -18
- sdg_hub/configs/knowledge/evaluate_faithfulness.yaml +0 -68
- sdg_hub/configs/knowledge/evaluate_question.yaml +0 -38
- sdg_hub/configs/knowledge/evaluate_relevancy.yaml +0 -84
- sdg_hub/configs/knowledge/extractive_summary.yaml +0 -18
- sdg_hub/configs/knowledge/generate_code_questions_responses.yaml +0 -39
- sdg_hub/configs/knowledge/generate_questions.yaml +0 -82
- sdg_hub/configs/knowledge/generate_questions_responses.yaml +0 -56
- sdg_hub/configs/knowledge/generate_responses.yaml +0 -86
- sdg_hub/configs/knowledge/mcq_generation.yaml +0 -83
- sdg_hub/configs/knowledge/router.yaml +0 -12
- sdg_hub/configs/knowledge/simple_generate_qa.yaml +0 -34
- sdg_hub/configs/reasoning/__init__.py +0 -0
- sdg_hub/configs/reasoning/dynamic_cot.yaml +0 -40
- sdg_hub/configs/skills/__init__.py +0 -0
- sdg_hub/configs/skills/analyzer.yaml +0 -48
- sdg_hub/configs/skills/annotation.yaml +0 -36
- sdg_hub/configs/skills/contexts.yaml +0 -28
- sdg_hub/configs/skills/critic.yaml +0 -60
- sdg_hub/configs/skills/evaluate_freeform_pair.yaml +0 -111
- sdg_hub/configs/skills/evaluate_freeform_questions.yaml +0 -78
- sdg_hub/configs/skills/evaluate_grounded_pair.yaml +0 -119
- sdg_hub/configs/skills/evaluate_grounded_questions.yaml +0 -51
- sdg_hub/configs/skills/freeform_questions.yaml +0 -34
- sdg_hub/configs/skills/freeform_responses.yaml +0 -39
- sdg_hub/configs/skills/grounded_questions.yaml +0 -38
- sdg_hub/configs/skills/grounded_responses.yaml +0 -59
- sdg_hub/configs/skills/icl_examples/STEM.yaml +0 -56
- sdg_hub/configs/skills/icl_examples/__init__.py +0 -0
- sdg_hub/configs/skills/icl_examples/coding.yaml +0 -97
- sdg_hub/configs/skills/icl_examples/extraction.yaml +0 -36
- sdg_hub/configs/skills/icl_examples/humanities.yaml +0 -71
- sdg_hub/configs/skills/icl_examples/math.yaml +0 -85
- sdg_hub/configs/skills/icl_examples/reasoning.yaml +0 -30
- sdg_hub/configs/skills/icl_examples/roleplay.yaml +0 -45
- sdg_hub/configs/skills/icl_examples/writing.yaml +0 -80
- sdg_hub/configs/skills/judge.yaml +0 -53
- sdg_hub/configs/skills/planner.yaml +0 -67
- sdg_hub/configs/skills/respond.yaml +0 -8
- sdg_hub/configs/skills/revised_responder.yaml +0 -78
- sdg_hub/configs/skills/router.yaml +0 -59
- sdg_hub/configs/skills/simple_generate_qa_freeform.yaml +0 -27
- sdg_hub/configs/skills/simple_generate_qa_grounded.yaml +0 -31
- sdg_hub/flow.py +0 -477
- sdg_hub/flow_runner.py +0 -450
- sdg_hub/flows/generation/knowledge/mmlu_bench.yaml +0 -13
- sdg_hub/flows/generation/knowledge/simple_knowledge.yaml +0 -12
- sdg_hub/flows/generation/knowledge/synth_knowledge.yaml +0 -89
- sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml +0 -136
- sdg_hub/flows/generation/skills/improve_responses.yaml +0 -103
- sdg_hub/flows/generation/skills/simple_freeform_skill.yaml +0 -12
- sdg_hub/flows/generation/skills/simple_grounded_skill.yaml +0 -12
- sdg_hub/flows/generation/skills/synth_grounded_skills.yaml +0 -80
- sdg_hub/flows/generation/skills/synth_skills.yaml +0 -59
- sdg_hub/pipeline.py +0 -121
- sdg_hub/prompts.py +0 -80
- sdg_hub/registry.py +0 -122
- sdg_hub/sdg.py +0 -206
- sdg_hub/utils/config_validation.py +0 -91
- sdg_hub/utils/datautils.py +0 -14
- sdg_hub/utils/error_handling.py +0 -94
- sdg_hub/utils/validation_result.py +0 -10
- sdg_hub-0.1.4.dist-info/METADATA +0 -190
- sdg_hub-0.1.4.dist-info/RECORD +0 -89
- sdg_hub/{logger_config.py → core/utils/logger_config.py} +1 -1
- /sdg_hub/{configs/__init__.py → flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab/README.md} +0 -0
- /sdg_hub/{configs/annotations → flows/qa_generation/document_grounded_qa/multi_summary_qa/instructlab}/__init__.py +0 -0
- {sdg_hub-0.1.4.dist-info → sdg_hub-0.2.1.dist-info}/WHEEL +0 -0
- {sdg_hub-0.1.4.dist-info → sdg_hub-0.2.1.dist-info}/licenses/LICENSE +0 -0
- {sdg_hub-0.1.4.dist-info → sdg_hub-0.2.1.dist-info}/top_level.txt +0 -0
sdg_hub/checkpointer.py
DELETED
@@ -1,139 +0,0 @@
|
|
1
|
-
# SPDX-License-Identifier: Apache-2.0
|
2
|
-
# Standard
|
3
|
-
from typing import Optional, List
|
4
|
-
import uuid
|
5
|
-
|
6
|
-
# Third Party
|
7
|
-
from datasets import Dataset, load_dataset
|
8
|
-
from datasets.data_files import EmptyDatasetError
|
9
|
-
|
10
|
-
# Local
|
11
|
-
from .logger_config import setup_logger
|
12
|
-
from .utils.datautils import safe_concatenate_datasets
|
13
|
-
|
14
|
-
logger = setup_logger(__name__)
|
15
|
-
|
16
|
-
|
17
|
-
class Checkpointer:
|
18
|
-
"""
|
19
|
-
Handles checkpointing functionality for SDG data generation.
|
20
|
-
Manages saving intermediate results and loading existing checkpoints.
|
21
|
-
"""
|
22
|
-
|
23
|
-
def __init__(self, checkpoint_dir: Optional[str] = None, save_freq: Optional[int] = None):
|
24
|
-
"""
|
25
|
-
Initialize the Checkpointer.
|
26
|
-
|
27
|
-
Args:
|
28
|
-
checkpoint_dir: Directory to save/load checkpoints. If None, checkpointing is disabled.
|
29
|
-
save_freq: Frequency for saving intermediate checkpoints during batch processing.
|
30
|
-
"""
|
31
|
-
self.checkpoint_dir = checkpoint_dir
|
32
|
-
self.save_freq = save_freq
|
33
|
-
|
34
|
-
def load_existing_data(self, seed_dataset: Dataset) -> tuple[Dataset, Optional[Dataset]]:
|
35
|
-
"""
|
36
|
-
Load existing checkpoint data and determine what still needs to be generated.
|
37
|
-
|
38
|
-
Args:
|
39
|
-
seed_dataset: Original input dataset
|
40
|
-
|
41
|
-
Returns:
|
42
|
-
Tuple of (remaining_data_to_generate, pre_generated_data)
|
43
|
-
If no checkpoints exist, returns (seed_dataset, None)
|
44
|
-
"""
|
45
|
-
if self.checkpoint_dir is None:
|
46
|
-
return seed_dataset, None
|
47
|
-
|
48
|
-
try:
|
49
|
-
# Load existing checkpoints
|
50
|
-
pre_generated_data = load_dataset(
|
51
|
-
"json", data_dir=self.checkpoint_dir, split="train"
|
52
|
-
)
|
53
|
-
logger.info(
|
54
|
-
f"Loading existing checkpoints from {self.checkpoint_dir}, "
|
55
|
-
f"with {pre_generated_data.num_rows} rows"
|
56
|
-
)
|
57
|
-
|
58
|
-
# Find missing data that still needs to be generated
|
59
|
-
missing_data = self._get_missing_data(seed_dataset, pre_generated_data)
|
60
|
-
|
61
|
-
if missing_data.num_rows == 0:
|
62
|
-
logger.info(
|
63
|
-
f"All seed data has been generated, no missing rows found, "
|
64
|
-
f"returning data from {self.checkpoint_dir}"
|
65
|
-
)
|
66
|
-
return missing_data, pre_generated_data
|
67
|
-
|
68
|
-
logger.info(f"Found {missing_data.num_rows} missing rows in the dataset")
|
69
|
-
return missing_data, pre_generated_data
|
70
|
-
|
71
|
-
except EmptyDatasetError:
|
72
|
-
logger.info(
|
73
|
-
f"No existing checkpoints found in {self.checkpoint_dir}, "
|
74
|
-
f"generating from scratch"
|
75
|
-
)
|
76
|
-
return seed_dataset, None
|
77
|
-
|
78
|
-
def _get_missing_data(self, seed_data: Dataset, generated_data: Dataset) -> Dataset:
|
79
|
-
"""
|
80
|
-
Identify rows in seed_data that are not present in generated_data.
|
81
|
-
|
82
|
-
Args:
|
83
|
-
seed_data: Original seed dataset
|
84
|
-
generated_data: Previously generated dataset
|
85
|
-
|
86
|
-
Returns:
|
87
|
-
Dataset containing only the missing rows from seed_data
|
88
|
-
"""
|
89
|
-
# Get the common columns between the two datasets
|
90
|
-
common_columns = list(
|
91
|
-
set(seed_data.column_names) & set(generated_data.column_names)
|
92
|
-
)
|
93
|
-
|
94
|
-
# Extract the relevant data based on common columns
|
95
|
-
seed_data_common = seed_data.select_columns(common_columns)
|
96
|
-
generated_data_common = generated_data.select_columns(common_columns)
|
97
|
-
|
98
|
-
# Convert to Pandas DataFrames for easier comparison
|
99
|
-
seed_df = seed_data_common.to_pandas()
|
100
|
-
generated_df = generated_data_common.to_pandas()
|
101
|
-
|
102
|
-
# Identify missing rows
|
103
|
-
missing_df = seed_df[
|
104
|
-
~seed_df.apply(tuple, 1).isin(generated_df.apply(tuple, 1))
|
105
|
-
]
|
106
|
-
|
107
|
-
# Convert back to Dataset
|
108
|
-
missing_data = Dataset.from_pandas(missing_df, preserve_index=False)
|
109
|
-
|
110
|
-
return missing_data
|
111
|
-
|
112
|
-
def save_intermediate_checkpoint(self, dataset: Dataset) -> None:
|
113
|
-
"""
|
114
|
-
Save intermediate checkpoint data to disk.
|
115
|
-
|
116
|
-
Args:
|
117
|
-
dataset: Dataset to save as checkpoint
|
118
|
-
"""
|
119
|
-
if self.checkpoint_dir is None:
|
120
|
-
return
|
121
|
-
|
122
|
-
checkpoint_id = uuid.uuid4().hex
|
123
|
-
checkpoint_file = f"{self.checkpoint_dir}/data_checkpoint_{checkpoint_id}.jsonl"
|
124
|
-
logger.info(f"Saving checkpoint to {checkpoint_file}")
|
125
|
-
dataset.to_json(checkpoint_file, orient="records", lines=True)
|
126
|
-
|
127
|
-
def should_save_checkpoint(self, current_split_index: int) -> bool:
|
128
|
-
"""
|
129
|
-
Determine if a checkpoint should be saved based on save frequency.
|
130
|
-
|
131
|
-
Args:
|
132
|
-
current_split_index: Current split index (0-based)
|
133
|
-
|
134
|
-
Returns:
|
135
|
-
True if checkpoint should be saved, False otherwise
|
136
|
-
"""
|
137
|
-
if self.save_freq is None or self.checkpoint_dir is None:
|
138
|
-
return False
|
139
|
-
return (current_split_index + 1) % self.save_freq == 0
|
@@ -1,34 +0,0 @@
|
|
1
|
-
system: You are an AI assistant that uses a Chain of Thought (CoT) approach with reflection to answer queries.
|
2
|
-
introduction: |
|
3
|
-
Task Description: {{ task_description }}
|
4
|
-
principles: |
|
5
|
-
Follow these steps:
|
6
|
-
1. Think through the problem step by step within the [Start of Thinking] and [End of Thinking] tags.
|
7
|
-
2. Reflect on your thinking to check for any errors or improvements within the [Start of Reflection] and [End of Reflection] tags.
|
8
|
-
3. Make any necessary adjustments based on your reflection.
|
9
|
-
4. You can iterate on your thinking and reflection before providing the final answer.
|
10
|
-
5. Provide your final, concise answer within the [Start of Output] and [End of Output] tags.
|
11
|
-
examples: ~
|
12
|
-
generation: |
|
13
|
-
Important: The Thinking, and Reflection sections are for your internal reasoning process only.
|
14
|
-
Do not include any part of the final answer in these sections.
|
15
|
-
The actual response to the query must be entirely contained within the Output tags. Use the following format for your response:
|
16
|
-
|
17
|
-
[Start of Thinking]
|
18
|
-
[Your step-by-step reasoning goes here. This is your internal thought process, not the final answer.]
|
19
|
-
[End of Thinking]
|
20
|
-
[Start of Reflection]
|
21
|
-
[Your reflection on your reasoning, checking for errors or improvements]
|
22
|
-
[End of Reflection]
|
23
|
-
[Iterate your thinking and reflection to make any necessary adjustments based on your reflection.]
|
24
|
-
|
25
|
-
[Start of Output]
|
26
|
-
[Your final, concise answer to the query. This is the only part that will be shown to the user.]
|
27
|
-
[End of Output]
|
28
|
-
[Stop generating any text after the End of Output tag.]
|
29
|
-
|
30
|
-
Here is the query for annotation:
|
31
|
-
{{ prompt }}
|
32
|
-
|
33
|
-
start_tags: ["[Start of Thinking]", "[Start of Output]"]
|
34
|
-
end_tags: ["[End of Reflection]", "[End of Output]"]
|
@@ -1,28 +0,0 @@
|
|
1
|
-
system: You are an expert text classifier trained to label questions from online forums.
|
2
|
-
introduction: "Task Description: You will be given a text and you need to annotate it with one of the following categories: World, Sports, Business, Sci/Tech, Economy"
|
3
|
-
principles: |
|
4
|
-
Please follow these rules when performing the classification:
|
5
|
-
- Focus on the main topic, not peripheral mentions
|
6
|
-
- Choose the most specific applicable category
|
7
|
-
- Only choose category label per question
|
8
|
-
examples: |
|
9
|
-
Text: Bangladesh paralysed by strikes Opposition activists have brought many towns and cities in Bangladesh to a halt, the day after 18 people died in explosions at a political rally.
|
10
|
-
Category: World
|
11
|
-
|
12
|
-
Text: Desiring Stability Redskins coach Joe Gibbs expects few major personnel changes in the offseason and wants to instill a culture of stability in Washington.
|
13
|
-
Category: Sports
|
14
|
-
|
15
|
-
Text: A Cosmic Storm: When Galaxy Clusters Collide Astronomers have found what they are calling the perfect cosmic storm, a galaxy cluster pile-up so powerful its energy output is second only to the Big Bang.
|
16
|
-
Category: Sci/Tech
|
17
|
-
|
18
|
-
Text: Economy builds steam in KC Fed district The economy continued to strengthen in September and early October in the Great Plains and Rocky Mountain regions covered by the Tenth Federal Reserve District, the Federal Reserve Bank of Kansas City said Wednesday.
|
19
|
-
Category: Economy
|
20
|
-
|
21
|
-
generation: |
|
22
|
-
Here is the query for annotation:
|
23
|
-
|
24
|
-
Text: {{text}}
|
25
|
-
Category:
|
26
|
-
|
27
|
-
start_tags: [""]
|
28
|
-
end_tags: [""]
|
@@ -1,32 +0,0 @@
|
|
1
|
-
system: ~
|
2
|
-
introduction: |
|
3
|
-
Task Description: {{ task_description }}
|
4
|
-
principles: ~
|
5
|
-
examples: |
|
6
|
-
To better assist you with this task, here are some examples:
|
7
|
-
{% if questions_and_answers is defined %}
|
8
|
-
{% for sample in questions_and_answers %}
|
9
|
-
[Start of Question]
|
10
|
-
{{ sample.question }}
|
11
|
-
[End of Question]
|
12
|
-
|
13
|
-
[Start of Output]
|
14
|
-
{{ sample.answer }}
|
15
|
-
[End of Output]
|
16
|
-
{% endfor %}
|
17
|
-
{% else %}
|
18
|
-
[Start of Question]
|
19
|
-
{{ seed_question }}
|
20
|
-
[End of Question]
|
21
|
-
|
22
|
-
[Start of Output]
|
23
|
-
{{ seed_response }}
|
24
|
-
[End of Output]
|
25
|
-
{% endif %}
|
26
|
-
generation: |
|
27
|
-
Here is the query for annotation:
|
28
|
-
[Start of Question]
|
29
|
-
{{ prompt }}
|
30
|
-
[End of Question]
|
31
|
-
start_tags: [""]
|
32
|
-
end_tags: [""]
|
File without changes
|
@@ -1,46 +0,0 @@
|
|
1
|
-
system: You are an AI assistant knowledgeable about {{domain}} domain. Be accurate but concise in response.
|
2
|
-
|
3
|
-
introduction: |
|
4
|
-
Please break down the following snippet from an article about {{domain}} into atomic facts.
|
5
|
-
|
6
|
-
principles: |
|
7
|
-
1. Makesure each fact is grounded in the given text.
|
8
|
-
2. Include any necessary information needed to explain the fact or concept
|
9
|
-
3. The atomic facts should be as simple as possible, if it’s compound sentence, break down one more time
|
10
|
-
4. For clarity, avoid using pronouns like ’it’, ’he’, ’she’, ’this’, ’that’ etc., and instead use the full names or titles.
|
11
|
-
5. Focus only on key concepts and facts. Skip any question or problems mentioned in the passage.
|
12
|
-
|
13
|
-
examples: |
|
14
|
-
To help you understand the task, here is an example:
|
15
|
-
[Passage]
|
16
|
-
The tournament was contested by ten national teams, maintaining the same format used in 2019. After six weeks of round-robin matches, India, South Africa, Australia, and New Zealand finished as the top four and qualified for the knockout stage. In the knockout stage, India and Australia beat New Zealand and South Africa, respectively, to advance to the final, played on 19 November at the Narendra Modi Stadium in Ahmedabad. Australia won the final by six wickets, winning their sixth Cricket World Cup title.
|
17
|
-
[Facts]
|
18
|
-
1. The tournament was contested by ten national teams.
|
19
|
-
2. The tournament maintained the same format used in 2019.
|
20
|
-
3. The round-robin matches lasted for six weeks.
|
21
|
-
4. India finished as one of the top four teams.
|
22
|
-
5. South Africa finished as one of the top four teams.
|
23
|
-
6. Australia finished as one of the top four teams.
|
24
|
-
7. New Zealand finished as one of the top four teams.
|
25
|
-
8. India, South Africa, Australia, and New Zealand qualified for the knockout stage.
|
26
|
-
9. In the knockout stage, India beat New Zealand.
|
27
|
-
10. In the knockout stage, Australia beat South Africa.
|
28
|
-
11. India advanced to the final.
|
29
|
-
12. Australia advanced to the final.
|
30
|
-
13. The final was played on 19 November.
|
31
|
-
14. The final was held at the Narendra Modi Stadium in Ahmedabad.
|
32
|
-
15. Australia won the final by six wickets.
|
33
|
-
16. Australia won their sixth Cricket World Cup title.
|
34
|
-
[End]
|
35
|
-
|
36
|
-
|
37
|
-
generation: |
|
38
|
-
Now it's your turn breakdown following snippet from article about {{domain}} into atomic facts following similar style as above examples
|
39
|
-
[Passage]
|
40
|
-
{{document_outline}}
|
41
|
-
{{document}}
|
42
|
-
[Facts]
|
43
|
-
|
44
|
-
|
45
|
-
start_tags: [""]
|
46
|
-
end_tags: [""]
|
@@ -1,35 +0,0 @@
|
|
1
|
-
summary_detailed:
|
2
|
-
- Provide me with a comprehensive summary of the given document.
|
3
|
-
- Prepare a detailed breakdown of the contents of the document for me.
|
4
|
-
- Summarize the document thoroughly, covering all important points.
|
5
|
-
- Create a detailed executive summary of the provided document.
|
6
|
-
- Compose a comprehensive overview of the document's content.
|
7
|
-
- Deliver a detailed synopsis of the material presented in the document.
|
8
|
-
- Furnish me with a detailed analysis of the document's key points.
|
9
|
-
- Generate a thorough summary of the main ideas in the document.
|
10
|
-
- Offer a detailed digest of the information contained in the document.
|
11
|
-
- Supply me with a comprehensive rundown of the document's contents.
|
12
|
-
|
13
|
-
summary_extractive:
|
14
|
-
- Provide me with a summary of the document using extractive methods.
|
15
|
-
- Create an extractive summary for the given document.
|
16
|
-
- Generate an extractive summary from the document that was given to you.
|
17
|
-
- Summarize the document using extractive techniques.
|
18
|
-
- Create a summary of the provided document using extractive methods.
|
19
|
-
- Generate an extractive summary for the document provided.
|
20
|
-
- Using extractive techniques, summarize the given document.
|
21
|
-
- Create a summary of the document using extractive summarization.
|
22
|
-
- Generate an extractive summary of the document that was provided.
|
23
|
-
- Summarize the provided document using extractive summarization techniques.
|
24
|
-
|
25
|
-
summary_atomic_facts:
|
26
|
-
- Identify and list all atomic facts from the document.
|
27
|
-
- Extract all key facts from the given document.
|
28
|
-
- List all the important facts from the provided document.
|
29
|
-
- Highlight all the atomic facts present in the document.
|
30
|
-
- Identify and enumerate all key facts from the given text.
|
31
|
-
- List out all the critical information from the document.
|
32
|
-
- Highlight all the essential facts from the provided text.
|
33
|
-
- Identify and summarize all the important details from the document.
|
34
|
-
- Extract all the atomic facts from the given document.
|
35
|
-
- List all the key takeaways from the provided text.
|
@@ -1,18 +0,0 @@
|
|
1
|
-
system: You are an AI assistant that is expert at summarizing text.
|
2
|
-
|
3
|
-
introduction: |
|
4
|
-
Give me detailed summary for below document, making sure all key points are covered.
|
5
|
-
|
6
|
-
principles: |
|
7
|
-
Do not add any new information.
|
8
|
-
Do not miss any key points from the provided document
|
9
|
-
|
10
|
-
examples: ""
|
11
|
-
|
12
|
-
generation: |
|
13
|
-
Document:
|
14
|
-
{{document_outline}}
|
15
|
-
{{document}}
|
16
|
-
|
17
|
-
start_tags: [""]
|
18
|
-
end_tags: [""]
|
@@ -1,68 +0,0 @@
|
|
1
|
-
system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
|
2
|
-
|
3
|
-
introduction: |
|
4
|
-
Determine if the provided information is corroborated by the given context. Respond with YES if the context substantiates the information, even partially. Answer NO if the context does not support the information.
|
5
|
-
|
6
|
-
principles: |
|
7
|
-
Guidelines
|
8
|
-
- Answer YES when the context provides either direct or indirect evidence supporting the information. Indirect evidence may include contextual implications or inferred connections that reasonably support the information.
|
9
|
-
- Answer NO if the context lacks any supportive evidence, clearly contradicts the information, or if the support provided by the context is too vague or speculative to establish a solid connection to the information.
|
10
|
-
- Avoid using "partially" in your response. If the context provides any reasonable support (direct or indirect) for the information, consider it as a YES.
|
11
|
-
|
12
|
-
Strictly answer in this format
|
13
|
-
[Start of Context]
|
14
|
-
...
|
15
|
-
[End of Context]
|
16
|
-
[Start of Response]
|
17
|
-
...
|
18
|
-
[End of Response]
|
19
|
-
[Start of Explanation]
|
20
|
-
...
|
21
|
-
[End of Explanation]
|
22
|
-
[Start of Answer]
|
23
|
-
...
|
24
|
-
[End of Answer]
|
25
|
-
|
26
|
-
examples: |
|
27
|
-
Example 1:
|
28
|
-
[Start of Context]
|
29
|
-
An apple pie is a fruit pie with apples as the main filling. It's often served with whipped cream, ice cream, custard, or cheddar cheese. Typically, it has a double crust, with pastry above and below the filling. The upper crust can be solid or latticed.
|
30
|
-
[End of Context]
|
31
|
-
[Start of Response]
|
32
|
-
Apple pie is generally double-crusted.
|
33
|
-
[End of Response]
|
34
|
-
[Start of Explanation]
|
35
|
-
The context directly supports the information by stating that apple pie is "generally double-crusted," which matches the information provided.
|
36
|
-
[End of Explanation]
|
37
|
-
[Start of Answer]
|
38
|
-
YES
|
39
|
-
[End of Answer]
|
40
|
-
|
41
|
-
Example 2:
|
42
|
-
[Start of Context]
|
43
|
-
An apple pie is a fruit pie with apples as the main filling. It's often served with whipped cream, ice cream, custard, or cheddar cheese. Typically, it has a double crust, with pastry above and below the filling. The upper crust can be solid or latticed.
|
44
|
-
[End of Context]
|
45
|
-
[Start of Response]
|
46
|
-
Apple pies taste bad.
|
47
|
-
[End of Response]
|
48
|
-
[Start of Explanation]
|
49
|
-
The context does not provide any information about the taste of apple pies. The statement "Apple pies taste bad" is a subjective opinion and is not supported or mentioned in the given context.
|
50
|
-
[Start of Explanation]
|
51
|
-
[Start of Answer]
|
52
|
-
NO
|
53
|
-
[End of Answer]
|
54
|
-
|
55
|
-
generation: |
|
56
|
-
Now, based on the above examples and guidelines, determine if the following information is supported by the context provided. Answer YES or NO.
|
57
|
-
* Return the explanation within the [Start of Explanation] and [End of Explanation] tags.
|
58
|
-
* Return the answer between [Start of Answer] and [End of Answer] tags.
|
59
|
-
|
60
|
-
[Start of Context]
|
61
|
-
{{document}}
|
62
|
-
[End of Context]
|
63
|
-
[Start of Response]
|
64
|
-
{{response}}
|
65
|
-
[End of Response]
|
66
|
-
|
67
|
-
start_tags: ["[Start of Explanation]", "[Start of Answer]"]
|
68
|
-
end_tags: ["[End of Explanation]", "[End of Answer]"]
|
@@ -1,38 +0,0 @@
|
|
1
|
-
system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
|
2
|
-
|
3
|
-
introduction: |
|
4
|
-
Given below question can you verify if it meets below requirements and based on them give a rating of 1 if it meets all of them or 0 otherwise.
|
5
|
-
|
6
|
-
principles: |
|
7
|
-
Here are the requirements:
|
8
|
-
|
9
|
-
Non-Referential Clarity and Contextual Independence: Ensure that the question is self-explanatory and does not rely on specific, unprovided external content, such as particular documents, specific tables, or detailed datasets. The question should be structured to be understandable and clear without requiring direct access to or knowledge of these specific external sources.
|
10
|
-
|
11
|
-
Subject-Aware Completeness: The question should be crafted to be answerable on its own, given a reasonable level of specialized knowledge in the relevant subject area. It is acceptable and encouraged for the question to require specialized understanding pertinent to the topic; however, it should not depend on unique, external information not provided in the question itself. This distinction allows for questions that necessitate a deep understanding of a subject while ensuring they are not tied to specific external content like a particular dataset or a line in a document.
|
12
|
-
|
13
|
-
Please give your answer as short explanation followed by rating of either 0 or 1 as below.
|
14
|
-
|
15
|
-
* Return a short explanation within the [Start of Explanation] and [End of Explanation] tags.
|
16
|
-
* Return the rating on a binary 0/1 scale between [Start of Rating] and [End of Rating] tags.
|
17
|
-
|
18
|
-
[Start of Question]
|
19
|
-
...
|
20
|
-
[End of Question]
|
21
|
-
|
22
|
-
[Start of Explanation]
|
23
|
-
...
|
24
|
-
[End of Explanation]
|
25
|
-
|
26
|
-
[Start of Rating]
|
27
|
-
...
|
28
|
-
[End of Rating]
|
29
|
-
|
30
|
-
examples: ""
|
31
|
-
|
32
|
-
generation: |
|
33
|
-
[Start of Question]
|
34
|
-
{{question}}
|
35
|
-
[End of Question]
|
36
|
-
|
37
|
-
start_tags: ["[Start of Explanation]", "[Start of Rating]"]
|
38
|
-
end_tags: ["[End of Explanation]", "[End of Rating]"]
|
@@ -1,84 +0,0 @@
|
|
1
|
-
system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
|
2
|
-
|
3
|
-
introduction: |
|
4
|
-
Your task is to assess the relevance of a given response to a specific query. This evaluation should be conducted methodically by answering two key questions:
|
5
|
-
|
6
|
-
principles: |
|
7
|
-
1. Subject Matter Relevance: Does the provided response accurately match the subject matter of the user's query? This question aims to determine if the response is directly related to the main topic or issue presented in the query.
|
8
|
-
2. Focus and Perspective Addressing: Does the provided response effectively address the focus or perspective on the subject matter as outlined in the user's query? This question seeks to evaluate whether the response not only matches the subject matter but also aligns with the specific angle or concern raised by the user.
|
9
|
-
|
10
|
-
For each question, assign a score of 1 point if the response meets the criteria, and 0 points if it does not. After evaluating each question, provide detailed feedback explaining your reasoning behind the scores awarded.
|
11
|
-
|
12
|
-
Conclude your evaluation with a total score as a final result. The total score should represent the sum of points assigned for each question, with a maximum possible score of 2 points.
|
13
|
-
Only evaluate the response based on the above criteria, do not create new questions.
|
14
|
-
|
15
|
-
examples: |
|
16
|
-
Example 1:
|
17
|
-
[Start of Question]
|
18
|
-
What is the impact of global warming on polar bears?
|
19
|
-
[End of Question]
|
20
|
-
|
21
|
-
[Start of Response]
|
22
|
-
Global warming leads to melting ice caps, reducing the habitat of polar bears and negatively impacting their hunting grounds.
|
23
|
-
[End of Response]
|
24
|
-
|
25
|
-
[Start of Feedback]
|
26
|
-
- Subject Matter Relevance Score: 1 (The response is directly related to the impact of global warming on polar bears.)
|
27
|
-
- Alignment with Query's Focus Score: 1 (The response specifically addresses how global warming affects polar bears' habitat and hunting grounds.)
|
28
|
-
[End of Feedback]
|
29
|
-
|
30
|
-
[Start of Score]
|
31
|
-
2
|
32
|
-
[End of Score]
|
33
|
-
|
34
|
-
Example 2:
|
35
|
-
[Start of Question]
|
36
|
-
How does photosynthesis work?
|
37
|
-
[End of Question]
|
38
|
-
|
39
|
-
[End of Response]
|
40
|
-
Plants require sunlight and water to grow.
|
41
|
-
[End of Response]
|
42
|
-
|
43
|
-
[Start of Feedback]
|
44
|
-
- Subject Matter Relevance Score: 0 (The response is related to plant growth, but does not specifically address the process of photosynthesis.)
|
45
|
-
- Alignment with Query's Focus Score: 0 (The response fails to detail the photosynthesis process, missing the specific focus of the query.)
|
46
|
-
[End of Feedback]
|
47
|
-
|
48
|
-
[Start of Score]
|
49
|
-
0
|
50
|
-
[End of Score]
|
51
|
-
|
52
|
-
Example 3:
|
53
|
-
[Start of Question]
|
54
|
-
What are the benefits of electric vehicles?
|
55
|
-
[End of Question]
|
56
|
-
|
57
|
-
[Start of Response]
|
58
|
-
Electric vehicles reduce dependency on fossil fuels and decrease greenhouse gas emissions.
|
59
|
-
[End of Response]
|
60
|
-
|
61
|
-
[Start of Feedback]
|
62
|
-
- Subject Matter Relevance Score: 1 (The response matches the query's subject on the benefits of electric vehicles.)
|
63
|
-
- Alignment with Query's Focus Score: 1 (The response effectively addresses the environmental benefits of electric vehicles, aligning with the query's focus.)
|
64
|
-
[End of Feedback]
|
65
|
-
|
66
|
-
[Start of Score]
|
67
|
-
2
|
68
|
-
[End of Score]
|
69
|
-
|
70
|
-
generation: |
|
71
|
-
Begin your response by providing the feedback followed by the score. Be as objective as possible.
|
72
|
-
|
73
|
-
[Start of Question]
|
74
|
-
{{question}}
|
75
|
-
[End of Question]
|
76
|
-
|
77
|
-
[Start of Response]
|
78
|
-
{{response}}
|
79
|
-
[End of Response]
|
80
|
-
|
81
|
-
* Return the feedback within the [Start of Feedback] and [End of Feedback] tags.
|
82
|
-
* Return the final score between [Start of Score] and [End of Score] tags.
|
83
|
-
start_tags: ["[Start of Feedback]", "[Start of Score]"]
|
84
|
-
end_tags: ["[End of Feedback]", "[End of Score]"]
|
@@ -1,18 +0,0 @@
|
|
1
|
-
system: You are an AI assistant that is expert at summarizing text.
|
2
|
-
|
3
|
-
introduction: |
|
4
|
-
Give me detailed extractive summary for below document, making sure all key points are covered.
|
5
|
-
|
6
|
-
principles: |
|
7
|
-
Do not add any new information.
|
8
|
-
Do not miss any key points from the provided document
|
9
|
-
|
10
|
-
examples: ""
|
11
|
-
|
12
|
-
generation: |
|
13
|
-
Document:
|
14
|
-
{{document_outline}}
|
15
|
-
{{document}}
|
16
|
-
|
17
|
-
start_tags: [""]
|
18
|
-
end_tags: [""]
|
@@ -1,39 +0,0 @@
|
|
1
|
-
system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
|
2
|
-
|
3
|
-
introduction: |
|
4
|
-
Can you help me create a question and answer that explains basic concepts from provided document.
|
5
|
-
|
6
|
-
principles: |
|
7
|
-
1. Make sure the answer is grounded in the document and does not include any outside information.
|
8
|
-
2. Include any necessary code snippets presented in the document.
|
9
|
-
3. Properly format the code that is presented in the document.
|
10
|
-
4. Do not reference the document in the question or the answer.
|
11
|
-
5. Complete your response by ending it with [End]
|
12
|
-
|
13
|
-
examples: |
|
14
|
-
[Document]
|
15
|
-
{{icl_document}}
|
16
|
-
|
17
|
-
[QUESTION]
|
18
|
-
{{icl_query_1}}
|
19
|
-
[ANSWER]
|
20
|
-
{{icl_response_1}}
|
21
|
-
[END]
|
22
|
-
|
23
|
-
[QUESTION]
|
24
|
-
{{icl_query_2}}
|
25
|
-
[ANSWER]
|
26
|
-
{{icl_response_2}}
|
27
|
-
[END]
|
28
|
-
|
29
|
-
[QUESTION]
|
30
|
-
{{icl_query_3}}
|
31
|
-
[ANSWER]
|
32
|
-
{{icl_response_3}}
|
33
|
-
[END]
|
34
|
-
|
35
|
-
generation: |
|
36
|
-
[Document]
|
37
|
-
{{document}}
|
38
|
-
|
39
|
-
[Question]
|