File size: 9,297 Bytes
c3215ea
2ac9307
 
c3215ea
2ac9307
 
 
 
 
 
 
c3215ea
2ac9307
77b4582
 
2ac9307
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43893af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2ac9307
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
---
language:
- vi
library_name: transformers
tags:
- SemViQA
- question-answering
- fact-checking
- information-retrieval
pipeline_tag: question-answering
license: mit
---
## Model Description
- **Developed by:** [SemViQA Research Team](https://huggingface.co/SemViQA)  
- **Fine-tuned model:** [InfoXLM](https://huggingface.co/microsoft/infoxlm-large)  
- **Supported Language:** Vietnamese  
- **Task:** Extractive QA, Evidence Extraction  
- **Dataset:** [ViWikiFC](https://arxiv.org/abs/2405.07615)

This model is fine-tuned on [InfoXLM](https://huggingface.co/microsoft/infoxlm-large) to evaluate its performance in comparison to our proposed approaches for Vietnamese fact-checking tasks.  

## Using pre-trained model

Direct Model Usage
```python
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
import torch 

tokenizer = AutoTokenizer.from_pretrained("SemViQA/infoxlm-large-viwikifc")
model = AutoModelForQuestionAnswering.from_pretrained("SemViQA/infoxlm-large-viwikifc")
claim = "Chiến tranh với Campuchia đã kết thúc trước khi Việt Nam thống nhất."
context = "Sau khi thống nhất, Việt Nam tiếp tục gặp khó khăn do sự sụp đổ và tan rã của đồng minh Liên Xô cùng Khối phía Đông, các lệnh cấm vận của Hoa Kỳ, chiến tranh với Campuchia, biên giới giáp Trung Quốc và hậu quả của chính sách bao cấp sau nhiều năm áp dụng. Năm 1986, Đảng Cộng sản ban hành cải cách đổi mới, tạo điều kiện hình thành kinh tế thị trường và hội nhập sâu rộng. Cải cách đổi mới kết hợp cùng quy mô dân số lớn đưa Việt Nam trở thành một trong những nước đang phát triển có tốc độ tăng trưởng thuộc nhóm nhanh nhất thế giới, được coi là Hổ mới châu Á dù cho vẫn gặp phải những thách thức như tham nhũng, tội phạm gia tăng, ô nhiễm môi trường và phúc lợi xã hội chưa đầy đủ. Ngoài ra, giới bất đồng chính kiến, chính phủ một số nước phương Tây và các tổ chức theo dõi nhân quyền có quan điểm chỉ trích hồ sơ nhân quyền của Việt Nam liên quan đến các vấn đề tôn giáo, kiểm duyệt truyền thông, hạn chế hoạt động ủng hộ nhân quyền cùng các quyền tự do dân sự."

inputs = tokenizer(claim, context, return_tensors="pt", truncation=True, max_length=512)

with torch.no_grad():
    outputs = model(**inputs)
 
start_logits = outputs.start_logits
end_logits = outputs.end_logits
 
start_idx = torch.argmax(start_logits)
end_idx = torch.argmax(end_logits)
 
tokens = inputs["input_ids"][0][start_idx : end_idx + 1]
evidence = tokenizer.decode(tokens, skip_special_tokens=True)
print(evidence)
# evidence: 
```

## **Evaluation Results**

We evaluate the model's performance in the QA-based approaches section without handling token lengths exceeding 512.

<table> 
  <thead>
    <tr>
      <th colspan="2">Method</th>
      <th colspan="4">ViWikiFC</th>
    </tr>
    <tr>
      <th>ER</th>
      <th>VC</th>
      <th>Strict Acc</th>
      <th>VC Acc</th>
      <th>ER Acc</th>
      <th>Time (s)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan="3">TF-IDF</td>
      <td>InfoXLM<sub>large</sub></td>
      <td>75.56</td>
      <td>82.21</td>
      <td>90.15</td>
      <td>131</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td>76.47</td>
      <td>82.78</td>
      <td>90.15</td>
      <td>134</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>75.56</td>
      <td>81.83</td>
      <td>90.15</td>
      <td>144</td>
    </tr>
    <tr>
      <td rowspan="3">BM25</td>
      <td>InfoXLM<sub>large</sub></td>
      <td>70.44</td>
      <td>79.01</td>
      <td>83.50</td>
      <td>130</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td>70.97</td>
      <td>78.91</td>
      <td>83.50</td>
      <td>132</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>70.21</td>
      <td>78.29</td>
      <td>83.50</td>
      <td>141</td>
    </tr>
    <tr>
      <td rowspan="3">SBert</td>
      <td>InfoXLM<sub>large</sub></td>
      <td>74.99</td>
      <td>81.59</td>
      <td>89.72</td>
      <td>195</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td>75.80</td>
      <td>82.35</td>
      <td>89.72</td>
      <td>194</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>75.13</td>
      <td>81.44</td>
      <td>89.72</td>
      <td>203</td>
    </tr>
    <tr>
      <th colspan="1">QA-based approaches</th>
      <th colspan="1">VC</th>
      <th colspan="4"></th>
    </tr>
    <tr>
      <td rowspan="3">ViMRC<sub>large</sub></td>
      <td>InfoXLM<sub>large</sub></td>
      <td>77.28</td>
      <td>81.97</td>
      <td>92.49</td>
      <td>3778</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td>78.29</td>
      <td>82.83</td>
      <td>92.49</td>
      <td>3824</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>77.38</td>
      <td>81.92</td>
      <td>92.49</td>
      <td>3785</td>
    </tr>
    <tr>
      <td rowspan="3">InfoXLM<sub>large</sub></td>
      <td>InfoXLM<sub>large</sub></td>
      <td>78.14</td>
      <td>82.07</td>
      <td>93.45</td>
      <td>4092</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td>79.20</td>
      <td>83.07</td>
      <td>93.45</td>
      <td>4096</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>78.24</td>
      <td>82.21</td>
      <td>93.45</td>
      <td>4102</td>
    </tr>
    <tr>
      <th colspan="2">LLM</th> 
      <th colspan="4"></th>
    </tr>
    <tr>
      <td colspan="2">Qwen2.5-1.5B-Instruct</td>
      <td>51.03</td>
      <td>65.18</td>
      <td>78.96</td>
      <td>7665</td>
    </tr>
    <tr>
      <td colspan="2">Qwen2.5-3B-Instruct</td>
      <td>44.38</td>
      <td>62.31</td>
      <td>71.35</td>
      <td>12123</td>
    </tr>
    <tr>
      <th colspan="1">LLM</th>
      <th colspan="1">VC</th>
      <th colspan="4"></th>
    </tr>
    <tr>
      <td rowspan="3">Qwen2.5-1.5B-Instruct</td>
      <td>InfoXLM<sub>large</sub></td>
      <td>66.14</td>
      <td>76.47</td>
      <td>78.96</td>
      <td>7788</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td>67.67</td>
      <td>78.10</td>
      <td>78.96</td>
      <td>7789</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>66.52</td>
      <td>76.52</td>
      <td>78.96</td>
      <td>7794</td>
    </tr>
    <tr>
      <td rowspan="3">Qwen2.5-3B-Instruct</td>
      <td>InfoXLM<sub>large</sub></td>
      <td>59.88</td>
      <td>72.50</td>
      <td>71.35</td>
      <td>12246</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td>60.74</td>
      <td>73.08</td>
      <td>71.35</td>
      <td>12246</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>60.02</td>
      <td>72.21</td>
      <td>71.35</td>
      <td>12251</td>
    </tr>
    <tr>
      <th colspan="1">SER Faster (ours)</th>
      <th colspan="1">TVC (ours)</th>
      <th colspan="4"></th>
    </tr>
    <tr>
      <td>TF-IDF + ViMRC<sub>large</sub></td>
      <td>Ernie-M<sub>large</sub></td>
      <td style="color:blue">79.44</td>
      <td style="color:blue">82.93</td>
      <td style="color:blue">94.60</td>
      <td style="color:blue">410</td>
    </tr>
    <tr>
      <td>TF-IDF + InfoXLM<sub>large</sub></td>
      <td>Ernie-M<sub>large</sub></td>
      <td style="color:blue">79.77</td>
      <td style="color:blue">83.07</td>
      <td style="color:blue">95.03</td>
      <td style="color:blue">487</td>
    </tr>
    <tr>
      <th colspan="1">SER (ours)</th>
      <th colspan="1">TVC (ours)</th>
      <th colspan="4"></th>
    </tr>
    <tr>
      <td rowspan="3">TF-IDF + ViMRC<sub>large</sub></td>
      <td>InfoXLM<sub>large</sub></td>
      <td>80.25</td>
      <td>83.84</td>
      <td>94.69</td>
      <td>2731</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td>80.34</td>
      <td>83.64</td>
      <td>94.69</td>
      <td>2733</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>79.53</td>
      <td>82.97</td>
      <td>94.69</td>
      <td>2733</td>
    </tr>
    <tr>
      <td rowspan="3">TF-IDF + InfoXLM<sub>large</sub></td>
      <td>InfoXLM<sub>large</sub></td>
      <td>80.68</td>
      <td><strong>83.98</strong></td>
      <td><strong>95.31</strong></td>
      <td>3860</td>
    </tr>
    <tr>
      <td>XLM-R<sub>large</sub></td>
      <td><strong>80.82</strong></td>
      <td>83.88</td>
      <td><strong>95.31</strong></td>
      <td>3843</td>
    </tr>
    <tr>
      <td>Ernie-M<sub>large</sub></td>
      <td>80.06</td>
      <td>83.17</td>
      <td><strong>95.31</strong></td>
      <td>3891</td>
    </tr>
  </tbody>
</table>

## About

*Built by Dien X. Tran*
[![LinkedIn](https://img.shields.io/badge/LinkedIn-Profile-blue?logo=linkedin)](https://www.linkedin.com/in/xndien2004/)
For more details, visit the project repository.
[![GitHub stars](https://img.shields.io/github/stars/DAVID-NGUYEN-S16/SemViQA?style=social)](https://github.com/DAVID-NGUYEN-S16/SemViQA)