From cc4ba79f68ee8312d071c172f95ec74614ddf75b Mon Sep 17 00:00:00 2001 From: Sagor Sarker Date: Thu, 27 Aug 2020 03:26:32 +0600 Subject: [PATCH] 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 --- .../codeswitch-hineng-lid-lince/README.md | 23 ++++++-- .../codeswitch-hineng-ner-lince/README.md | 15 ++++-- .../codeswitch-hineng-pos-lince/README.md | 15 ++++-- .../codeswitch-nepeng-lid-lince/README.md | 13 +++-- .../codeswitch-spaeng-lid-lince/README.md | 23 ++++++-- .../codeswitch-spaeng-ner-lince/README.md | 15 ++++-- .../codeswitch-spaeng-pos-lince/README.md | 15 ++++-- .../README.md | 53 +++++++++++++++++++ 8 files changed, 145 insertions(+), 27 deletions(-) create mode 100644 model_cards/sagorsarker/codeswitch-spaeng-sentiment-analysis-lince/README.md diff --git a/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md b/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md index 06e8651066..490826d3ef 100644 --- a/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md @@ -2,19 +2,35 @@ language: - hi - en +datasets: +- LinCE +license: "MIT" +tags: +- codeswitching +- hindi-english +- language-identification --- # codeswitch-hineng-lid-lince This is a pretrained model for **language identification** of `hindi-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 +``` ## Identify Language -* Method-1 +* **Method-1** ```py -from transformers import AutoTokenizer, AutoModelForTokenClassification +from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-hineng-lid-lince") @@ -25,10 +41,9 @@ lid_model("put any hindi english code-mixed sentence") ``` -* Method-2 +* **Method-2** ```py -# !pip install codeswitch from codeswitch.codeswitch import LanguageIdentification lid = LanguageIdentification('hin-eng') text = "" # your code-mixed sentence diff --git a/model_cards/sagorsarker/codeswitch-hineng-ner-lince/README.md b/model_cards/sagorsarker/codeswitch-hineng-ner-lince/README.md index c16332ce55..161a23547d 100644 --- a/model_cards/sagorsarker/codeswitch-hineng-ner-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-hineng-ner-lince/README.md @@ -2,6 +2,13 @@ language: - hi - en +datasets: +- LinCE +license: "MIT" +tags: +- codeswitching +- hindi-english +- ner --- # codeswitch-hineng-ner-lince @@ -17,13 +24,13 @@ To install codeswitch: pip install codeswitch ``` -## Identify Language +## Name Entity Recognition of Code-Mixed Data -* Method-1 +* **Method-1** ```py -from transformers import AutoTokenizer, AutoModelForTokenClassification +from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-hineng-ner-lince") @@ -35,7 +42,7 @@ ner_model("put any hindi english code-mixed sentence") ``` -* Method-2 +* **Method-2** ```py from codeswitch.codeswitch import NER diff --git a/model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md b/model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md index 9b253fb774..1cf4845966 100644 --- a/model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md @@ -2,6 +2,13 @@ language: - hi - en +datasets: +- LinCE +license: "MIT" +tags: +- codeswitching +- hindi-english +- pos --- # codeswitch-hineng-pos-lince @@ -17,13 +24,13 @@ To install codeswitch: pip install codeswitch ``` -## Identify Language +## Part-of-Speech Tagging of Hindi-English Mixed Data -* Method-1 +* **Method-1** ```py -from transformers import AutoTokenizer, AutoModelForTokenClassification +from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-hineng-pos-lince") @@ -34,7 +41,7 @@ pos_model("put any hindi english code-mixed sentence") ``` -* Method-2 +* **Method-2** ```py from codeswitch.codeswitch import POS diff --git a/model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md b/model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md index 74991cd4da..0c9e2840b6 100644 --- a/model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md @@ -2,6 +2,13 @@ language: - ne - en +datasets: +- LinCE +license: "MIT" +tags: +- codeswitching +- nepali-english +- language-identification --- # codeswitch-nepeng-lid-lince @@ -19,11 +26,11 @@ pip install codeswitch ## Identify Language -* Method-1 +* **Method-1** ```py -from transformers import AutoTokenizer, AutoModelForTokenClassification +from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-nepeng-lid-lince") @@ -34,7 +41,7 @@ lid_model("put any nepali english code-mixed sentence") ``` -* Method-2 +* **Method-2** ```py from codeswitch.codeswitch import LanguageIdentification diff --git a/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md b/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md index 253a9eeb51..4930ea6411 100644 --- a/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md @@ -2,19 +2,35 @@ language: - es - en +datasets: +- LinCE +license: "MIT" +tags: +- codeswitching +- spanish-english +- language-identification --- # codeswitch-spaeng-lid-lince This is a pretrained model for **language identification** 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 +``` ## Identify Language -* Method-1 +* **Method-1** ```py -from transformers import AutoTokenizer, AutoModelForTokenClassification +from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-spaeng-lid-lince") @@ -25,10 +41,9 @@ lid_model("put any spanish english code-mixed sentence") ``` -* Method-2 +* **Method-2** ```py -# !pip install codeswitch from codeswitch.codeswitch import LanguageIdentification lid = LanguageIdentification('spa-eng') text = "" # your code-mixed sentence diff --git a/model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md b/model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md index 0b2bf3d9a3..8b2a979565 100644 --- a/model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md @@ -2,6 +2,13 @@ language: - es - en +datasets: +- LinCE +license: "MIT" +tags: +- codeswitching +- spanish-english +- ner --- # codeswitch-spaeng-ner-lince @@ -17,13 +24,13 @@ To install codeswitch: pip install codeswitch ``` -## Identify Language +## Name Entity Recognition of Spanish-English Mixed Data -* Method-1 +* **Method-1** ```py -from transformers import AutoTokenizer, AutoModelForTokenClassification +from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-spaeng-ner-lince") @@ -35,7 +42,7 @@ ner_model("put any spanish english code-mixed sentence") ``` -* Method-2 +* **Method-2** ```py from codeswitch.codeswitch import NER diff --git a/model_cards/sagorsarker/codeswitch-spaeng-pos-lince/README.md b/model_cards/sagorsarker/codeswitch-spaeng-pos-lince/README.md index 5710c79da4..73ca2f139d 100644 --- a/model_cards/sagorsarker/codeswitch-spaeng-pos-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-spaeng-pos-lince/README.md @@ -2,6 +2,13 @@ language: - es - en +datasets: +- LinCE +license: "MIT" +tags: +- codeswitching +- spanish-english +- pos --- # codeswitch-spaeng-pos-lince @@ -17,13 +24,13 @@ To install codeswitch: pip install codeswitch ``` -## Identify Language +## Part-of-Speech Tagging of Spanish-English Mixed Data -* Method-1 +* **Method-1** ```py -from transformers import AutoTokenizer, AutoModelForTokenClassification +from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-spaeng-pos-lince") @@ -34,7 +41,7 @@ pos_model("put any spanish english code-mixed sentence") ``` -* Method-2 +* **Method-2** ```py from codeswitch.codeswitch import POS diff --git a/model_cards/sagorsarker/codeswitch-spaeng-sentiment-analysis-lince/README.md b/model_cards/sagorsarker/codeswitch-spaeng-sentiment-analysis-lince/README.md new file mode 100644 index 0000000000..e797232390 --- /dev/null +++ b/model_cards/sagorsarker/codeswitch-spaeng-sentiment-analysis-lince/README.md @@ -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) +```