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

Returned span is nondeterministic in some cases #230

Open
jelmerdus opened this issue Jun 21, 2023 · 1 comment
Open

Returned span is nondeterministic in some cases #230

jelmerdus opened this issue Jun 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jelmerdus
Copy link

Describe the bug
In some cases, the returned span changes when the program is started multiple times. Within one run, the results are always the same.

To Reproduce
Run this program 10 times. The result will be [24,25] some times and [24,27] other times.

from quantulum3 import parser
matches = parser.parse("CAVO TRECCIA MARRONE MM 3 x")
print(matches[0].span)

Expected behavior
When using quantulum in a larger piece of software, nondeterministic behavior makes it almost impossible to debug. It is much better to be consistently wrong in some cases than to be nondeterministc.

Screenshots

Additional information:

  • Python Version: Python 3.10, sklearn 1.2.2
  • Classifier activated/ sklearn installed: no/yes
  • OS: Windows 10
  • Version 0.7.9 and 0.9.0

Additional context
Add any other context about the problem here.

@nielstron
Copy link
Owner

Thanks for reporting this! Nondeterministic behaviour is definitely not desireable. Based on what you reported it's likely due to hash-based dictionary ordering not being fully deterministic.

@nielstron nielstron added the bug Something isn't working label Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants