An address parser for Canadian postal addressess
Project description
ez-address-parser
An address parser for Canadian postal addressess
Install
From PyPi
pip install ez-address-parser
From GitHub
pip install git+https://github.com/zehengl/ez-address-parser.git
Usage
Command Line
python -m ez_address_parser --address <some-address>
Code (with pretrained model)
from ez_address_parser import AddressParser
ap = AddressParser()
address = input("Address: ")
result = ap.parse(address)
for token, label in result:
print(f"{token:20s} -> {label}")
Code (without pretrained model)
from ez_address_parser import AddressParser
ap = AddressParser(use_pretrained=False)
data = [
[
('123', 'StreetNumber'),
('Main', 'StreetName'),
('St', 'StreetType'),
('E', 'StreetDirection')
],
...
] # list of list of (<token>, <label>) tuple
ap.train(data)
address = input("Address: ")
result = ap.parse(address)
for token, label in result:
print(f"{token:20s} -> {label}")
Test
python setup.py test
Develop
pip install -r requirements-dev.txt
Annotation
python .\ez_address_annotator\data\convert.py
python .\ez_address_annotator\data\create_seed.py
label-studio start ez_address_annotator
label-studio
provides an ease of use interface for name entity recognition. See the below example.
Pretrained Model
python .\ez_address_annotator\data\export.py
python .\create_pretrained_model.py
130 annotated adddresses are used to train a default model that comes with this package.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for ez_address_parser-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c9e83c7d9167d1cf94e5711bfe572a57c87d3175c75ee36fb55a4eb88cb9263 |
|
MD5 | 9ee9605ee365cda7703083782afff93e |
|
BLAKE2b-256 | e4bdedcb2fb701bf7a40db1c856f2df7db0d7a777c3bbf1ef6e394d9c27a7c9d |