anoopkunchukuttan / indic_nlp_library

Resources and tools for Indian language Natural Language Processing
http://anoopkunchukuttan.github.io/indic_nlp_library/
MIT License
546 stars 158 forks source link

Text Normalisation #41

Closed ShubhamKumarNigam closed 3 years ago

ShubhamKumarNigam commented 3 years ago

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
oligoglot commented 3 years ago

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.

ShubhamKumarNigam commented 3 years ago

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

oligoglot commented 3 years ago

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

Good to hear.

anoopkunchukuttan commented 3 years ago

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