Skip to content

Commit

Permalink
Changed filename
Browse files Browse the repository at this point in the history
  • Loading branch information
XKTZ committed Sep 16, 2024
1 parent 8f4f729 commit cc22c95
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rank_llm/rerank/listwise/listwise_rankllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def get_output_filename(
name = f"{name}_{dataset_name}"
if self._num_few_shot_examples > 0:
name += f"_{self._num_few_shot_examples}_shot"
name += f"_{self.reorder_policy.param_name()}"
return (
f"{name}_shuffled_{datetime.isoformat(datetime.now())}"
if shuffle_candidates
Expand Down
7 changes: 7 additions & 0 deletions src/rank_llm/rerank/listwise/reorder/reorder_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def reorder(
) -> list[Result]:
pass

@abstractmethod
def param_name(self):
pass

@staticmethod
@abstractmethod
def name() -> str:
Expand Down Expand Up @@ -172,6 +176,9 @@ def reorder(

return results

def param_name(self):
return f"slidingwindow_stp{self._step_size}"

@staticmethod
def name() -> str:
return "sliding_window"
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ def reorder(

return results

def param_name(self):
return f"topdown_tpk{self._top_k}_pvt{self._pivot}"

@staticmethod
def name() -> str:
return "top_down"
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ def reorder(

return results

def param_name(self):
return f"tournamentsort_tpk{self._top_k}_r{self._r}"

@staticmethod
def name() -> str:
return "tournament_sort"

0 comments on commit cc22c95

Please sign in to comment.