File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
ragas/src/ragas/testset/synthesizers/single_hop Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,14 @@ class SingleHopScenario(BaseScenario):
39
39
40
40
@dataclass
41
41
class SingleHopSpecificQuerySynthesizer (SingleHopQuerySynthesizer ):
42
- name : str = "single_hop_specifc_query_synthesizer"
43
- theme_persona_matching_prompt : PydanticPrompt = ThemesPersonasMatchingPrompt ()
42
+ """Synthesize single-hop queries based on an entity of interest."""
43
+
44
+ name : str = "single_hop_specific_query_synthesizer"
44
45
property_name : str = "entities"
46
+ theme_persona_matching_prompt : PydanticPrompt = ThemesPersonasMatchingPrompt ()
45
47
46
48
def get_node_clusters (self , knowledge_graph : KnowledgeGraph ) -> t .List [Node ]:
47
-
49
+ """Identify clusters of nodes based on the entity of interest."""
48
50
node_type_dict = defaultdict (int )
49
51
for node in knowledge_graph .nodes :
50
52
if (
@@ -81,7 +83,8 @@ async def _generate_scenarios(
81
83
callbacks : Callbacks ,
82
84
) -> t .List [SingleHopScenario ]:
83
85
"""
84
- Generates a list of scenarios on type SingleHopSpecificQuerySynthesizer
86
+ Generate a list of scenarios of type SingleHopScenario.
87
+
85
88
Steps to generate scenarios:
86
89
1. Find nodes with CHUNK type and entities property
87
90
2. Calculate the number of samples that should be created per node to get n samples in total
You can’t perform that action at this time.
0 commit comments