anoopkunchukuttan/indic_nlp_library

Text Normalisation

ShubhamKumarNigam opened this issue · 4 comments

I am trying to run the script but getting an error message on the Text Normalisation part.

The error message is: "TypeError: get_normalizer() takes 2 positional arguments but 3 were given" on line "normalizer=factory.get_normalizer("hi",remove_nuktas)". 

For reference, I have attached the snapshot of the error message.

Screenshot 2021-03-27 at 1 22 57 PM

I haven't used the factory, but can you try the following?
from indicnlp.normalize.indic_normalize import BaseNormalizer
normalizer = BaseNormalizer("hi", remove_nuktas=False)

The same thing could work with the get_normalizer method too. Perhaps because you're passing one of the optional parameters without specifying which. Try get_normalizer("hi", remove_nuktas=remove_nuktas). It's False by default, so you could skip remove_nuktas in this case.

Thank you so much, that's work for me too.

Thank you so much, that's work for me too.

Good to hear.

@oligoglot Thanks for pointing put the solution, closing. It is a keyword argument.