From ff370ef4a8f20552f40cd398381c67436e0a2dee Mon Sep 17 00:00:00 2001 From: Sagor Sarker Date: Sat, 22 Aug 2020 18:45:52 +0600 Subject: [PATCH 1/5] Create README.md --- .../codeswitch-hineng-lid-lince/README.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 model_cards/sagorsarker/codeswitch-hineng-lid-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 new file mode 100644 index 00000000000000..ef749907b2deb6 --- /dev/null +++ b/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md @@ -0,0 +1,33 @@ +# 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) + +## Identify Language + +* Method-1 + +```py + +from transformers import AutoTokenizer, AutoModelForTokenClassification + +tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-hineng-lid-lince") + +model = AutoModelForTokenClassification.from_pretrained("sagorsarker/codeswitch-hineng-lid-lince") +lid_model = pipeline('ner', model=model, tokenizer=tokenizer) + +lid_model("put any hindi english code-mixed sentence") + +``` + +* Method-2 + +```py +# !pip install codeswitch +from codeswitch.codeswitch import LanguageIdentification +lid = LanguageIdentification('spa-eng') +# for hindi-english use 'hin-eng', +# for nepali-english use 'nep-eng' +text = "" # your code-mixed sentence +result = lid.identify(text) +print(result) +``` + From b4bab13652d3f2272be22bd00f0546df88beb6dc Mon Sep 17 00:00:00 2001 From: Sagor Sarker Date: Sat, 22 Aug 2020 18:49:13 +0600 Subject: [PATCH 2/5] Update README.md --- .../sagorsarker/codeswitch-hineng-lid-lince/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md b/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md index ef749907b2deb6..bef6bdf2f91ff8 100644 --- a/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md @@ -1,3 +1,9 @@ +--- +language: +- hi +- en +--- + # 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) From f3985e76fc0253b749774fd215777defff6f6ebb Mon Sep 17 00:00:00 2001 From: Sagor Sarker Date: Sat, 22 Aug 2020 18:54:20 +0600 Subject: [PATCH 3/5] Create README.md --- .../codeswitch-spaeng-lid-lince/README.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md diff --git a/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md b/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md new file mode 100644 index 00000000000000..451364bf29b80d --- /dev/null +++ b/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md @@ -0,0 +1,36 @@ +--- +language: +- es +- en +--- + +# 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) + +## Identify Language + +* Method-1 + +```py + +from transformers import AutoTokenizer, AutoModelForTokenClassification + +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") + +``` + +* Method-2 + +```py +# !pip install codeswitch +from codeswitch.codeswitch import LanguageIdentification +lid = LanguageIdentification('spa-eng') +text = "" # your code-mixed sentence +result = lid.identify(text) +print(result) +``` From 99379dbee2b984b01678eba2866f8055285379b8 Mon Sep 17 00:00:00 2001 From: Sagor Sarker Date: Sat, 22 Aug 2020 18:56:07 +0600 Subject: [PATCH 4/5] Update README.md --- model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md b/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md index bef6bdf2f91ff8..f7da9444a451c7 100644 --- a/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md @@ -29,9 +29,7 @@ lid_model("put any hindi english code-mixed sentence") ```py # !pip install codeswitch from codeswitch.codeswitch import LanguageIdentification -lid = LanguageIdentification('spa-eng') -# for hindi-english use 'hin-eng', -# for nepali-english use 'nep-eng' +lid = LanguageIdentification('hin-eng') text = "" # your code-mixed sentence result = lid.identify(text) print(result) From d480b8cfed77078faf4565c479aab65eef0dc549 Mon Sep 17 00:00:00 2001 From: sagorbrur Date: Sat, 22 Aug 2020 23:01:25 +0600 Subject: [PATCH 5/5] added multiple codeswitch model --- .../codeswitch-hineng-lid-lince/README.md | 11 ++++- .../codeswitch-hineng-ner-lince/README.md | 47 +++++++++++++++++++ .../codeswitch-hineng-pos-lince/README.md | 45 ++++++++++++++++++ .../codeswitch-nepeng-lid-lince/README.md | 47 +++++++++++++++++++ .../codeswitch-spaeng-lid-lince/README.md | 10 ++++ .../codeswitch-spaeng-ner-lince/README.md | 46 ++++++++++++++++++ .../codeswitch-spaeng-pos-lince/README.md | 45 ++++++++++++++++++ 7 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 model_cards/sagorsarker/codeswitch-hineng-ner-lince/README.md create mode 100644 model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md create mode 100644 model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md create mode 100644 model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md create mode 100644 model_cards/sagorsarker/codeswitch-spaeng-pos-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 f7da9444a451c7..51103aa9cad3ce 100644 --- a/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md @@ -7,6 +7,16 @@ language: # 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 @@ -27,7 +37,6 @@ lid_model("put any hindi english code-mixed sentence") * 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 new file mode 100644 index 00000000000000..c16332ce55b3ac --- /dev/null +++ b/model_cards/sagorsarker/codeswitch-hineng-ner-lince/README.md @@ -0,0 +1,47 @@ +--- +language: +- hi +- en +--- + +# codeswitch-hineng-ner-lince +This is a pretrained model for **Name Entity Recognition** 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 + +```py + +from transformers import AutoTokenizer, AutoModelForTokenClassification + +tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-hineng-ner-lince") + +model = AutoModelForTokenClassification.from_pretrained("sagorsarker/codeswitch-hineng-ner-lince") + +ner_model = pipeline('ner', model=model, tokenizer=tokenizer) + +ner_model("put any hindi english code-mixed sentence") + +``` + +* Method-2 + +```py +from codeswitch.codeswitch import NER +ner = NER('hin-eng') +text = "" # your mixed sentence +result = ner.tag(text) +print(result) + +``` diff --git a/model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md b/model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md new file mode 100644 index 00000000000000..9b253fb77484e2 --- /dev/null +++ b/model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md @@ -0,0 +1,45 @@ +--- +language: +- hi +- en +--- + +# codeswitch-hineng-pos-lince +This is a pretrained model for **Part of Speech Tagging** 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 + +```py + +from transformers import AutoTokenizer, AutoModelForTokenClassification + +tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-hineng-pos-lince") + +model = AutoModelForTokenClassification.from_pretrained("sagorsarker/codeswitch-hineng-pos-lince") +pos_model = pipeline('ner', model=model, tokenizer=tokenizer) + +pos_model("put any hindi english code-mixed sentence") + +``` + +* Method-2 + +```py +from codeswitch.codeswitch import POS +pos = POS('hin-eng') +text = "" # your mixed sentence +result = pos.tag(text) +print(result) +``` diff --git a/model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md b/model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md new file mode 100644 index 00000000000000..74991cd4dad8c1 --- /dev/null +++ b/model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md @@ -0,0 +1,47 @@ +--- +language: +- ne +- en +--- + +# codeswitch-nepeng-lid-lince +This is a pretrained model for **language identification** of `nepali-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 + +```py + +from transformers import AutoTokenizer, AutoModelForTokenClassification + +tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-nepeng-lid-lince") + +model = AutoModelForTokenClassification.from_pretrained("sagorsarker/codeswitch-nepeng-lid-lince") +lid_model = pipeline('ner', model=model, tokenizer=tokenizer) + +lid_model("put any nepali english code-mixed sentence") + +``` + +* Method-2 + +```py +from codeswitch.codeswitch import LanguageIdentification +lid = LanguageIdentification('nep-eng') +text = "" # your code-mixed sentence +result = lid.identify(text) +print(result) + +``` + diff --git a/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md b/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md index 451364bf29b80d..c68cf794662969 100644 --- a/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md +++ b/model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md @@ -7,6 +7,16 @@ language: # 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 diff --git a/model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md b/model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md new file mode 100644 index 00000000000000..0b2bf3d9a36d6d --- /dev/null +++ b/model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md @@ -0,0 +1,46 @@ +--- +language: +- es +- en +--- + +# codeswitch-spaeng-ner-lince +This is a pretrained model for **Name Entity Recognition** 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 + +```py + +from transformers import AutoTokenizer, AutoModelForTokenClassification + +tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-spaeng-ner-lince") + +model = AutoModelForTokenClassification.from_pretrained("sagorsarker/codeswitch-spaeng-ner-lince") + +ner_model = pipeline('ner', model=model, tokenizer=tokenizer) + +ner_model("put any spanish english code-mixed sentence") + +``` + +* Method-2 + +```py +from codeswitch.codeswitch import NER +ner = NER('spa-eng') +text = "" # your mixed sentence +result = ner.tag(text) +print(result) +``` diff --git a/model_cards/sagorsarker/codeswitch-spaeng-pos-lince/README.md b/model_cards/sagorsarker/codeswitch-spaeng-pos-lince/README.md new file mode 100644 index 00000000000000..5710c79da48e17 --- /dev/null +++ b/model_cards/sagorsarker/codeswitch-spaeng-pos-lince/README.md @@ -0,0 +1,45 @@ +--- +language: +- es +- en +--- + +# codeswitch-spaeng-pos-lince +This is a pretrained model for **Part of Speech Tagging** 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 + +```py + +from transformers import AutoTokenizer, AutoModelForTokenClassification + +tokenizer = AutoTokenizer.from_pretrained("sagorsarker/codeswitch-spaeng-pos-lince") + +model = AutoModelForTokenClassification.from_pretrained("sagorsarker/codeswitch-spaeng-pos-lince") +pos_model = pipeline('ner', model=model, tokenizer=tokenizer) + +pos_model("put any spanish english code-mixed sentence") + +``` + +* Method-2 + +```py +from codeswitch.codeswitch import POS +pos = POS('spa-eng') +text = "" # your mixed sentence +result = pos.tag(text) +print(result) +```