GRAAL-Research / deepparse

Deepparse is a state-of-the-art library for parsing multinational street addresses using deep learning
https://deepparse.org/
GNU Lesser General Public License v3.0
299 stars 30 forks source link

Is it possible to know the country from an address without a country? #223

Closed bch80 closed 5 months ago

bch80 commented 5 months ago

Hello,

as an example, I'm using this code:

from deepparse.parser import AddressParser

address_parser = AddressParser(model_type="bpemb", device=0)
parsed_address = address_parser("Benedikt-Schmittm.-Str. 1 40479 Düsseldorf") 

print(parsed_address)
print(parsed_address.PostalCode)
print(parsed_address.Province)

which works nicely - the parts of the address are being recognized - IF they are there. I'm missing the country in this example. Is it somehow possible to 'assume' or infer the country with deepparse?

github-actions[bot] commented 5 months ago

Thank you for you interest in improving Deepparse.

MAYAS3 commented 5 months ago

Hello @Chris8080,

Deepparse doesn't presently recognize the country out-of-the-box unfortunately. But it is something we plan on adding in the future.

In the mean time, if you have address data for you can retrain our models and add a country tag so the models can recognize the country. The docs contain a tutorial on retraining with custom tags.