snipsco / snips-nlu

Snips Python library to extract meaning from text
https://snips-nlu.readthedocs.io
Apache License 2.0
3.88k stars 515 forks source link

numpy == 1.24.3 throws attribute error - deprecated np.float #908

Open wario420 opened 1 year ago

wario420 commented 1 year ago

Description Quickstart training procedure as described in Docs throws AttributeError.

AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20;

Reproduce Run tranining procedure with nlu_engine.fit() on virtenv with python 3.8 and numbpy == > 1.20.

`import io import json from snips_nlu import SnipsNLUEngine

with io.open() as f: sample_dataset = json.load(f)

nlu_engine = SnipsNLUEngine()

nlu_engine.fit(sample_dataset)

parsing = nlu_engine.parse("Whats the weather today in Tokyo?") print(json.dumps(parsing, indent=2))`

Expected behavior Output json as described in the docs quickstart.

If run with numbpy == < 1.20 output is generated as expected.

Environment:

nijanthan-git commented 10 months ago

Did you tried numpy==1.23.3 version? because, this issue resolved for this version