Skip to content

Commit

Permalink
added model card for codeswitch-spaeng-sentiment-analysis-lince (#6727)
Browse files Browse the repository at this point in the history
* 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
sagorbrur authored Aug 26, 2020
1 parent e10fb9c commit cc4ba79
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 27 deletions.
23 changes: 19 additions & 4 deletions model_cards/sagorsarker/codeswitch-hineng-lid-lince/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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
Expand Down
15 changes: 11 additions & 4 deletions model_cards/sagorsarker/codeswitch-hineng-ner-lince/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
language:
- hi
- en
datasets:
- LinCE
license: "MIT"
tags:
- codeswitching
- hindi-english
- ner
---

# codeswitch-hineng-ner-lince
Expand All @@ -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")

Expand All @@ -35,7 +42,7 @@ ner_model("put any hindi english code-mixed sentence")

```

* Method-2
* **Method-2**

```py
from codeswitch.codeswitch import NER
Expand Down
15 changes: 11 additions & 4 deletions model_cards/sagorsarker/codeswitch-hineng-pos-lince/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
language:
- hi
- en
datasets:
- LinCE
license: "MIT"
tags:
- codeswitching
- hindi-english
- pos
---

# codeswitch-hineng-pos-lince
Expand All @@ -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")

Expand All @@ -34,7 +41,7 @@ pos_model("put any hindi english code-mixed sentence")

```

* Method-2
* **Method-2**

```py
from codeswitch.codeswitch import POS
Expand Down
13 changes: 10 additions & 3 deletions model_cards/sagorsarker/codeswitch-nepeng-lid-lince/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
language:
- ne
- en
datasets:
- LinCE
license: "MIT"
tags:
- codeswitching
- nepali-english
- language-identification
---

# codeswitch-nepeng-lid-lince
Expand All @@ -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")

Expand All @@ -34,7 +41,7 @@ lid_model("put any nepali english code-mixed sentence")

```

* Method-2
* **Method-2**

```py
from codeswitch.codeswitch import LanguageIdentification
Expand Down
23 changes: 19 additions & 4 deletions model_cards/sagorsarker/codeswitch-spaeng-lid-lince/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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
Expand Down
15 changes: 11 additions & 4 deletions model_cards/sagorsarker/codeswitch-spaeng-ner-lince/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
language:
- es
- en
datasets:
- LinCE
license: "MIT"
tags:
- codeswitching
- spanish-english
- ner
---

# codeswitch-spaeng-ner-lince
Expand All @@ -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")

Expand All @@ -35,7 +42,7 @@ ner_model("put any spanish english code-mixed sentence")

```

* Method-2
* **Method-2**

```py
from codeswitch.codeswitch import NER
Expand Down
15 changes: 11 additions & 4 deletions model_cards/sagorsarker/codeswitch-spaeng-pos-lince/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
language:
- es
- en
datasets:
- LinCE
license: "MIT"
tags:
- codeswitching
- spanish-english
- pos
---

# codeswitch-spaeng-pos-lince
Expand All @@ -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")

Expand All @@ -34,7 +41,7 @@ pos_model("put any spanish english code-mixed sentence")

```

* Method-2
* **Method-2**

```py
from codeswitch.codeswitch import POS
Expand Down
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)
```

0 comments on commit cc4ba79

Please sign in to comment.