Instructions to use franklu/pubmed_bert_squadv2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use franklu/pubmed_bert_squadv2 with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="franklu/pubmed_bert_squadv2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("franklu/pubmed_bert_squadv2") model = AutoModelForQuestionAnswering.from_pretrained("franklu/pubmed_bert_squadv2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from franklu/pubmed_bert_squadv2: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/franklu/pubmed_bert_squadv2/resolve/main/README.md
- Command line
-
hf download hf://franklu/pubmed_bert_squadv2/README.md
-
curl -L -o README.md https://huggingface.co/franklu/pubmed_bert_squadv2/resolve/main/README.md
834 Bytes
| **[`microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext`](https://huggingface.co/microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext)** fine-tuned on **[`SQuAD V2`](https://rajpurkar.github.io/SQuAD-explorer/)** using **[`run_qa.py`](https://github.com/huggingface/transformers/blob/master/examples/pytorch/question-answering/run_qa.py)** | |
| Tunning script: | |
| ```bash | |
| BASE_MODEL=microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext | |
| OUTPUT_DIR=~/Documents/projects/tunned_models/ms_pubmed_bert_squadv2/ | |
| python run_qa.py \ | |
| --model_name_or_path $BASE_MODEL\ | |
| --dataset_name squad_v2 \ | |
| --do_train \ | |
| --do_eval \ | |
| --version_2_with_negative \ | |
| --per_device_train_batch_size 12 \ | |
| --learning_rate 3e-5 \ | |
| --num_train_epochs 2 \ | |
| --max_seq_length 384 \ | |
| --doc_stride 128 \ | |
| --output_dir $OUTPUT_DIR | |
| ``` |