Fredopayn1119/GROUP-22

0

stars

70

commits

Python

primary language

Dec 6, 2023

updated

README

Investigating the Capabilities of Domain-Specific Biomedical Models

(ICDSBM)

This project focuses on the testing of multiple biomedical LLMs, with an aim of reproducing the results promised by their respective sources.

Video/demo/GIF

Watch the video

Table of Contents

  1. Demo

  2. Installation

  3. Reproducing this project

  4. Guidance

1. Example demo

A minimal example to showcase your work

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)
print(" ")
print("Output:")
print("------------------")
print(generator("COVID-19 is", max_length=100, num_return_sequences=1, do_sample=True))
print("------------------")

What to find where

*Note: the biobert-pytorch folder can be ignored

repository
├── images                            ## folder containing illustrative images used in the LLM-Guide.md file
├── llm-files/                        ## code from minimal example above: to run text generation with a prompt using BioGPT
    ├── biogpt-text-generation.py     ##code for text generation with bioGPT LLM
    ├── biogpt-question-answering.py  ##code for question answering with bioGPT LLM
    ├── gptneo-text-generation.py     ##code for text generation gptneo LLM
    ├── gptneo-question-answering.py  ##code for question answering gptneo LLM
    ├── meditron.py                   ##code for meditron LLM
    ├── openlm-test.py                ##code for openlm-test LLM
    ├── spacy-llm.py                  ##code for spacy-llm LLM
├── .py                               ## scripts, if needed
├── docs                              ## If needed, documentation   
├── README.md                         ## You are here
├── LLM-Guide.md                      ## md file containing installation and running instructions for each LLM
├── requirements.yml                  ## If you use conda

2. Installation

Provide sufficient instructions to reproduce and install your project. Provide exact versions, test on CSIL or reference workstations.

git clone https://github.com/Fredopayn1119/GROUP-22.git
cd GROUP-22

3. Reproduction

Demonstrate how your work can be reproduced, e.g. the results in your report.

cd llm-files
python biogpt-text-generation.py

Output will be printed in the terminal.

4. Guidance

  • Use git
    • Do NOT use history re-editing (rebase)
    • Commit messages should be informative:
      • No: 'this should fix it', 'bump' commit messages
      • Yes: 'Resolve invalid API call in updating X'
    • Do NOT include IDE folders (.idea), or hidden files. Update your .gitignore where needed.
    • Do NOT use the repository to upload data
  • Use VSCode or a similarly powerful IDE
  • Use Copilot for free
  • Sign up for GitHub Education

Contributors

Fredopayn1119

68 commits

manda2300

2 commits

Fredopayn1119/GROUP-22

0

stars

70

commits

Python

primary language

Dec 6, 2023

updated

README

Investigating the Capabilities of Domain-Specific Biomedical Models

(ICDSBM)

This project focuses on the testing of multiple biomedical LLMs, with an aim of reproducing the results promised by their respective sources.

Video/demo/GIF

Watch the video

Table of Contents

  1. Demo

  2. Installation

  3. Reproducing this project

  4. Guidance

1. Example demo

A minimal example to showcase your work

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)
print(" ")
print("Output:")
print("------------------")
print(generator("COVID-19 is", max_length=100, num_return_sequences=1, do_sample=True))
print("------------------")

What to find where

*Note: the biobert-pytorch folder can be ignored

repository
├── images                            ## folder containing illustrative images used in the LLM-Guide.md file
├── llm-files/                        ## code from minimal example above: to run text generation with a prompt using BioGPT
    ├── biogpt-text-generation.py     ##code for text generation with bioGPT LLM
    ├── biogpt-question-answering.py  ##code for question answering with bioGPT LLM
    ├── gptneo-text-generation.py     ##code for text generation gptneo LLM
    ├── gptneo-question-answering.py  ##code for question answering gptneo LLM
    ├── meditron.py                   ##code for meditron LLM
    ├── openlm-test.py                ##code for openlm-test LLM
    ├── spacy-llm.py                  ##code for spacy-llm LLM
├── .py                               ## scripts, if needed
├── docs                              ## If needed, documentation   
├── README.md                         ## You are here
├── LLM-Guide.md                      ## md file containing installation and running instructions for each LLM
├── requirements.yml                  ## If you use conda

2. Installation

Provide sufficient instructions to reproduce and install your project. Provide exact versions, test on CSIL or reference workstations.

git clone https://github.com/Fredopayn1119/GROUP-22.git
cd GROUP-22

3. Reproduction

Demonstrate how your work can be reproduced, e.g. the results in your report.

cd llm-files
python biogpt-text-generation.py

Output will be printed in the terminal.

4. Guidance

  • Use git
    • Do NOT use history re-editing (rebase)
    • Commit messages should be informative:
      • No: 'this should fix it', 'bump' commit messages
      • Yes: 'Resolve invalid API call in updating X'
    • Do NOT include IDE folders (.idea), or hidden files. Update your .gitignore where needed.
    • Do NOT use the repository to upload data
  • Use VSCode or a similarly powerful IDE
  • Use Copilot for free
  • Sign up for GitHub Education

Contributors

Fredopayn1119

68 commits

manda2300

2 commits

Languages

Python

100.0%