Downloads · 30 days
55
0% of all-time downloads
sagorsarker/codeswitch-spaeng-lid-lince
codeswitch-spaeng-lid-lince is a token classification model from sagorsarker. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
This is a pretrained model for language identification of spanish-english code-mixed data used from LinCE
Downloads · 30 days
55
0% of all-time downloads
All-time downloads
33.8K
Public
Parameters
178M
2.1 GB on disk
Likes
2
Public
Click a slice to open those files.
.bin712 MB · 33%
How the weights are stored.
F32178M · 100%
From the Hugging Face model README
This is a pretrained model for language identification of spanish-english code-mixed data used from LinCE
This model is trained for this below repository.
https://github.com/sagorbrur/codeswitch
To install codeswitch:
pip install codeswitch
from codeswitch.codeswitch import LanguageIdentification
lid = LanguageIdentification('spa-eng')
text = "" # your code-mixed sentence
result = lid.identify(text)
print(result)
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-spaeng-lid-lince")
model = AutoModelForTokenClassification.from_pretrained("sagorsarker/codeswitch-spaeng-lid-lince")
lid_model = pipeline('ner', model=model, tokenizer=tokenizer)
lid_model("put any spanish english code-mixed sentence")