-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added model card for codeswitch-spaeng-sentiment-analysis-lince (#6727)
* added model card for codeswitch-spaeng-sentiment-analysis-lince model also update other model card * fixed typo * fixed typo * fixed typo * fixed typo * fixed typo * fixed typo * fixed typo * Update README.md
- Loading branch information
Showing
8 changed files
with
145 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
model_cards/sagorsarker/codeswitch-spaeng-sentiment-analysis-lince/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
language: | ||
- es | ||
- en | ||
datasets: | ||
- LinCE | ||
license: "MIT" | ||
tags: | ||
- codeswitching | ||
- spanish-english | ||
- sentiment-analysis | ||
--- | ||
|
||
# codeswitch-spaeng-sentiment-analysis-lince | ||
This is a pretrained model for **Sentiment Analysis** of `spanish-english` code-mixed data used from [LinCE](https://ritual.uh.edu/lince/home) | ||
|
||
This model is trained for this below repository. | ||
|
||
[https://github.com/sagorbrur/codeswitch](https://github.com/sagorbrur/codeswitch) | ||
|
||
To install codeswitch: | ||
|
||
``` | ||
pip install codeswitch | ||
``` | ||
|
||
## Sentiment Analysis of Spanish-English Code-Mixed Data | ||
|
||
* **Method-1** | ||
|
||
```py | ||
|
||
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline | ||
|
||
tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-spaeng-sentiment-analysis-lince") | ||
|
||
model = AutoModelForSequenceClassification.from_pretrained("sagorsarker/codeswitch-spaeng-sentiment-analysis-lince") | ||
|
||
nlp = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer) | ||
sentence = "El perro le ladraba a La Gatita .. .. lol #teamlagatita en las playas de Key Biscayne este Memorial day" | ||
nlp(sentence) | ||
|
||
``` | ||
|
||
* **Method-2** | ||
|
||
```py | ||
from codeswitch.codeswitch import SentimentAnalysis | ||
sa = SentimentAnalysis('spa-eng') | ||
sentence = "El perro le ladraba a La Gatita .. .. lol #teamlagatita en las playas de Key Biscayne este Memorial day" | ||
result = sa.analyze(sentence) | ||
print(result) | ||
``` |