krotima1/AlignScoreCS
218
1---2language:3- en4- cs5license: cc-by-4.06metrics:7- bleurt8- bleu9- bertscore10---11# AlignScoreCS12 13A MultiTask multilingual model is developed to **assess factual consistency in context-claim pairs** across various Natural Language Understanding (NLU) tasks,14including **Summarization**, **Question Answering (QA)**, **Semantic Textual Similarity (STS)**, **Paraphrase**, **Fact Verification (FV)**, and **Natural Language Inference (NLI)**.15AlignScoreCS is fine-tuned on a vast multi-task dataset consisting of 7 million documents, encompassing these NLU tasks in both **Czech** and **English** languages.16Its multilingual pre-training enables its potential utilization in **various other languages**. The architecture is capable of processing tasks using regression,17binary classification, or ternary classification, although for evaluation purposes, we recommend employing the AlignScore function.18 19This work is influenced by its English counterpart [AlignScore: Evaluating Factual Consistency with a Unified Alignment Function](https://arxiv.org/abs/2305.16739).20However, we employed homogeneous batches instead of heterogeneous ones during training and utilized three distinct architectures sharing a single encoder.21This setup allows for the independent use of each architecture with its classification head.22 23 24## Evaluation25As in the paper AlignScore, we use their AlignScore function which chunk context into roughly 350 tokens and splits claim into sentences26each context chunk is evaluated against each claim sentence and aggregated one consistency score27 28AlignScoreCS model is built on three XLM-RoBERTa architectures sharing one encoder29 30 31MultiTask multilingual model for assessing facticity in various NLU tasks in Czech and English language. We followed the initial paper AlignScore https://arxiv.org/abs/2305.16739.32We trained a model using a shared architecture of checkpoint xlm-roberta-large [xlm-roberta](https://huggingface.co/FacebookAI/xlm-roberta-large) with three linear layers for regression,33binary classification and ternary classification. 34 35 36# Usage37```python38 # Assuming you copied the attached Files_and_versions/AlignScore.py file for ease of use in transformers.39 from AlignScoreCS import AlignScoreCS40 alignScoreCS = AlignScoreCS.from_pretrained("krotima1/AlignScoreCS")41 # put the model to cuda to accelerate42 print(alignScoreCS.score(context="This is context", claim="This is claim"))43 44```45 46# Results47 48 49 50# Training datasets51The following table shows datasets that has been utilized for training the model. We translated these english datasets to Czech using seamLessM4t.52 53| NLP Task | Dataset | Training Task | Context (n words) | Claim (n words) | Sample Count | 54|-----------------------|-------------------|---------------|-------------------|-----------------|--------------|55| NLI | SNLI | 3-way | 10 | 13 | Cs: 500k |56| | | | | | En: 550k |57| | MultiNLI | 3-way | 16 | 20 | Cs: 393k |58| | | | | | En: 393k |59| | Adversarial NLI | 3-way | 48 | 54 | Cs: 163k |60| | | | | | En: 163k |61| | DocNLI | 2-way | 97 | 285 | Cs: 200k |62| | | | | | En: 942k |63| Fact Verification | NLI-style FEVER | 3-way | 48 | 50 | Cs: 208k |64| | | | | | En: 208k |65| | Vitamin C | 3-way | 23 | 25 | Cs: 371k |66| | | | | | En: 371k |67| Paraphrase | QQP | 2-way | 9 | 11 | Cs: 162k |68| | | | | | En: 364k |69| | PAWS | 2-way | - | 18 | Cs: - |70| | | | | | En: 707k |71| | PAWS labeled | 2-way | 18 | - | Cs: 49k |72| | | | | | En: - |73| | PAWS unlabeled | 2-way | 18 | - | Cs: 487k |74| | | | | | En: - |75| STS | SICK | reg | - | 10 | Cs: - |76| | | | | | En: 4k |77| | STS Benchmark | reg | - | 10 | Cs: - |78| | | | | | En: 6k |79| | Free-N1 | reg | 18 | - | Cs: 20k |80| | | | | | En: - |81| QA | SQuAD v2 | 2-way | 105 | 119 | Cs: 130k |82| | | | | | En: 130k |83| | RACE | 2-way | 266 | 273 | Cs: 200k |84| | | | | | En: 351k |85| Information Retrieval| MS MARCO | 2-way | 49 | 56 | Cs: 200k |86| | | | | | En: 5M |87| Summarization | WikiHow | 2-way | 434 | 508 | Cs: 157k |88| | | | | | En: 157k |89| | SumAug | 2-way | - | - | Cs: - |90| | | | | | En: - |