Add the pretrained weights
Browse files- README.md +51 -0
- config.json +9 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- model_hub_mixin
|
| 4 |
+
- pytorch_model_hub_mixin
|
| 5 |
+
- address-parsing
|
| 6 |
+
- deepparse
|
| 7 |
+
license: mit
|
| 8 |
+
datasets:
|
| 9 |
+
- deepparse/worldwide-addresses
|
| 10 |
+
library_name: deepparse
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# deepparse model2vec-32m-attention
|
| 14 |
+
|
| 15 |
+
A [deepparse](https://deepparse.org) address parser (Seq2Seq, with attention mechanism) using the
|
| 16 |
+
[minishlab/potion-base-32M](https://huggingface.co/minishlab/potion-base-32M) Model2Vec static embeddings (512
|
| 17 |
+
dimensions).
|
| 18 |
+
|
| 19 |
+
```python
|
| 20 |
+
from deepparse.parser import AddressParser
|
| 21 |
+
|
| 22 |
+
address_parser = AddressParser(model_type="model2vec-32m", attention_mechanism=True)
|
| 23 |
+
address_parser("350 rue des Lilas Ouest Québec Québec G1L 1B6")
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
Install it with `pip install deepparse[model2vec]`.
|
| 27 |
+
|
| 28 |
+
## Training
|
| 29 |
+
|
| 30 |
+
- Data: the [deepparse/worldwide-addresses](https://huggingface.co/datasets/deepparse/worldwide-addresses) dataset
|
| 31 |
+
(20 countries, 100,000 clean and 50,000 incomplete addresses per country), 90% for training and 10% for validation.
|
| 32 |
+
`Suburb` and `District` are mapped to `Municipality`, and the `County` and `Country` words are removed.
|
| 33 |
+
- Architecture: encoder and decoder hidden size 1024, one layer each, with an attention mechanism.
|
| 34 |
+
- Selection: the hidden size (128, 256, 512 or 1024) with the lowest mean validation loss over 5 seeds, then the
|
| 35 |
+
seed with the lowest validation loss (seed 43, best epoch 39).
|
| 36 |
+
|
| 37 |
+
## Results
|
| 38 |
+
|
| 39 |
+
| | Accuracy (%) |
|
| 40 |
+
|---|---|
|
| 41 |
+
| Test, this model | 98.42 |
|
| 42 |
+
| Test, mean ± std over the 5 seeds of this configuration | 97.89 ± 0.58 |
|
| 43 |
+
| Validation, this model | 98.65 |
|
| 44 |
+
|
| 45 |
+
The accuracy is the per-word tag accuracy on the test split of the rebuilt worldwide-addresses data.
|
| 46 |
+
|
| 47 |
+
## Limitations
|
| 48 |
+
|
| 49 |
+
The source data has no `Orientation` nor `GeneralDelivery` tags: the model has these outputs but never predicts them
|
| 50 |
+
(the street orientation, e.g. `Ouest` or `NW`, is part of the `StreetName`). South Korea has almost only incomplete
|
| 51 |
+
addresses.
|
config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"attention_mechanism": true,
|
| 3 |
+
"decoder_hidden_size": 1024,
|
| 4 |
+
"decoder_num_layers": 1,
|
| 5 |
+
"encoder_hidden_size": 1024,
|
| 6 |
+
"encoder_num_layers": 1,
|
| 7 |
+
"input_size": 512,
|
| 8 |
+
"output_size": 9
|
| 9 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1fd0d5e0e6867a86be45662f9e38409019546699f9895e9f9c18b6ca29834641
|
| 3 |
+
size 67241476
|