No parsing?
RiccardoPizzutti opened this issue · comments
Hey guys,
i installed deepparse on a SageMaker Studio instance. Then i tried this:
from deepparse.parser import AddressParser
address_parser = AddressParser(model_type="bpemb", device=0)
parsed_address = address_parser("Moltkestrasse 27 50674 Köln")
print(parsed_address)
The result is just the parsed string "Moltkestrasse 27 50674 Köln" no errors etc.
Is that a bug?
Thank you very much for your efforts!
Hello @RiccardoPizzutti,
That's actually normal because printing a FormattedParsedAddress directly only prints the string representation of the address itself. If you wish to obtain the parsing, try running the following:
from deepparse.parser import AddressParser
address_parser = AddressParser(model_type="bpemb", device=0)
parsed_address = address_parser("Moltkestrasse 27 50674 Köln")
print(parsed_address.parsed_address_components)
You can check out the docs for more details.
Thanks for your interest in deepparse!
Let me know if you have any further questions or comments!
Seeing this, I think our print is not clear. So I have added the following pattern when someone prints a parsed address "The unparse address is X and the parsed address is Y."
I've also added a few examples in the code doc, README and main Web page.
It will be included in release 0.7.4. Marouane's approach will still work, but a print will show the unparse address and the parsed address by default.
See PR #126.