đ anglicisms-spanish-flair-cs
This is a pretrained model for detecting unassimilated English lexical borrowings in Spanish newswire, labeling words like 'fake news', 'machine learning' etc.
This model is a BiLSTM - CRF model. It uses Transformer - based embeddings pretrained on codeswitched data and subword embeddings (BPE and character embeddings). It was trained on the COALAS corpus for detecting lexical borrowings.
The model has two labels:
ENG
: For English lexical borrowings (e.g., smartphone, online, podcast)
OTHER
: For lexical borrowings from other languages (e.g., boutique, anime, umami)
It uses BIO encoding for multitoken borrowings.
â There is another mBERT - based model for the same task, trained with the Transformers
library. However, this Flair - based model outperforms it (F1 = 83.55).
đ Quick Start
This pretrained model is designed to detect unassimilated English lexical borrowings in Spanish newswire. It labels words of foreign origin used in the Spanish language.
⨠Features
đ§ Technical Details
The model is a BiLSTM - CRF model. It takes Transformer - based embeddings pretrained on codeswitched data along with subword embeddings (BPE and character embeddings) as input. It was trained on the COALAS corpus for the task of detecting lexical borrowings.
The model considers two labels:
ENG
: For English lexical borrowings.
OTHER
: For lexical borrowings from any other language.
It uses BIO encoding to account for multitoken borrowings.
đ Metrics (on the test set)
The following results were obtained on the test set of the COALAS corpus.
Property |
Details |
Model Type |
BiLSTM - CRF |
Training Data |
COALAS corpus |
LABEL |
Precision |
Recall |
F1 |
ALL |
90.14 |
81.79 |
85.76 |
ENG |
90.16 |
84.34 |
87.16 |
OTHER |
85.71 |
13.04 |
22.64 |
đĻ Installation
No specific installation steps are provided in the original document.
đģ Usage Examples
Basic Usage
from flair.data import Sentence
from flair.models import SequenceTagger
import pathlib
import os
if os.name == 'nt':
temp = pathlib.PosixPath
pathlib.PosixPath = pathlib.WindowsPath
tagger = SequenceTagger.load("lirondos/anglicisms-spanish-flair-cs")
text = "Las fake news sobre la celebrity se reprodujeron por los mass media en prime time."
sentence = Sentence(text)
tagger.predict(sentence)
print(sentence)
print('The following borrowing were found:')
for entity in sentence.get_spans():
print(entity)
đ Documentation
More information about the dataset, model experimentation, and error analysis can be found in the paper: Detecting Unassimilated Borrowings in Spanish: An Annotated Corpus and Approaches to Modeling.
đ License
This project is licensed under the cc - by - 4.0 license.
đ Citation
If you use this model, please cite the following reference:
@inproceedings{alvarez-mellado-lignos-2022-detecting,
title = "Detecting Unassimilated Borrowings in {S}panish: {A}n Annotated Corpus and Approaches to Modeling",
author = "{\'A}lvarez-Mellado, Elena and
Lignos, Constantine",
booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
month = may,
year = "2022",
address = "Dublin, Ireland",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.acl-long.268",
pages = "3868--3888",
abstract = "This work presents a new resource for borrowing identification and analyzes the performance and errors of several models on this task. We introduce a new annotated corpus of Spanish newswire rich in unassimilated lexical borrowings{---}words from one language that are introduced into another without orthographic adaptation{---}and use it to evaluate how several sequence labeling models (CRF, BiLSTM-CRF, and Transformer-based models) perform. The corpus contains 370,000 tokens and is larger, more borrowing-dense, OOV-rich, and topic-varied than previous corpora available for this task. Our results show that a BiLSTM-CRF model fed with subword embeddings along with either Transformer-based embeddings pretrained on codeswitched data or a combination of contextualized word embeddings outperforms results obtained by a multilingual BERT-based model.",
}