Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely verbose logging with "Epoch 1 loss 0.132985497437162 time 0ms" #1366

Open
wickedest opened this issue Dec 30, 2023 · 1 comment
Open

Comments

@wickedest
Copy link

Describe the bug

When using the nlu, the library emits 418 log messages of the form:

Epoch 1 loss 0.132985497437162 time 0ms
Epoch 418 loss 0.00014440620801799714 time 0ms

There is no way to disable it from configuration that I could find. I created MR #1363 that shows how to disable it permanently. From the MR:

The nlu was configured to log by default. I am pretty sure that it cannot be disabled programmatically because there are no settings passed into it from the nlu. It is also extremely annoying to have these log messages output by default. All I did was disable it, but imo, it should probably be using the configured logger, instead of a console.log. I'd also expect that maybe some settings should be passed into the train().

It is extremely annoying. Please fix.

To Reproduce

		const dock = await dockStart({
			settings: {
				log: false,
				nlp: {
					forceNER: true,
					log: false,
					languages: ['en'],
					corpora: [
						path.join(corpus_root, 'en', 'corpus-en-music.json'),
						path.join(corpus_root, 'en', 'corpus-en.json')
					]
				},
				nlu: {
					log: false
				}
			},
			use: [
				'Basic',
				'Nlp',
			]
		});

		const manager = dock.get('nlp');

		const ner = dock.get('ner');
		const builtin = new BuiltinMicrosoft();
		ner.container.register('extract-builtin-??', builtin);
		await manager.train();

Expected behavior
Verbose logging should not be enabled by default.
Logging should be configurable.

Desktop (please complete the following information):

  • Node version 20
@evangeloszotos
Copy link

evangeloszotos commented Jan 18, 2024

I found this way to deactivate it:

import { containerBootstrap } from "@nlpjs/core";
import { Nlp } from "@nlpjs/nlp";

const container = await containerBootstrap();
const nlp = new Nlp({ 
  languages: ["de"], 
  forceNER: true,

  nlu: { log: false }}, //  is doing the trick
  container);

// then use container as desired 
container.use(LangDe);

Works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants