Views
No views yet
1
2from transformers import BertTokenizer,BertForSequenceClassification
3
4classes_decoder = {
5 0: "Inference",
6 1: "Conflict",
7 2: "Rephrase",
8 3: "No-Relation"
9 }
10
11
12model = BertForSequenceClassification.from_pretrained("yevhenkost/ArgumentMining-EN-ARI-AIF-ALBERT")
13tokenizer = BertTokenizer.from_pretrained("yevhenkost/ArgumentMining-EN-ARI-AIF-ALBERT")
14
15text_one, text_two = "The water is wet", "The sun is really hot"
16
17model_inputs = tokenizer(text_one, text_two, return_tensors="pt")
18
19# regular SequenceClassifierOutput
20model_output = model(**model_inputs) precision recall f1-score support
0 0.51 0.59 0.55 833
1 0.46 0.28 0.35 200
2 0.51 0.30 0.38 156
3 0.82 0.82 0.82 2209
accuracy 0.71 3398
macro avg 0.58 0.50 0.53 3398
weighted avg 0.71 0.71 0.71 3398@article{ruiz2021transformer,
author = {R. Ruiz-Dolz and J. Alemany and S. Barbera and A. Garcia-Fornes},
journal = {IEEE Intelligent Systems},
title = {Transformer-Based Models for Automatic Identification of Argument Relations: A Cross-Domain Evaluation},
year = {2021},
volume = {36},
number = {06},
issn = {1941-1294},
pages = {62-70},
doi = {10.1109/MIS.2021.3073993},
publisher = {IEEE Computer Society}
}