Views
No views yet
1python run_squad.py \
2 --model_type bert \
3 --model_name_or_path bert-small-cord19-squad \
4 --do_train \
5 --do_lower_case \
6 --version_2_with_negative \
7 --train_file cord19-qa.json \
8 --per_gpu_train_batch_size 8 \
9 --learning_rate 5e-5 \
10 --num_train_epochs 10.0 \
11 --max_seq_length 384 \
12 --doc_stride 128 \
13 --output_dir bert-small-cord19qa \
14 --save_steps 0 \
15 --threads 8 \
16 --overwrite_cache \
17 --overwrite_output_dir1from transformers import pipeline
2
3qa = pipeline(
4 "question-answering",
5 model="NeuML/bert-small-cord19qa",
6 tokenizer="NeuML/bert-small-cord19qa"
7)
8
9qa({
10 "question": "What is the median incubation period?",
11 "context": "The incubation period is around 5 days (range: 4-7 days) with a maximum of 12-13 day"
12})
13
14qa({
15 "question": "What is the incubation period range?",
16 "context": "The incubation period is around 5 days (range: 4-7 days) with a maximum of 12-13 day"
17})
18
19qa({
20 "question": "What type of surfaces does it persist?",
21 "context": "The virus can survive on surfaces for up to 72 hours such as plastic and stainless steel ."
22})1{"score": 0.5970273583242793, "start": 32, "end": 38, "answer": "5 days"}
2{"score": 0.999555868193891, "start": 39, "end": 56, "answer": "(range: 4-7 days)"}
3{"score": 0.9992726505196998, "start": 61, "end": 88, "answer": "plastic and stainless steel"}