File size: 799 Bytes
4afe539
a3c5573
 
 
 
 
 
 
 
 
 
 
 
4afe539
a3c5573
 
 
 
 
 
 
 
 
 
 
 
 
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
---

language: 
- vi
- vn
- en
tags:
- question-answering
- pytorch
datasets:
- squad
pipeline_tag: question-answering 
metrics:
- squad
---

  
```python

from transformers import pipeline

model_checkpoint = "aicryptogroup/distill-xlm-mrc"

nlp = pipeline('question-answering', model=model_checkpoint,

                   tokenizer=model_checkpoint)

QA_input = {

  'question': "what is the capital of Vietnam",

  'context': "Keeping an ageless charm through centuries, Hanoi - the capital of Vietnam is famous not only for the Old Quarter with narrow and crowded streets but also for the nostalgic feeling that it brings. While Saigon is a young and modern city, the ancient Hanoi is still a true beholder of history."

}

res = nlp(QA_input)

print('pipeline: {}'.format(res))