Metadata-Version: 2.4
Name: pylazaro
Version: 1.2.0
Summary: A Python library for detecting lexical borrowings (with a focus on anglicisms in Spanish language)
Home-page: https://pylazaro.readthedocs.io/
Author: Elena Álvarez Mellado
Author-email: ealvarezmellado@gmail.com
License: MIT
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: transformers<4.46,>=4.30
Requires-Dist: flair<0.14,>=0.12
Requires-Dist: attrs
Requires-Dist: torch<2.6,>=1.13
Requires-Dist: spacy<4,>=3.2
Requires-Dist: python-crfsuite
Requires-Dist: quickvec>=0.2
Requires-Dist: numpy
Requires-Dist: regex
Requires-Dist: requests
Requires-Dist: tqdm
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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 `pylazaro` in [Read the docs](https://pylazaro.readthedocs.io/).

* The code is available on [GitHub](https://github.com/lirondos/pylazaro).

* `pylazaro` gives access to the models described on [this ACL paper](https://aclanthology.org/2022.acl-long.268/)

* Questions? Bugs? Requests? Ideas? Feel free to reach me [via email](mailto:ealvarezmellado@gmail.com), open [a GitHub issue](https://github.com/lirondos/pylazaro/issues) or ping me [on Twitter](https://twitter.com/lirondos).
