Views
No views yet
sendasenda package.1from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
2tokenizer = AutoTokenizer.from_pretrained("pin/senda")
3model = AutoModelForSequenceClassification.from_pretrained("pin/senda")
4
5# create 'senda' sentiment analysis pipeline
6senda_pipeline = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
7
8text = "Sikke en dejlig dag det er i dag"
9# in English: 'what a lovely day'
10senda_pipeline(text)senda model achieves an accuracy of 0.77 and a macro-averaged F1-score of 0.73 on a small test data set, that Alexandra Institute provides. The model can most certainly be improved, and we encourage all NLP-enthusiasts to give it their best shot - you can use the senda package to do this.senda.