Downloads · 30 days
14
1% of all-time downloads
zhufy/xquad-th-mbert-base
xquad-th-mbert-base is a question answering model from zhufy. Use it when the input is a question plus a passage. It is set up for transformers.
This model is for Thai extractive question answering. It is based on the multilingual BERT bert-base-multilingual-cased model, and it is case-sensitive: it makes a difference between english and English
Downloads · 30 days
14
1% of all-time downloads
All-time downloads
1.8K
Public
Repo size
1.4 GB
Likes
0
Public
Click a slice to open those files.
.bin709 MB · 100%
From the Hugging Face model README
This model is for Thai extractive question answering. It is based on the multilingual BERT bert-base-multilingual-cased model, and it is case-sensitive: it makes a difference between english and English
We split the original xquad dataset into the training/validation/testing set. Totally, there are 876/161/153 question-answer pairs from 34/7/7 articles in the training/validation/testing set separately. You can find the details of the dataset here xquad_split.
You can use it directly from the 🤗 Transformers library with a pipeline:
>>> from transformers.pipelines import pipeline
>>> from transformers import AutoTokenizer, AutoModelForQuestionAnswering
>>> tokenizer = AutoTokenizer.from_pretrained("zhufy/xquad-th-mbert-base")
>>> model = AutoModelForQuestionAnswering.from_pretrained("zhufy/xquad-th-mbert-base")
>>> nlp = pipeline("question-answering", model=model, tokenizer=tokenizer)
>>> context = "ดินดอนสามเหลี่ยม ไรน์-เมิส ซึ่งเป็นภูมิภาคทางธรรมชาติที่สำคัญของเนเธอร์แลนด์เริ่มต้น
ใกล้มิลลิงเงิน อาน เดอ เรน ใกล้ชายแดนเนเธอร์แลนด์ติดกับเยอรมัน
โดยมีสาขาของไรน์ไหลเข้าสู่แม่น้ำวาลและเนเดอร์เรน เนื่องจากน้ำส่วนใหญ่จากแม่น้ำไรน์
คำว่า ดินดอนสามเหลี่ยมไรน์ ซึ่งสั้นกว่าจึงเป็นคำที่ใช้เรียกกันทั่วไป อย่างไรก็ดี
ชื่อนี้ยังใช้เรียกดินดอนสามเหลี่ยมบริเวณแม่น้ำซึ่งแม่น้ำไรน์ไหลเข้าสู่ทะเลสาบคอนสแตนซ์อีกด้วย
ดังนั้นการเรียกดินดอนสามเหลี่ยมซึ่งใหญ่กว่าว่าไรน์-เมิส หรือแม้กระทั่งดินแดนสามเหลี่ยมไรน์
-เมิส-สเกลต์จึงชัดเจนกว่า เนื่องจากแม่น้ำสเกลต์สิ้นสุดที่ดินดอนสามเหลี่ยมเดียวกัน"
>>> question = "ดินดอนสามเหลี่ยมในเนเธอร์แลนด์มีชื่อว่าอะไร?"
>>> inputs = {"question": question,
"context":context }
>>> nlp(inputs)
{'score': 0.9426798224449158,
'start': 17,
'end': 84,
'answer': 'ไรน์-เมิส ซึ่งเป็นภูมิภาคทางธรรมชาติที่สำคัญของเนเธอร์แลนด์เริ่มต้น'}