num_replace is used in process function few step later.
Otherwise it will fail on proccessing text with digits:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-17-f80be2d2f8a4> in <module>
----> 1 output = process(process_pipeline, text='привет, как твои дела, засранец, 1000 лет не видел тебя', keep_pos=True, keep_punct=False)
2 output
<ipython-input-10-5cbbe2657eda> in process(pipeline, text, keep_pos, keep_punct)
52 if not named:
53 if pos == 'NUM' and token.isdigit(): # Заменяем числа на xxxxx той же длины
---> 54 lemma = num_replace(token)
55 tagged_propn.append('%s_%s' % (lemma, pos))
56 else:
NameError: name 'num_replace' is not defined
num_replace
is used inprocess
function few step later.Otherwise it will fail on proccessing text with digits: