<commit_before>from collections import deque
from nltk.corpus import wordnet as wn

from .wordnet_get import Transformer as WNGet

class Transformer (WNGet):

    def __init__ (self, min_depth = 4, **kwds):
        super().__init__(**kwds)
        if not hasattr(self, 'node_from_concept'):
            self.node_from_concept = dict()
        self.min_depth = 4

    def post_insertion (self, sentence_nodes, graph):
        super().post_insertion(sentence_nodes, graph)
        g = graph._g
        # Extend with hypernyms
        to_extend = deque(sentence_nodes)
        while len(to_extend)>0:
            n = to_extend.popleft()
            node = g.node[n]
            ss = node['gram'].get('synset')
            if not ss:
                continue
            for cc in ss.hypernyms() + ss.instance_hypernyms():
                depth = ss.min_depth()
                if depth < self.min_depth:<commit_msg>Bug with parameters<commit_after>from collections import deque
from nltk.corpus import wordnet as wn

from .wordnet_get import Transformer as WNGet

class Transformer (WNGet):

    def __init__ (self, min_depth = 4, **kwds):
        super().__init__(**kwds)
        if not hasattr(self, 'node_from_concept'):
            self.node_from_concept = dict()
        self.min_depth = min_depth

    def post_insertion (self, sentence_nodes, graph):
        super().post_insertion(sentence_nodes, graph)
        g = graph._g
        # Extend with hypernyms
        to_extend = deque(sentence_nodes)
        while len(to_extend)>0:
            n = to_extend.popleft()
            node = g.node[n]
            ss = node['gram'].get('synset')
            if not ss:
                continue
            for cc in ss.hypernyms() + ss.instance_hypernyms():
                depth = ss.min_depth()
                if depth < self.min_depth:
{'fraction_non_alphanumeric': 0.09793253536452666, 'fraction_numerical': 0.002720348204570185, 'mean_word_length': 2.1435897435897435, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2082292', 'n_tokens_mistral': 575, 'n_tokens_neox': 552, 'n_words': 141}