Skip to content

Commit 584b6e7

Browse files
alex-graber-pmiahgraber
authored andcommitted
fix: minor docstring updates to SingleHopSpecificQuerySynthesizer
1 parent 5ac7608 commit 584b6e7

File tree

1 file changed

+7
-4
lines changed
  • ragas/src/ragas/testset/synthesizers/single_hop

1 file changed

+7
-4
lines changed

ragas/src/ragas/testset/synthesizers/single_hop/specific.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ class SingleHopScenario(BaseScenario):
3939

4040
@dataclass
4141
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"
4445
property_name: str = "entities"
46+
theme_persona_matching_prompt: PydanticPrompt = ThemesPersonasMatchingPrompt()
4547

4648
def get_node_clusters(self, knowledge_graph: KnowledgeGraph) -> t.List[Node]:
47-
49+
"""Identify clusters of nodes based on the entity of interest."""
4850
node_type_dict = defaultdict(int)
4951
for node in knowledge_graph.nodes:
5052
if (
@@ -81,7 +83,8 @@ async def _generate_scenarios(
8183
callbacks: Callbacks,
8284
) -> t.List[SingleHopScenario]:
8385
"""
84-
Generates a list of scenarios on type SingleHopSpecificQuerySynthesizer
86+
Generate a list of scenarios of type SingleHopScenario.
87+
8588
Steps to generate scenarios:
8689
1. Find nodes with CHUNK type and entities property
8790
2. Calculate the number of samples that should be created per node to get n samples in total

0 commit comments

Comments
 (0)