Skip to content

Commit

Permalink
#468 -- removed parameter debug in nested classes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed May 17, 2023
1 parent 2b10c4f commit 03e30f5
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 21 deletions.
4 changes: 1 addition & 3 deletions arekit/contrib/source/sentinerel/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ def read_collection(cls, filename, version, entities_to_ignore=None):

# Since this dataset does not provide the synonyms collection by default,
# it is necessary to declare an empty collection to populate so in further.
synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(),
is_read_only=False,
debug=False)
synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(), is_read_only=False)

return SentiNerelIOUtils.read_from_zip(
inner_path=SentiNerelIOUtils.get_annotation_innerpath(filename),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def create_text_opinion_extraction_pipeline(rusentrel_version,
synonyms = StemmerBasedSynonymCollection(
iter_group_values_lists=RuSentRelSynonymsCollectionHelper.iter_groups(rusentrel_version),
stemmer=MystemWrapper(),
is_read_only=False,
debug=False)
is_read_only=False)

doc_ops = RuSentrelDocumentOperations(version=rusentrel_version, synonyms=synonyms)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ def create_nolabel_text_opinion_annotator(terms_per_context, dist_in_sents=0, sy
assert(isinstance(dist_in_sents, int))

if synonyms is None:
synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(),
is_read_only=False,
debug=False)
synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(), is_read_only=False)

return AlgorithmBasedTextOpinionAnnotator(
value_to_group_id_func=lambda value:
Expand Down
4 changes: 2 additions & 2 deletions arekit/contrib/utils/synonyms/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

class SimpleSynonymCollection(SynonymsCollection):

def __init__(self, iter_group_values_lists, is_read_only, debug):
def __init__(self, iter_group_values_lists, is_read_only):
super(SimpleSynonymCollection, self).__init__(iter_group_values_lists=iter_group_values_lists,
is_read_only=is_read_only,
debug=debug)
debug=False)

def _create_external_sid(self, value):
return value
Expand Down
4 changes: 2 additions & 2 deletions arekit/contrib/utils/synonyms/stemmer_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class StemmerBasedSynonymCollection(SynonymsCollection):
in which grouping function is based on the stemmed entity values.
"""

def __init__(self, stemmer, iter_group_values_lists=None, is_read_only=True, debug=False):
def __init__(self, stemmer, iter_group_values_lists=None, is_read_only=True):
""" iter_group_values_lists: iterable or None
describes the original set of values for initialization;
If None, then collection is considered as empty.
Expand All @@ -16,7 +16,7 @@ def __init__(self, stemmer, iter_group_values_lists=None, is_read_only=True, deb
self.__stemmer = stemmer
super(StemmerBasedSynonymCollection, self).__init__(iter_group_values_lists=iter_group_values_lists,
is_read_only=is_read_only,
debug=debug)
debug=False)

# region private methods

Expand Down
3 changes: 1 addition & 2 deletions tests/contrib/networks/test_input_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@
class RuSentRelSynonymsCollectionProvider(object):

@staticmethod
def load_collection(stemmer, is_read_only=True, debug=False, version=RuSentRelVersions.V11):
def load_collection(stemmer, is_read_only=True, version=RuSentRelVersions.V11):
assert(isinstance(stemmer, Stemmer))
return StemmerBasedSynonymCollection(
iter_group_values_lists=RuSentRelSynonymsCollectionHelper.iter_groups(version),
debug=debug,
stemmer=stemmer,
is_read_only=is_read_only)

Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/source/test_brat_compound_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test(self):
{"text": self.text, "ind_begin": 0, "ind_end": len(self.text)}
]

synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(), is_read_only=False, debug=False)
synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(), is_read_only=False)

collection = EntityCollection(
self.entities,
Expand Down
3 changes: 1 addition & 2 deletions tests/contrib/utils/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ def invert_label(self, label):
class RuSentRelSynonymsCollectionProvider(object):

@staticmethod
def load_collection(stemmer, is_read_only=True, debug=False, version=RuSentRelVersions.V11):
def load_collection(stemmer, is_read_only=True, version=RuSentRelVersions.V11):
assert(isinstance(stemmer, Stemmer))
return StemmerBasedSynonymCollection(
iter_group_values_lists=RuSentRelSynonymsCollectionHelper.iter_groups(version),
debug=debug,
stemmer=stemmer,
is_read_only=is_read_only)

Expand Down
3 changes: 1 addition & 2 deletions tests/contrib/utils/test_text_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@
class RuSentRelSynonymsCollectionProvider(object):

@staticmethod
def load_collection(stemmer, is_read_only=True, debug=False, version=RuSentRelVersions.V11):
def load_collection(stemmer, is_read_only=True, version=RuSentRelVersions.V11):
assert(isinstance(stemmer, Stemmer))
return StemmerBasedSynonymCollection(
iter_group_values_lists=RuSentRelSynonymsCollectionHelper.iter_groups(version),
debug=debug,
stemmer=stemmer,
is_read_only=is_read_only)

Expand Down
2 changes: 1 addition & 1 deletion tests/tutorials/test_tutorial_collection_binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, contents, value_to_group_id_func):

@classmethod
def read_collection(cls, filename, version):
synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(), is_read_only=False, debug=False)
synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(), is_read_only=False)
return FooIOUtils.read_from_zip(
inner_path=FooIOUtils.get_annotation_innerpath(filename),
process_func=lambda input_file: cls(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test(self):
label_formatter=CustomLabelsFormatter(pos_label_type=PositiveLabel,
neg_label_type=NegativeLabel))

synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(), is_read_only=False, debug=False)
synonyms = StemmerBasedSynonymCollection(stemmer=MystemWrapper(), is_read_only=False)

nolabel_annotator = AlgorithmBasedTextOpinionAnnotator(
annot_algo=PairBasedOpinionAnnotationAlgorithm(
Expand Down

0 comments on commit 03e30f5

Please sign in to comment.