Skip to content

Commit

Permalink
#355. Upd method access.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Jul 4, 2022
1 parent d366908 commit 4706af1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arekit/common/evaluation/comparators/text_opinions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, eval_mode):
self.__eval_mode = eval_mode

@staticmethod
def __text_opinion_to_id(text_opinion):
def text_opinion_to_id(text_opinion):
""" Compose a unique opinion ID, based on the document information,
and indices of the opinion participants.
"""
Expand All @@ -35,14 +35,14 @@ def __iter_diff_core(self, etalon_text_opins, test_text_opins):
assert(isinstance(test_text_opins, list))

test_by_id = TextOpinionBasedComparator.__create_index_by_id(
test_text_opins, id_func=self.__text_opinion_to_id)
test_text_opins, id_func=self.text_opinion_to_id)

etalon_by_id = TextOpinionBasedComparator.__create_index_by_id(
etalon_text_opins, id_func=self.__text_opinion_to_id)
etalon_text_opins, id_func=self.text_opinion_to_id)

for o_etalon in etalon_text_opins:
assert(isinstance(o_etalon, TextOpinion))
o_id = self.__text_opinion_to_id(o_etalon)
o_id = self.text_opinion_to_id(o_etalon)
o_test = test_by_id[o_id] if o_id in test_by_id else None
has_opinion = o_test is not None

Expand All @@ -60,7 +60,7 @@ def __iter_diff_core(self, etalon_text_opins, test_text_opins):

for o_test in test_text_opins:
assert (isinstance(o_test, TextOpinion))
o_id = self.__text_opinion_to_id(o_test)
o_id = self.text_opinion_to_id(o_test)
has_opinion = etalon_by_id[o_id] if o_id in etalon_by_id else None

if has_opinion:
Expand Down

0 comments on commit 4706af1

Please sign in to comment.