Views
No views yet
gk-hinglish-sentiment1#sample code
2from transformers import BertTokenizer, BertForSequenceClassification
3tokenizerg = BertTokenizer.from_pretrained("/content/model")
4modelg = BertForSequenceClassification.from_pretrained("/content/model")
5
6text = "kuch bhi type karo hinglish mai"
7encoded_input = tokenizerg(text, return_tensors='pt')
8output = modelg(**encoded_input)
9print(output)
10#output contains 3 lables LABEL_0 = Negative ,LABEL_1 = Nuetral ,LABEL_2 = Positive1 title = "{GLUEC}o{S}: An Evaluation Benchmark for Code-Switched {NLP}",
2 author = "Khanuja, Simran and
3 Dandapat, Sandipan and
4 Srinivasan, Anirudh and
5 Sitaram, Sunayana and
6 Choudhury, Monojit",
7 booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",
8 month = jul,
9 year = "2020",
10 address = "Online",
11 publisher = "Association for Computational Linguistics",
12 url = "https://www.aclweb.org/anthology/2020.acl-main.329",
13 pages = "3575--3585"
14}