Skip to content

Commit

Permalink
refactor: change test_size to testset_size
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmachan committed Oct 14, 2024
1 parent 6780faf commit c6cbd26
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/ragas/testset/synthesizers/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def from_langchain(
def generate_with_langchain_docs(
self,
documents: t.Sequence[LCDocument],
test_size: int,
testset_size: int,
transforms: t.Optional[Transforms] = None,
query_distribution: t.Optional[QueryDistribution] = None,
run_config: t.Optional[RunConfig] = None,
Expand Down Expand Up @@ -90,7 +90,7 @@ def generate_with_langchain_docs(
self.knowledge_graph = kg

return self.generate(
test_size=test_size,
testset_size=testset_size,
query_distribution=query_distribution,
run_config=run_config,
callbacks=callbacks,
Expand All @@ -100,7 +100,7 @@ def generate_with_langchain_docs(

def generate(
self,
test_size: int,
testset_size: int,
query_distribution: t.Optional[QueryDistribution] = None,
run_config: t.Optional[RunConfig] = None,
callbacks: t.Optional[Callbacks] = None,
Expand All @@ -112,7 +112,7 @@ def generate(
Parameters
----------
test_size : int
testset_size : int
The number of samples to generate.
query_distribution : Optional[QueryDistribution], optional
A list of tuples containing scenario simulators and their probabilities.
Expand Down Expand Up @@ -147,7 +147,7 @@ def generate(
# new group for Testset Generation
testset_generation_rm, testset_generation_grp = new_group(
name=RAGAS_TESTSET_GENERATION_GROUP_NAME,
inputs={"test_size": test_size},
inputs={"testset_size": testset_size},
callbacks=callbacks,
)

Expand All @@ -160,7 +160,7 @@ def generate(
patch_logger("ragas.experimental.testset.transforms", logging.DEBUG)

splits, _ = calculate_split_values(
[prob for _, prob in query_distribution], test_size
[prob for _, prob in query_distribution], testset_size
)
# new group for Generation of Scenarios
scenario_generation_rm, scenario_generation_grp = new_group(
Expand All @@ -178,7 +178,7 @@ def generate(
)
# generate samples
splits, _ = calculate_split_values(
[prob for _, prob in query_distribution], test_size
[prob for _, prob in query_distribution], testset_size
)
for i, (scenario, _) in enumerate(query_distribution):
exec.submit(scenario.generate_scenarios, splits[i], self.knowledge_graph)
Expand Down Expand Up @@ -229,7 +229,7 @@ def generate(
e.__class__.__name__.lower() for e, _ in query_distribution
],
evolution_percentages=[p for _, p in query_distribution],
num_rows=test_size,
num_rows=testset_size,
language="english",
)
)
Expand Down

0 comments on commit c6cbd26

Please sign in to comment.