Skip to content

Commit

Permalink
fix missing nqk option in other variants
Browse files Browse the repository at this point in the history
  • Loading branch information
tobhey committed Sep 21, 2023
1 parent 1144dde commit 6ca3f82
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions TraceabilityRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def get_model_for_language(self, models):
class AvgCosineRunner(TraceabilityRunner):
DEFAULT_MATRIX_FILE_PATH = "{dataset_folder}/{folder}/{dataset_name}_{name_suffix}_matrix.csv"

def __init__(self, dataset: Dataset):
super().__init__(dataset)
def __init__(self, dataset: Dataset, nqk=False):
super().__init__(dataset, nqk)

self.req_reduce_func = max
self.code_reduce_function = max
Expand All @@ -102,8 +102,11 @@ class ArtifactAvgCosineRunner(AvgCosineRunner):
LABEL = "ArtifactAvgCosine"
DEFAULT_DATASOURCE_SUFFIX = "ArtifactAvgCosine"

def __init__(self, dataset: Dataset, use_types=True, element_filter=None, classname_as_optional_voter=True):
super().__init__(dataset)
def __init__(self, dataset: Dataset, use_types=True, element_filter=None, classname_as_optional_voter=True, nqk=False):
super().__init__(dataset, nqk)
if nqk:
self.LABEL = self.LABEL + "NQK"
self.DEFAULT_DATASOURCE_SUFFIX = self.DEFAULT_DATASOURCE_SUFFIX + "NQK"
if not use_types:
self.LABEL = self.LABEL + "NoTypes"
self.DEFAULT_DATASOURCE_SUFFIX = self.DEFAULT_DATASOURCE_SUFFIX + "NoTypes"
Expand Down Expand Up @@ -246,8 +249,11 @@ class ArtifactWMDRunner(WMDRunner):
DEFAULT_DATASOURCE_SUFFIX = "ArtifactWMD"
WMD_VALUE_MAP_FUNCTION = partial(Util.map_value_range, 0, 2) # Map the wmd distances from [0,2] to [0,1]

def __init__(self, dataset: Dataset, use_types=True, element_filter=None, classname_as_optional_voter=True):
super().__init__(dataset)
def __init__(self, dataset: Dataset, use_types=True, element_filter=None, classname_as_optional_voter=True, nqk=False):
super().__init__(dataset, nqk)
if nqk:
self.LABEL = self.LABEL + "NQK"
self.DEFAULT_DATASOURCE_SUFFIX = self.DEFAULT_DATASOURCE_SUFFIX + "NQK"
if not use_types:
self.LABEL = self.LABEL + "NoTypes"
self.DEFAULT_DATASOURCE_SUFFIX = self.DEFAULT_DATASOURCE_SUFFIX + "NoTypes"
Expand Down Expand Up @@ -374,8 +380,11 @@ class ElementAvgCosineRunner(AvgCosineRunner):
DEFAULT_DATASOURCE_SUFFIX = "ElementAvgCosine"
ARTIFACT_TO_ELEMENT_MAP_FILE_PATTERN = "{dataset_folder}/{folder}/{dataset_name}_{name_suffix}_a2eMap.json"

def __init__(self, dataset: Dataset, use_types=True, element_filter=None, classname_as_optional_voter=True):
super().__init__(dataset)
def __init__(self, dataset: Dataset, use_types=True, element_filter=None, classname_as_optional_voter=True, nqk=False):
super().__init__(dataset, nqk)
if nqk:
self.LABEL = self.LABEL + "NQK"
self.DEFAULT_DATASOURCE_SUFFIX = self.DEFAULT_DATASOURCE_SUFFIX + "NQK"
if not use_types:
self.LABEL = self.LABEL + "NoTypes"
self.DEFAULT_DATASOURCE_SUFFIX = self.DEFAULT_DATASOURCE_SUFFIX + "NoTypes"
Expand Down

0 comments on commit 6ca3f82

Please sign in to comment.