Skip to content

Commit

Permalink
#391 done
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Aug 22, 2022
1 parent de4a40e commit 8890b15
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 33 deletions.
Empty file.
13 changes: 0 additions & 13 deletions arekit/contrib/source/common/labels.py

This file was deleted.

9 changes: 9 additions & 0 deletions arekit/contrib/source/rusentiframes/labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from arekit.common.labels.base import Label


class NegativeLabel(Label):
pass


class PositiveLabel(Label):
pass
2 changes: 1 addition & 1 deletion arekit/contrib/source/rusentiframes/labels_fmt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from arekit.contrib.source.common.labels import NegativeLabel, PositiveLabel
from arekit.common.labels.str_fmt import StringLabelsFormatter
from arekit.contrib.source.rusentiframes.labels import PositiveLabel, NegativeLabel


class RuSentiFramesLabelsFormatter(StringLabelsFormatter):
Expand Down
6 changes: 0 additions & 6 deletions arekit/contrib/source/rusentrel/const.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
from arekit.contrib.source.common.labels import PositiveLabel, NegativeLabel

# Defaul label formattings.
POS_LABEL_STR = "pos"
NEG_LABEL_STR = "neg"

# Default label instances.
RUSENTREL_POS_LABEL_TYPE = PositiveLabel
RUSENTREL_NEG_LABEL_TYPE = NegativeLabel
9 changes: 9 additions & 0 deletions arekit/contrib/source/rusentrel/labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from arekit.common.labels.base import Label


class NegativeLabel(Label):
pass


class PositiveLabel(Label):
pass
9 changes: 4 additions & 5 deletions arekit/contrib/source/rusentrel/labels_fmt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from arekit.common.labels.str_fmt import StringLabelsFormatter
from arekit.contrib.source.rusentrel.const import \
NEG_LABEL_STR, POS_LABEL_STR, \
RUSENTREL_NEG_LABEL_TYPE, RUSENTREL_POS_LABEL_TYPE
from arekit.contrib.source.rusentrel.const import NEG_LABEL_STR, POS_LABEL_STR
from arekit.contrib.source.rusentrel.labels import PositiveLabel, NegativeLabel


class RuSentRelLabelsFormatter(StringLabelsFormatter):
Expand All @@ -15,8 +14,8 @@ def __init__(self):

@classmethod
def _positive_label_type(cls):
return RUSENTREL_POS_LABEL_TYPE
return PositiveLabel()

@classmethod
def _negative_label_type(cls):
return RUSENTREL_NEG_LABEL_TYPE
return NegativeLabel()
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from arekit.contrib.source.rusentrel.synonyms import RuSentRelSynonymsCollectionHelper
from arekit.contrib.utils.pipelines.sources.rusentrel.doc_ops import RuSentrelDocumentOperations
from arekit.contrib.utils.pipelines.text_opinion.annot.algo_based import AlgorithmBasedTextOpinionAnnotator
from arekit.contrib.utils.pipelines.text_opinion.annot.predefined import PredefinedTextOpinionAnnotator
from arekit.contrib.utils.pipelines.text_opinion.extraction import text_opinion_extraction_pipeline
from arekit.contrib.utils.pipelines.text_opinion.filters.distance_based import DistanceLimitedTextOpinionFilter
from arekit.contrib.utils.pipelines.text_opinion.filters.entity_based import EntityBasedTextOpinionFilter
Expand Down
9 changes: 9 additions & 0 deletions tests/contrib/source/labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from arekit.common.labels.base import Label


class NegativeLabel(Label):
pass


class PositiveLabel(Label):
pass
2 changes: 1 addition & 1 deletion tests/contrib/source/test_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
sys.path.append('../')

from arekit.common.labels.base import Label, NoLabel
from arekit.contrib.source.common.labels import NegativeLabel, PositiveLabel
from tests.contrib.source.labels import NegativeLabel, PositiveLabel


class TestLabels(unittest.TestCase):
Expand Down
3 changes: 1 addition & 2 deletions tests/contrib/source/test_ruattitudes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from collections import OrderedDict
from tqdm import tqdm


sys.path.append('../../../../')

from arekit.common.opinions.base import Opinion
Expand All @@ -16,7 +15,6 @@
from arekit.common.labels.base import NoLabel
from arekit.common.labels.scaler.base import BaseLabelScaler

from arekit.contrib.source.common.labels import PositiveLabel, NegativeLabel
from arekit.contrib.utils.pipelines.items.text.tokenizer import DefaultTextTokenizer
from arekit.contrib.source.ruattitudes.entity.parser import RuAttitudesTextEntitiesParser
from arekit.contrib.source.ruattitudes.text_object import TextObject
Expand All @@ -29,6 +27,7 @@
from arekit.contrib.source.ruattitudes.news_brat import RuAttitudesNewsConverter

from tests.contrib.source.utils import RuAttitudesSentenceOpinionUtils
from tests.contrib.source.labels import PositiveLabel, NegativeLabel

logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from arekit.common.frames.variants.base import FrameVariant
from arekit.common.frames.variants.collection import FrameVariantsCollection
from arekit.common.labels.base import Label
from arekit.contrib.source.common.labels import NegativeLabel, PositiveLabel
from arekit.contrib.source.rusentiframes.collection import RuSentiFramesCollection
from arekit.contrib.source.rusentiframes.types import RuSentiFramesVersions, RuSentiFramesVersionsService
from arekit.contrib.source.rusentiframes.polarity import RuSentiFramesFramePolarity
from arekit.contrib.source.rusentiframes.effect import FrameEffect
from arekit.contrib.utils.processing.lemmatization.mystem import MystemWrapper
from arekit.contrib.utils.processing.pos.mystem_wrap import POSMystemWrapper
from tests.contrib.source.labels import PositiveLabel, NegativeLabel


def __iter_unique_frame_variants(frames_collection, frame_ids):
Expand Down
3 changes: 2 additions & 1 deletion tests/contrib/source/test_show_frames_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

sys.path.append('../../../../')

from arekit.contrib.source.run_rusentiframes_stat import about_version
from arekit.contrib.source.rusentiframes.types import RuSentiFramesVersions

from tests.contrib.source.test_rusentiframes_stat import about_version


class TestFramesStat(unittest.TestCase):

Expand Down
3 changes: 1 addition & 2 deletions tests/contrib/utils/test_eval.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import unittest
from enum import Enum
import pandas as pd

from os import path
from os.path import dirname

from enum import Enum

from arekit.common.evaluation.comparators.opinions import OpinionBasedComparator
from arekit.common.evaluation.evaluators.cmp_table import DocumentCompareTable
from arekit.common.evaluation.evaluators.modes import EvaluationModes
Expand Down

0 comments on commit 8890b15

Please sign in to comment.