模型:
rohanrajpal/bert-base-multilingual-codemixed-cased-sentiment
任务:
文本分类许可:
apache-2.0模型的输入:任何混合hinglish文本;模型的输出:情感(0-消极,1-中性,2-积极)
我使用了来自Huggingface的bert-base-multilingual-cased模型,并在 SAIL 2017 个数据集上进行了微调。
这个模型在SAIL 2017数据集上的表现
metric | score |
---|---|
acc | 0.588889 |
f1 | 0.582678 |
acc_and_f1 | 0.585783 |
precision | 0.586516 |
recall | 0.588889 |
如下是如何使用此模型在PyTorch中获取给定文本特征的方法:
# You can include sample code which will be formatted from transformers import BertTokenizer, BertModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("rohanrajpal/bert-base-codemixed-uncased-sentiment") model = AutoModelForSequenceClassification.from_pretrained("rohanrajpal/bert-base-codemixed-uncased-sentiment") text = "Replace me by any text you'd like." encoded_input = tokenizer(text, return_tensors='pt') output = model(**encoded_input)
以及在TensorFlow中的方法:
from transformers import BertTokenizer, TFBertModel tokenizer = BertTokenizer.from_pretrained('rohanrajpal/bert-base-codemixed-uncased-sentiment') model = TFBertModel.from_pretrained("rohanrajpal/bert-base-codemixed-uncased-sentiment") text = "Replace me by any text you'd like." encoded_input = tokenizer(text, return_tensors='tf') output = model(encoded_input)限制和偏见
即将推出!
我在SAIL 2017数据集中进行了训练,数据集为 link ,训练方式为 pretrained model 。
无预处理。
@inproceedings{khanuja-etal-2020-gluecos, title = "{GLUEC}o{S}: An Evaluation Benchmark for Code-Switched {NLP}", author = "Khanuja, Simran and Dandapat, Sandipan and Srinivasan, Anirudh and Sitaram, Sunayana and Choudhury, Monojit", booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics", month = jul, year = "2020", address = "Online", publisher = "Association for Computational Linguistics", url = "https://www.aclweb.org/anthology/2020.acl-main.329", pages = "3575--3585" }