{"id":21441761,"url":"https://github.com/dmis-lab/biobert-pytorch","last_synced_at":"2025-04-05T19:10:11.189Z","repository":{"id":37423975,"uuid":"303941862","full_name":"dmis-lab/biobert-pytorch","owner":"dmis-lab","description":"PyTorch Implementation of BioBERT","archived":false,"fork":false,"pushed_at":"2023-06-24T05:15:27.000Z","size":1966,"stargazers_count":322,"open_issues_count":30,"forks_count":114,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-29T18:06:20.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://doi.org/10.1093/bioinformatics/btz682","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmis-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-14T07:51:15.000Z","updated_at":"2025-03-25T10:49:57.000Z","dependencies_parsed_at":"2024-12-16T11:34:27.586Z","dependency_job_id":"100b72c7-1db6-474b-a770-b9a1eccb7479","html_url":"https://github.com/dmis-lab/biobert-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2Fbiobert-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2Fbiobert-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2Fbiobert-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2Fbiobert-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmis-lab","download_url":"https://codeload.github.com/dmis-lab/biobert-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386263,"owners_count":20930619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T01:42:04.504Z","updated_at":"2025-04-05T19:10:11.160Z","avatar_url":"https://github.com/dmis-lab.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BioBERT-PyTorch\nThis repository provides the PyTorch implementation of [BioBERT](https://academic.oup.com/bioinformatics/article/36/4/1234/5566506).\nYou can easily use BioBERT with [transformers](https://github.com/huggingface/transformers).\nThis project is supported by the members of [DMIS-Lab](https://dmis.korea.ac.kr/) @ Korea University including Jinhyuk Lee, Wonjin Yoon, Minbyul Jeong, Mujeen Sung, and Gangwoo Kim.\n\n## Installation\n```bash\n# Install huggingface transformers\npip install transformers==3.0.0\n\n# Download all datasets including NER/RE/QA\n./download.sh\n```\nNote that you should also install `torch` (see [download instruction](https://pytorch.org/)) to use `transformers`.\nIf the download script does not work, you can manually download the datasets [here](https://drive.google.com/file/d/1cGqvAm9IZ_86C4Mj7Zf-w9CFilYVDl8j/view?usp=sharing) which should be unzipped in the current directory (`tar -xzvf datasets.tar.gz`).\n\n## Models\nWe provide following versions of BioBERT in PyTorch (click [here](https://huggingface.co/dmis-lab) to see all).\nYou can use BioBERT in `transformers` by setting `--model_name_or_path` as one of them (see example below).\n* `dmis-lab/biobert-base-cased-v1.2`: Trained in the same way as BioBERT-Base v1.1 but includes LM head, which can be useful for probing\n* `dmis-lab/biobert-base-cased-v1.1`: BioBERT-Base v1.1 (+ PubMed 1M)\n* `dmis-lab/biobert-large-cased-v1.1`: BioBERT-Large v1.1 (+ PubMed 1M)\n* `dmis-lab/biobert-base-cased-v1.1-mnli`: BioBERT-Base v1.1 pre-trained on MNLI\n* `dmis-lab/biobert-base-cased-v1.1-squad`: BioBERT-Base v1.1 pre-trained on SQuAD\n* `dmis-lab/biobert-base-cased-v1.2`: BioBERT-Base v1.2 (+ PubMed 1M + LM head)\n\nFor other versions of BioBERT or for Tensorflow, please see the [README](https://github.com/dmis-lab/biobert) in the original BioBERT repository.\nYou can convert any version of BioBERT into PyTorch with [this](https://github.com/huggingface/transformers/blob/v3.5.1/src/transformers/convert_bert_original_tf_checkpoint_to_pytorch.py).\n\n## Example\nFor instance, to train BioBERT on the NER dataset (NCBI-disease), run as:\n\n```bash\n# Pre-process NER datasets\ncd named-entity-recognition\n./preprocess.sh\n\n# Choose dataset and run\nexport DATA_DIR=../datasets/NER\nexport ENTITY=NCBI-disease\npython run_ner.py \\\n    --data_dir ${DATA_DIR}/${ENTITY} \\\n    --labels ${DATA_DIR}/${ENTITY}/labels.txt \\\n    --model_name_or_path dmis-lab/biobert-base-cased-v1.1 \\\n    --output_dir output/${ENTITY} \\\n    --max_seq_length 128 \\\n    --num_train_epochs 3 \\\n    --per_device_train_batch_size 32 \\\n    --save_steps 1000 \\\n    --seed 1 \\\n    --do_train \\\n    --do_eval \\\n    --do_predict \\\n    --overwrite_output_dir\n```\n\nPlease see each directory for different examples. Currently, we provide\n* [embedding/](https://github.com/dmis-lab/biobert-pytorch/tree/master/embedding): BioBERT embedding.\n* [named-entity-recognition/](https://github.com/dmis-lab/biobert-pytorch/tree/master/named-entity-recognition): NER using BioBERT.\n* [question-answering/](https://github.com/dmis-lab/biobert-pytorch/tree/master/question-answering): QA using BioBERT.\n* [relation-extraction/](https://github.com/dmis-lab/biobert-pytorch/tree/master/relation-extraction): RE using BioBERT.\n\nMost examples are modifed from [examples](https://github.com/huggingface/transformers/tree/master/examples) in Hugging Face transformers.\n\n## Citation\n```bibtex\n@article{lee2020biobert,\n  title={BioBERT: a pre-trained biomedical language representation model for biomedical text mining},\n  author={Lee, Jinhyuk and Yoon, Wonjin and Kim, Sungdong and Kim, Donghyeon and Kim, Sunkyu and So, Chan Ho and Kang, Jaewoo},\n  journal={Bioinformatics},\n  volume={36},\n  number={4},\n  pages={1234--1240},\n  year={2020},\n  publisher={Oxford University Press}\n}\n```\n\n## License and Disclaimer\nPlease see the LICENSE file for details. Downloading data indicates your acceptance of our disclaimer.\n\n\n## Contact\nFor help or issues using BioBERT-PyTorch, please create an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmis-lab%2Fbiobert-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmis-lab%2Fbiobert-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmis-lab%2Fbiobert-pytorch/lists"}