<commit_before>import gensim
import nltk
from gensim.models.ldamulticore import LdaMulticore
from nltk.corpus import stopwords


nltk.download('stopwords')
ru_stopwords = set(stopwords.words('russian'))

with open('data/stopwords.txt') as f:
    for line in f:
        ru_stopwords.add(line.lower().strip())


class LdaMaker:
    def __init__(self, corpora, num_topics, print_topics=True):
        self.num_topics = num_topics

        self.tokenizer = nltk.tokenize.TreebankWordTokenizer()
        self.stemmer = nltk.stem.snowball.RussianStemmer()

        corpora_tokenzied = [self.tokenizer.tokenize((self._keep_only_russian_chars(str(doc).lower()))) for doc in corpora]
<commit_msg>Disable nltk stopwords<commit_after>import gensim
import nltk
from gensim.models.ldamulticore import LdaMulticore


ru_stopwords = set()
with open('data/stopwords.txt') as f:
    for line in f:
        ru_stopwords.add(line.lower().strip())


class LdaMaker:
    def __init__(self, corpora, num_topics, print_topics=True):
        self.num_topics = num_topics

        self.tokenizer = nltk.tokenize.TreebankWordTokenizer()
        self.stemmer = nltk.stem.snowball.RussianStemmer()

        corpora_tokenzied = [self.tokenizer.tokenize((self._keep_only_russian_chars(str(doc).lower()))) for doc in corpora]

{'fraction_non_alphanumeric': 0.10888030888030888, 'fraction_numerical': 0.0, 'mean_word_length': 4.311475409836065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4797959', 'n_tokens_mistral': 470, 'n_tokens_neox': 458, 'n_words': 83}