Downloads · 30 days
0
combi2k2/MRC001
MRC001 is a machine learning model from combi2k2. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated Sep 23, 2022
Repo size
1.6 GB
Likes
0
Public
Click a slice to open those files.
.bin538 MB · 100%
From the Hugging Face model README
The following modules are essential for running the trainer:
Run the following commands to install the required libraries:
>>> pip install datasets evaluate numpy
>>> pip install git+https://github.com/huggingface/transformers
batch_size = 16
n_epochs = 10
base_LM_model = "xlm-roberta-base"
max_seq_len = 256
learning_rate = 2e-5
weight_decay = 0.01
Evaluated on the UIT-ViQuAD2.0 dev set with the official eval script.
'exact': 29.947276,
'f1': 43.627568,
'total': 2845,
'HasAns_exact': 43.827160,
'HasAns_f1': 63.847958,
'HasAns_total': 1944,
'NoAns_exact': 0.0,
'NoAns_f1': 0.0,
'NoAns_total': 901
from transformers import {
AutoModelForQuestionAnswering,
AutoTokenizer,
pipeline
}
model_checkpoint = "results/checkpoint-16000"
question_answerer = pipeline("question-answering", model = model_checkpoint)
# a) get predictions
QA_input = {
'question': 'Hiến pháp Mali quy định thế nào đối với tôn giáo?',
'context': 'Ước tính có khoảng 90% dân số Mali theo đạo Hồi (phần lớn là hệ phái Sunni), khoảng 5% là theo Kitô giáo (khoảng hai phần ba theo Giáo hội Công giáo Rôma và một phần ba là theo Tin Lành) và 5% còn lại theo các tín ngưỡng vật linh truyền thống bản địa. Một số ít người Mali theo thuyết vô thần và thuyết bất khả tri, phần lớn họ thực hiện những nghi lễ tôn giáo cơ bản hằng ngày. Các phong tục Hồi giáo ở Mali có mức độ vừa phải, khoan dung, và đã thay đổi theo các điều kiện của địa phương; các mối quan hệ giữa người Hồi giáo và các cộng đồng tôn giáo nhỏ khác nói chung là thân thiện. Hiến pháp của Mali đã quy định một thể chế nhà nước thế tục và ủng hộ quyền tự do tôn giáo, và chính phủ Mali phải đảm bảo quyền này.'
}
res = question_answerer(QA_input)
# b) Load model & tokenizer
model = AutoModelForQuestionAnswering.from_pretrained(model_checkpoint)
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
Duc Nguyen
Kiet Van Nguyen, Son Quoc Tran, Luan Thanh Nguyen, Tin Van Huynh, Son T. Luu, Ngan Luu-Thuy Nguyen. "VLSP 2021 Shared Task: Vietnamese Machine Reading Comprehension." The 8th International Workshop on Vietnamese Language and Speech Processing (VLSP 2021) .