Skip to content

Commit

Permalink
#240 related.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Dec 24, 2021
1 parent 26a428f commit 4164be8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions arekit/common/data/pipeline/item_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from arekit.common.pipeline.item import BasePipelineItem


# TODO. #240. Item handle, iter, map move into base pipeline folder
class HandleIterPipelineItem(BasePipelineItem):

def __init__(self, handle_func=None):
Expand Down
1 change: 1 addition & 0 deletions arekit/common/data/pipeline/item_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from arekit.common.pipeline.item import BasePipelineItem


# TODO. #240. Item handle, iter, map move into base pipeline folder
class FilterPipelineItem(BasePipelineItem):

def __init__(self, filter_func=None):
Expand Down
1 change: 1 addition & 0 deletions arekit/common/data/pipeline/item_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from arekit.common.pipeline.item import BasePipelineItem


# TODO. #240. Item handle, iter, map move into base pipeline folder
class MapPipelineItem(BasePipelineItem):

def __init__(self, map_func=None):
Expand Down
10 changes: 7 additions & 3 deletions arekit/contrib/networks/core/callback/utils_model_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def evaluate_model(experiment, label_scaler, data_type, epoch_index, model,


# TODO. Pass TsvInputOpinionReader.
# TODO. #240 Move and refactor the code below and place at common/data/output/pipelines/to_collections.py
def __convert_output_to_opinion_collections(exp_io, opin_ops, doc_ops, labels_scaler,
output_storage, data_type, epoch_index,
supported_collection_labels, label_calc_mode, labels_formatter):
Expand Down Expand Up @@ -125,7 +126,9 @@ def __convert_output_to_opinion_collections(exp_io, opin_ops, doc_ops, labels_sc
linked_iter=linkages_iter,
supported_labels=supported_collection_labels,
create_opinion_collection=opin_ops.create_opinion_collection,
label_scaler=labels_scaler))),
label_scaler=labels_scaler,
label_calc_mode=label_calc_mode))
),
])

# Executing pipeline.
Expand All @@ -145,13 +148,14 @@ def __convert_output_to_opinion_collections(exp_io, opin_ops, doc_ops, labels_sc
target=target)


def __create_opinion_collection(linked_iter, supported_labels, label_scaler, create_opinion_collection):
def __create_opinion_collection(linked_iter, supported_labels, label_scaler, create_opinion_collection,
label_calc_mode):
return create_opinion_collection(
create_opinion_collection=create_opinion_collection,
linked_data_iter=linked_iter,
labels_helper=SingleLabelsHelper(label_scaler),
to_opinion_func=__create_labeled_opinion,
label_calc_mode=LabelCalculationMode.AVERAGE,
label_calc_mode=label_calc_mode,
supported_labels=supported_labels)


Expand Down

0 comments on commit 4164be8

Please sign in to comment.