Skip to content

Commit

Permalink
#368 done
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Jul 13, 2022
1 parent 13a05bf commit e47d3a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
14 changes: 1 addition & 13 deletions arekit/common/experiment/api/ctx_serialization.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
from arekit.common.experiment.api.ctx_base import ExperimentContext
from arekit.common.labels.scaler.base import BaseLabelScaler
from arekit.common.opinions.annot.base import BaseOpinionAnnotator


class ExperimentSerializationContext(ExperimentContext):
""" Data, that is necessary for models training stage.
"""

def __init__(self, label_scaler, annot, name_provider):
def __init__(self, label_scaler, name_provider):
assert(isinstance(label_scaler, BaseLabelScaler))
assert(isinstance(annot, BaseOpinionAnnotator) or annot is None)
super(ExperimentSerializationContext, self).__init__(name_provider=name_provider)

self.__label_scaler = label_scaler

self.__annot = annot

@property
def LabelsScaler(self):
""" Declares the amount of labels utilized in experiment. The latter
Expand All @@ -27,14 +23,6 @@ def LabelsScaler(self):
def LabelsCount(self):
return self.__label_scaler.LabelsCount

@property
def Annotator(self):
""" Provides an instance of annotator that might be utilized
for attitudes labeling within a specific set of documents,
declared in a particular experiment.
"""
return self.__annot

@property
def FramesConnotationProvider(self):
raise NotImplementedError()
Expand Down
5 changes: 2 additions & 3 deletions arekit/contrib/networks/core/input/ctx_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

class NetworkSerializationContext(ExperimentSerializationContext):

def __init__(self, labels_scaler, annot, name_provider):
def __init__(self, labels_scaler, name_provider):
super(NetworkSerializationContext, self).__init__(
label_scaler=labels_scaler, annot=annot,
name_provider=name_provider)
label_scaler=labels_scaler, name_provider=name_provider)
self.__label_provider = MultipleLabelProvider(labels_scaler)

@property
Expand Down

0 comments on commit e47d3a3

Please sign in to comment.