Skip to content

Commit

Permalink
#521 added
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Sep 14, 2023
1 parent 219eeca commit 483029a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion arekit/common/data/const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ID = 'id'
DOC_ID = 'doc_id'
TEXT = 'text_a'
LABEL_UINT = 'label'
LABEL_UINT = 'label_uint'
LABEL_STR = 'label_str'

# Global identifier of the opinion in the sampled data.
OPINION_ID = "opinion_id"
Expand Down
4 changes: 3 additions & 1 deletion arekit/common/data/input/providers/rows/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ def __assign_value(column, value):
expected_label = text_opinion_linkage.get_linked_label()

if self.__store_labels:
row[const.LABEL_UINT] = self._label_provider.calculate_output_uint_label(
uint_label = self._label_provider.calculate_output_uint_label(
expected_uint_label=self._label_provider.LabelScaler.label_to_uint(expected_label),
etalon_uint_label=self._label_provider.LabelScaler.label_to_uint(etalon_label))
row[const.LABEL_UINT] = uint_label
row[const.LABEL_STR] = type(self._label_provider.LabelScaler.uint_to_label(uint_label)).__name__

sentence_terms, actual_s_ind, actual_t_ind = self._provide_sentence_terms(
parsed_doc=parsed_doc, sentence_ind=sentence_ind, s_ind=s_ind, t_ind=t_ind)
Expand Down

0 comments on commit 483029a

Please sign in to comment.