🤗 bert-restore-punctuation-ptbr
🇧🇷 easy-to-use package to restore punctuation of portuguese texts.
This is a bert-base-portuguese-cased model finetuned for punctuation restoration on WikiLingua.
This model is intended for direct use as a punctuation restoration model for the general Portuguese language. Alternatively, you can use this for further fine-tuning on domain-specific texts for punctuation restoration tasks.
Model restores the following punctuations -- [! ? . , - : ; ' ]
The model also restores the upper-casing of words.
🤷 Usage
Below is a quick way to use the template.
- First, install the package.
pip install respunct
- Sample python code.
from respunct import RestorePuncts
model = RestorePuncts()
model.restore_puncts("""
henrique foi no lago pescar com o pedro mais tarde foram para a casa do pedro fritar os peixes""")
# output:
# Henrique foi no lago pescar com o Pedro. Mais tarde, foram para a casa do Pedro fritar os peixes.
🎯 Accuracy
| label | precision | recall | f1-score | support |
|---|---|---|---|---|
| Upper - OU | 0.89 | 0.91 | 0.90 | 69376 |
| None - OO | 0.99 | 0.98 | 0.98 | 857659 |
| Full stop/period - .O | 0.86 | 0.93 | 0.89 | 60410 |
| Comma - ,O | 0.85 | 0.83 | 0.84 | 48608 |
| Upper + Comma - ,U | 0.73 | 0.76 | 0.75 | 3521 |
| Question - ?O | 0.68 | 0.78 | 0.73 | 1168 |
| Upper + period - .U | 0.66 | 0.72 | 0.69 | 1884 |
| Upper + colon - :U | 0.59 | 0.63 | 0.61 | 352 |
| Colon - :O | 0.70 | 0.53 | 0.60 | 2420 |
| Question Mark - ?U | 0.50 | 0.56 | 0.53 | 36 |
| Upper + Exclam. - !U | 0.38 | 0.32 | 0.34 | 38 |
| Exclamation Mark - !O | 0.30 | 0.05 | 0.08 | 783 |
| Semicolon - ;O | 0.35 | 0.04 | 0.08 | 1557 |
| Apostrophe - 'O | 0.00 | 0.00 | 0.00 | 3 |
| Hyphen - -O | 0.00 | 0.00 | 0.00 | 3 |
| accuracy | 0.96 | 1047818 | ||
| macro avg | 0.57 | 0.54 | 0.54 | 1047818 |
| weighted avg | 0.96 | 0.96 | 0.96 | 1047818 |
🤙 Contact
Maicon Domingues for questions, feedback and/or requests for similar models.
Release files for respunct 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| respunct-1.0.0.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| respunct-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 kB
Release files / respunct-1.0.0.tar.gz
| Download URL | respunct-1.0.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c6cf82e08cf4f2e63b364e1394dbec52198bd524ed3b2a3dba0316bd093a550
|
|
BLAKE2b-256 checksum How to use checksums |
cc6a03a84ccffaccdab1810282e893f63d845bff1ab7acbf82424998f74a1026
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|
Release files / respunct-1.0.0-py3-none-any.whl
| Download URL | respunct-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61b03d93bdfdb45871fbd1a5baac08c7b07437c718f1b5001edf8fa603fe62a1
|
|
BLAKE2b-256 checksum How to use checksums |
9fe13e4bcfe3cb4db78af356db530e142f7695541d1a21c57112694a513a1234
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|