Views
No views yet
question-answering: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.QuestionAnsweringPipeline1python transformers/examples/question-answering/run_squad.py \
2 --model_type bert \
3 --model_name_or_path 'google/mobilebert-uncased' \
4 --do_eval \
5 --do_train \
6 --do_lower_case \
7 --train_file '/content/dataset/train-v1.1.json' \
8 --predict_file '/content/dataset/dev-v1.1.json' \
9 --per_gpu_train_batch_size 16 \
10 --learning_rate 3e-5 \
11 --num_train_epochs 5 \
12 --max_seq_length 384 \
13 --doc_stride 128 \
14 --output_dir '/content/output' \
15 --overwrite_output_dir \
16 --save_steps 1000| Metric | # Value |
|---|---|
| EM | 82.33 |
| F1 | 89.64 |
| Size | 94 MB |
1from transformers import pipeline
2QnA_pipeline = pipeline('question-answering', model='mrm8488/mobilebert-uncased-finetuned-squadv1')
3QnA_pipeline({
4 'context': 'A new strain of flu that has the potential to become a pandemic has been identified in China by scientists.',
5 'question': 'Who did identified it ?'
6 })
7
8# Output: {'answer': 'scientists.', 'end': 106, 'score': 0.7885545492172241, 'start': 96}Created by Manuel Romero/@mrm8488 | LinkedIn
Made with ♥ in Spain