NVIDIA / NeMo-text-processing

NeMo text processing for ASR and TTS
https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/nlp/text_normalization/wfst/wfst_text_normalization.html
Apache License 2.0
246 stars 80 forks source link

"Creating ClassifyFst grammars" message to stdout even with verbose=false #29

Closed xenotropic closed 1 year ago

xenotropic commented 1 year ago

I'm sure I'll figure out how to configure logger to make this not go to stdout, so not a huge issue. But still it would be nice if the default was that I wouldn't get info messages mixed in with my program's output when "Verbose=False" is specified. I'm using, basically from the tutorials:

from nemo_text_processing.text_normalization.normalize import Normalizer
normalizer = Normalizer(input_case='cased', lang='en')
normalizer.normalize (text, verbose=False, punct_post_process=True)

Note that verbose is False. But this still outputs

[NeMo I 2023-02-02 03:32:26 tokenize_and_classify:87] Creating ClassifyFst grammars.

to stdout. Please consider not printing this to stdout when "Verbose=False" was specified. Thank you.

yzhang123 commented 1 year ago

@anand-nv could you please delegate or take a look?

yzhang123 commented 1 year ago

@xenotropic we are right now tight on bandwidth, if possible could you create a PR that fixes this?

anand-nv commented 1 year ago

@yzhang123 Am not able to reproduce this on the current main branch.

anand-nv commented 1 year ago

The default logging level is logging.WARNING . So logging.info messages shouldn't be output unless some other function or environment variable is setting this to logging.INFO globally. verbose=True does not deal with the logger.

anand-nv commented 1 year ago

Confirmed that setting logging level to logging.INFO before importing the Normalizer results in the info messages being displayed on screen. This is not a bug.