pylazaro
A library for lexical borrowing detection (a.k.a loanwords) in Spanish, with a focus on anglicism detection.
Installation
To install pylazaro simply run the following command from the command line:
pip install pylazaro
To uninstall pylazaro simply run the following command from the command line:
pip uninstall pylazaro
Get started
A working example on how to detect borrowings in a text using pylazaro:
>>> from pylazaro import Lazaro
# We create our borrowing detection tagger
>>> tagger = Lazaro()
# The text we want to analyze for borrowing detection
>>> text = "Inteligencia artificial aplicada al sector del blockchain, la e-mobility y las smarts grids entre otros; favoreciendo las interacciones colaborativas."
# We run our tagger on the text we want to analyze
>>> result = tagger.analyze(text)
# We get results
>>> result.borrowings_to_tuple()
[('blockchain', 'ENG'), ('e-mobility', 'ENG'), ('smarts grids', 'ENG')]
# Borrowings from English are labelled ENG, borrowings from other languages OTHER
>>> result.anglicisms_to_tuple()
[('blockchain', 'ENG'), ('e-mobility', 'ENG'), ('smarts grids', 'ENG')]
>>> result.tag_per_token()
[('Inteligencia', 'O'), ('artificial', 'O'), ('aplicada', 'O'), ('al', 'O'), ('sector', 'O'), ('del', 'O'), ('blockchain', 'B-ENG'), (',', 'O'), ('la', 'O'), ('e-mobility', 'B-ENG'), ('y', 'O'), ('las', 'O'), ('smarts', 'B-ENG'), ('grids', 'I-ENG'), ('entre', 'O'), ('otros', 'O'), (';', 'O'), ('favoreciendo', 'O'), ('las', 'O'), ('interacciones', 'O'), ('colaborativas', 'O'), ('.', 'O')]
More info
-
Documentation on how to use
pylazaroin Read the docs. -
The code is available on GitHub.
-
pylazarogives access to the models described on this ACL paper -
Questions? Bugs? Requests? Ideas? Feel free to reach me via email, open a GitHub issue or ping me on Twitter.
Release files for pylazaro 1.2.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 | |
|---|---|---|---|
| pylazaro-1.2.0.tar.gz | 20.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pylazaro-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.7 kB
Release files / pylazaro-1.2.0.tar.gz
| Download URL | pylazaro-1.2.0.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ecd218a66a3d66b2a768a5d7e8c721d6f1bc85268cb696f6b70e57f94d52a422
|
|
BLAKE2b-256 checksum How to use checksums |
136ceaa47b60c6437eb20103f3c95120623228e0ac4d3234c9eefe693a66834b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / pylazaro-1.2.0-py3-none-any.whl
| Download URL | pylazaro-1.2.0-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba52e3db81983bd5b639b57e8b4f43584ed52d15f23eb1f8d4496636baa66192
|
|
BLAKE2b-256 checksum How to use checksums |
e6c3fa054f7360d6d4f4b0ed06a0470c0d915bcce6361891a29246bd015a9619
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|