Skip to content

Commit

Permalink
#355 refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Jul 26, 2022
1 parent d976cbf commit f146497
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arekit/common/evaluation/comparators/text_opinions.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def calc_diff(self, etalon, test, is_label_supported):
check_is_supported(label=etalon_label, is_label_supported=is_label_supported)
check_is_supported(label=result_label, is_label_supported=is_label_supported)

row = [text_opinion.TextOpinionID,
row = [self.context_opinion_to_id(text_opinion),
"source",
"target",
None if etalon_label is None else label_to_str(etalon_label),
Expand Down
11 changes: 11 additions & 0 deletions arekit/common/evaluation/context_opinion.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def __init__(self, doc_id, source_id, target_id, label, context_id):
self.__target_id = target_id
self.__label = label
self.__context_id = context_id
self.__tag = None

@property
def DocId(self):
Expand All @@ -30,3 +31,13 @@ def TargetId(self):
@property
def Sentiment(self):
return self.__label

@property
def Tag(self):
return self.__tag

def set_tag(self, tag):
self.__tag = tag

def set_label(self, label):
self.__label = label

0 comments on commit f146497

Please sign in to comment.