Fine-Tuning Large Neural Language Models for Biomedical Natural Language Processing
Paper • 2112.07869 • Published
How to use kiddothe2b/biomedical-longformer-base with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("fill-mask", model="kiddothe2b/biomedical-longformer-base") # Load model directly
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("kiddothe2b/biomedical-longformer-base")
model = AutoModelForMaskedLM.from_pretrained("kiddothe2b/biomedical-longformer-base")# Load model directly
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("kiddothe2b/biomedical-longformer-base")
model = AutoModelForMaskedLM.from_pretrained("kiddothe2b/biomedical-longformer-base")This is a derivative model based on microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract BERT model developed in the work "Fine-Tuning Large Neural Language Models for Biomedical Natural Language Processing" by Tinn et al. (2021). All model parameters where cloned from the original model, while the positional embeddings were extended by cloning the original embeddings multiple times following Beltagy et al. (2020) using a python script similar to this one (https://github.com/allenai/longformer/blob/master/scripts/convert_model_to_long.ipynb).
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="kiddothe2b/biomedical-longformer-base")