Biogpt
B
Biogpt
由microsoft開發
BioGPT是一個基於大規模生物醫學文獻預訓練的領域專用生成式Transformer語言模型,專注於生物醫學文本生成與挖掘任務。
下載量 67.65k
發布時間 : 11/20/2022
模型概述
BioGPT是一個針對生物醫學領域的生成式預訓練語言模型,能夠執行文本生成、關係抽取等任務,在多項生物醫學NLP任務上達到領先水平。
模型特點
領域專用預訓練
基於大規模生物醫學文獻進行預訓練,具有領域專業知識
生成能力強
能夠生成流暢、專業的生物醫學文本描述
多任務性能優異
在關係抽取、問答等多項生物醫學NLP任務上創造新紀錄
模型能力
生物醫學文本生成
端到端關係抽取
生物醫學問答
專業術語解釋
文獻摘要生成
使用案例
生物醫學研究
藥物關係抽取
從文獻中自動識別藥物-疾病、藥物-靶點等關係
在DDI任務上達到40.76%的F1值
醫學問答系統
回答生物醫學領域的專業問題
在PubMedQA上達到78.2%的準確率
醫學教育
專業術語解釋
為醫學生或研究人員生成專業術語的詳細解釋
能生成流暢準確的生物醫學概念描述
🚀 BioGPT
BioGPT是一個特定領域的生成式Transformer語言模型,它在大規模生物醫學文獻上進行了預訓練。該模型在多個生物醫學自然語言處理任務中表現出色,能為生物醫學術語生成流暢的描述,拓寬了預訓練語言模型在生物醫學領域的應用範圍。
🚀 快速開始
你可以直接使用文本生成管道來使用這個模型。由於生成過程依賴於一定的隨機性,為了保證結果的可重複性,我們設置了一個隨機種子:
>>> from transformers import pipeline, set_seed
>>> from transformers import BioGptTokenizer, BioGptForCausalLM
>>> model = BioGptForCausalLM.from_pretrained("microsoft/biogpt")
>>> tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt")
>>> generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
>>> set_seed(42)
>>> generator("COVID-19 is", max_length=20, num_return_sequences=5, do_sample=True)
[{'generated_text': 'COVID-19 is a disease that spreads worldwide and is currently found in a growing proportion of the population'},
{'generated_text': 'COVID-19 is one of the largest viral epidemics in the world.'},
{'generated_text': 'COVID-19 is a common condition affecting an estimated 1.1 million people in the United States alone.'},
{'generated_text': 'COVID-19 is a pandemic, the incidence has been increased in a manner similar to that in other'},
{'generated_text': 'COVID-19 is transmitted via droplets, air-borne, or airborne transmission.'}]
✨ 主要特性
受預訓練語言模型在通用自然語言領域的巨大成功啟發,其在生物醫學領域也受到了越來越多的關注。在通用語言領域的預訓練語言模型的兩個主要分支,即BERT(及其變體)和GPT(及其變體)中,前者在生物醫學領域得到了廣泛研究,如BioBERT和PubMedBERT。雖然它們在各種判別式下游生物醫學任務中取得了巨大成功,但缺乏生成能力限制了它們的應用範圍。
BioGPT是一個特定領域的生成式Transformer語言模型,在大規模生物醫學文獻上進行了預訓練。在六個生物醫學自然語言處理任務中對BioGPT進行了評估,結果表明該模型在大多數任務上優於以前的模型。特別是,在BC5CDR、KD - DTI和DDI端到端關係提取任務中,分別獲得了44.98%、38.42%和40.76%的F1分數,在PubMedQA上獲得了78.2%的準確率,創造了新的記錄。文本生成的案例研究進一步證明了BioGPT在生物醫學文獻方面的優勢,能夠為生物醫學術語生成流暢的描述。
💻 使用示例
基礎用法
以下是如何在PyTorch中使用該模型獲取給定文本特徵的示例:
from transformers import BioGptTokenizer, BioGptForCausalLM
tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt")
model = BioGptForCausalLM.from_pretrained("microsoft/biogpt")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
高級用法
以下是使用束搜索解碼的示例:
import torch
from transformers import BioGptTokenizer, BioGptForCausalLM, set_seed
tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt")
model = BioGptForCausalLM.from_pretrained("microsoft/biogpt")
sentence = "COVID-19 is"
inputs = tokenizer(sentence, return_tensors="pt")
set_seed(42)
with torch.no_grad():
beam_output = model.generate(**inputs,
min_length=100,
max_length=1024,
num_beams=5,
early_stopping=True
)
tokenizer.decode(beam_output[0], skip_special_tokens=True)
'COVID-19 is a global pandemic caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), the causative agent of coronavirus disease 2019 (COVID-19), which has spread to more than 200 countries and territories, including the United States (US), Canada, Australia, New Zealand, the United Kingdom (UK), and the United States of America (USA), as of March 11, 2020, with more than 800,000 confirmed cases and more than 800,000 deaths.'
📚 詳細文檔
如果您在研究中發現BioGPT很有用,請引用以下論文:
@article{10.1093/bib/bbac409,
author = {Luo, Renqian and Sun, Liai and Xia, Yingce and Qin, Tao and Zhang, Sheng and Poon, Hoifung and Liu, Tie-Yan},
title = "{BioGPT: generative pre-trained transformer for biomedical text generation and mining}",
journal = {Briefings in Bioinformatics},
volume = {23},
number = {6},
year = {2022},
month = {09},
abstract = "{Pre-trained language models have attracted increasing attention in the biomedical domain, inspired by their great success in the general natural language domain. Among the two main branches of pre-trained language models in the general language domain, i.e. BERT (and its variants) and GPT (and its variants), the first one has been extensively studied in the biomedical domain, such as BioBERT and PubMedBERT. While they have achieved great success on a variety of discriminative downstream biomedical tasks, the lack of generation ability constrains their application scope. In this paper, we propose BioGPT, a domain-specific generative Transformer language model pre-trained on large-scale biomedical literature. We evaluate BioGPT on six biomedical natural language processing tasks and demonstrate that our model outperforms previous models on most tasks. Especially, we get 44.98\%, 38.42\% and 40.76\% F1 score on BC5CDR, KD-DTI and DDI end-to-end relation extraction tasks, respectively, and 78.2\% accuracy on PubMedQA, creating a new record. Our case study on text generation further demonstrates the advantage of BioGPT on biomedical literature to generate fluent descriptions for biomedical terms.}",
issn = {1477-4054},
doi = {10.1093/bib/bbac409},
url = {https://doi.org/10.1093/bib/bbac409},
note = {bbac409},
eprint = {https://academic.oup.com/bib/article-pdf/23/6/bbac409/47144271/bbac409.pdf},
}
📄 許可證
本項目採用MIT許可證。
Phi 2 GGUF
其他
Phi-2是微軟開發的一個小型但強大的語言模型,具有27億參數,專注於高效推理和高質量文本生成。
大型語言模型 支持多種語言
P
TheBloke
41.5M
205
Roberta Large
MIT
基於掩碼語言建模目標預訓練的大型英語語言模型,採用改進的BERT訓練方法
大型語言模型 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基礎模型的蒸餾版本,在保持相近性能的同時更輕量高效,適用於序列分類、標記分類等自然語言處理任務。
大型語言模型 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一個多語言大語言模型,針對多語言對話用例進行了優化,在常見的行業基準測試中表現優異。
大型語言模型 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基於100種語言的2.5TB過濾CommonCrawl數據預訓練的多語言模型,採用掩碼語言建模目標進行訓練。
大型語言模型 支持多種語言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基於Transformer架構的英語預訓練模型,通過掩碼語言建模目標在海量文本上訓練,支持文本特徵提取和下游任務微調
大型語言模型 英語
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI發佈的開放預訓練Transformer語言模型套件,參數量從1.25億到1750億,旨在對標GPT-3系列性能,同時促進大規模語言模型的開放研究。
大型語言模型 英語
O
facebook
6.3M
198
1
基於transformers庫的預訓練模型,適用於多種NLP任務
大型語言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多語言大語言模型系列,包含8B、70B和405B參數規模,支持8種語言和代碼生成,優化了多語言對話場景。
大型語言模型
Transformers 支持多種語言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基礎版是由Google開發的文本到文本轉換Transformer模型,參數規模2.2億,支持多語言NLP任務。
大型語言模型 支持多種語言
T
google-t5
5.4M
702
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98