GRAAL-Research / deepparse

Deepparse is a state-of-the-art library for parsing multinational street addresses using deep learning

Home Page:https://deepparse.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Unable to load fasttext attention model

Tangolin opened this issue · comments

Describe the bug
When a fasttext_attention retrained model is loaded, the handle_model_name() function in tools.py incorrectly creates the model type as 'fasttext_' instead of 'fasttext', therefore we are unable to load a retrained Fasttext model.

To Reproduce

address_parser = AddressParser(
    model_type='fasttext', attention_mechanism=True, path_to_retrained_model="./path/to/fasttext_attention_model")

Expected behavior
The model type should be created correctly and the model can then be loaded.

Screenshots
Screenshot of the error message:
Screenshot 2022-07-27 at 10 46 10 AM

The part of code causing the problem:
Screenshot 2022-07-27 at 10 48 55 AM

Desktop (please complete the following information):

  • OS: Debian
  • Version 10

Thank you for you interest in improving Deepparse.

Hi @Tangolin,

TKS for reporting this error. It is a bug due to a change in 0.7.5. In this release, we have introduced the user named retrain parsing model, and to do so, we had to change the model naming (it was "FasttextAttention" before). Thus, we were not removing the underscore. Nice catch!

I have just pushed a bug-fix; as soon as tests pass, I will merge it in dev and release a bug-fix today.

Merge in dev (259b7ac) and will be release in 0.8.2