Instructions to use techlab-khc/Llama-laboratory-brca with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use techlab-khc/Llama-laboratory-brca with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("techlab-khc/Llama-laboratory-brca", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Model Details
- Adapter Name: laboratory-brca Llama3.1-8B Adapter
- Base Model: meta-llama/Llama-3.1-8B
- Adapter Type: LoRA (Low-Rank Adaptation)
- Task: Named Entity Recognition (NER) from free-text LABORATORY-BRCA reports
- Language: Korean
- License: Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright ยฉ Meta Platforms, Inc. All Rights Reserved.
Model Description
This adapter is a LoRA fine-tuned module designed to enhance Named Entity Recognition (NER) capabilities on free-text LABORATORY-BRCA reports.
It enables structured extraction of key entities related to genetic testing, such as gene names, mutations, results, and testing methods.
The adapter is specifically trained to work on LABORATORY-BRCA records and must be used in conjunction with the Llama-3.1-8B base model.
Example
- Input
[Results]
====================================================================
BRCA2 gene pathogenic variation : Detected
Identified pathogenic variation : c.6553del (p.Ala2185Leufs*6)
====================================================================
[Interpretation]
์ ์ ์ฑ ์ ๋ฐฉ์/๋์์์ ์์ธ์ ์ ์์ธ BRCA2 ์ ์ ์์ ๋ชจ๋ exon๊ณผ ์ธ์ intron์ ์ผ๊ธฐ์์ด์ ๋ถ์ํ ๊ฒฐ๊ณผ pathogenic variation์ผ๋ก ํ๋จ๋๋ c.6553del (p.Ala2185Leufs*6) ๋ณ์ด๊ฐ Heterozygote๋ก ๊ด์ฐฐ๋์์ต๋๋ค(rs80359603). ๋ฐ๊ฒฌ๋ ๋ณ์ด์ ๋ํ ๊ฐ์กฑ๊ฒ์ฌ์ ์ ์ ์๋ด์ ์ถ์ฒํฉ๋๋ค.
์ ๋ฐฉ์์ ์ ์ ์ฑ, ๊ฐ์กฑ์ฑ, ์ฐ๋ฐ์ฑ์ผ๋ก ๋ถ๋ฅ๋๋ฉฐ, ์ด ์ค ์ ์ ์ฑ ์ ๋ฐฉ์์ ์ ์ฒด ์ ๋ฐฉ์์ ์ฝ 5-10%๋ฅผ ์ฐจ์งํฉ๋๋ค. ์ ์ ์ฑ ์ ๋ฐฉ์์ ๋๋ถ๋ถ BRCA1/2 ์ ์ ์ ๋ณ์ด์ ๊ด๋ จ ์์ผ๋ฉฐ, KOHBRA study์ ์ํ๋ฉด BRCA ๋์ฐ๋ณ์ด๋ ์ ๋ฐฉ์/๋์์ ๊ฐ์กฑ๋ ฅ์ด ์๋ ํ๊ตญ์ธ ์ ๋ฐฉ์ ํ์์ ์ฝ 22% ์ ๋์์ ๋ฐ๊ฒฌ๋์์ต๋๋ค. BRCA1/2 ์ ์ ์๋ณ์ด๋ ์ํผ์ฑ๋์์ ํ์์ ์ฝ 10% ์ ๋์์๋ ๊ด์ฐฐ๋๋ฉฐ, high-grade, fallopian tube tumor, primary peritoneal cancer์ ์ฐ๊ด์๋ ๊ฒ์ผ๋ก ์๋ ค์ ธ ์์ต๋๋ค. ์ํ๋๋ ๋์ฐ๋ณ์ด ์ ํ๊ณผ ๊ฐ์กฑ๋ ฅ์ ๋ฐ๋ผ์ ์ฐจ์ด๋ฅผ ๋ณด์ผ ์ ์์ต๋๋ค.
BRCA1/2 ์ ์ ์๋ณ์ด๋ฅผ ๋ถ์ํจ์ผ๋ก์จ ์ด๋ฌํ ์ข
์๋ค์ ๋ฐ๋ณ ์์ธ๊ณผ ๋ฐ๋ณ ์์ธก์ ๋์์ ์ค ์ ์์ผ๋ฉฐ, ์์๋ฐฉ์ ์ํ ํจ๊ณผ์ ์ธ ๋ฐฉ๋ฒ๋ค์ ํตํด ๋ฐ๋ณ๋ฅ ์ ๊ฐ์์ํฌ ์ ์์ต๋๋ค.
[Comments]
1. ๋ณธ ๊ฒ์ฌ๋ BRCA ์ ์ ์์ ๋ํ ์ผ๊ธฐ์์ด๋ถ์๋ฒ์ผ๋ก ์ํ๋์์ผ๋ฉฐ, ์ฝ 99%์ ์ผ๊ธฐ๋ณ์ด(nucleotide base alterations, small insertions/deletions)๋ฅผ ๊ฒ์ถํ ์ ์์ต๋๋ค.
2. ๊ฒ์ฌ์ ๋์ฐ๋ณ์ด๊ฐ ๊ฒ์ถ๋์ง ์์ ๊ฒฝ์ฐ ์ผ๊ธฐ์์ด๋ถ์๋ฒ์ผ๋ก ๊ฒ์ถํ ์ ์๋ large deletion/duplication ๋ฑ์ ๊ฐ๋ฅ์ฑ์ ๋ฐฐ์ ํ ์ ์์ผ๋ฉฐ ์ด ๊ฒฝ์ฐ ์ถ๊ฐ๊ฒ์ฌ์ํ(์,MLPA)์ด ํ์ํฉ๋๋ค. ๋ํ BRCA ์ด์ธ ๋ค๋ฅธ cancer susceptibility gene(์, TP53, PTEN)์ ์ํ ๊ฐ๋ฅ์ฑ๋ ๋ฐฐ์ ํ ์ ์์ต๋๋ค.
3. ๋ณธ ๊ฒ์ฌ์ ์ผ๊ธฐ๋ณ์ด์ classification์ 2015 ACMG-AMP Variant-Interpretation Guidelines๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ์ฌ ๊ฒฐ๊ณผ๋ณด๊ณ ๋น์ ๋ฌธํ๋ณด๊ณ ์ public database๋ฅผ ๊ทผ๊ฑฐ๋ก ํฉ๋๋ค. ๊ทธ๋ฌ๋, ์ด๋ฌํ ์ผ๊ธฐ๋ณ์ด์ classification์ ํ์์ฐ๊ตฌ์ ์ํด ๋ฐ๋๋ ๊ฒฝ์ฐ๊ฐ ์์ผ๋ฉฐ, ์ด๋ฌํ ์ฌ์ค์ด ํ์ธ๋ ๊ฒฝ์ฐ ๊ฒฐ๊ณผ์ ์์ ๋ณด๊ณ ๊ฐ ์์ ์ ์์ต๋๋ค.
4. ๋ณธ ๊ฒ์ฌ๊ฒฐ๊ณผ๋ ๊ฐ exon๋ณ๋ก 5', 3' flanking region, 20bps ๋ฒ์์ ๋ณ์ด๋ง์ ๋ณด๊ณ ํฉ๋๋ค. ๋ฐ๋ผ์, ์ด ๋ฒ์ ์ด์ธ์ ๋ณ์ด ์กด์ฌ (deep intron, promoter region, regulatory region์ ๋ณ์ด) ๊ฐ๋ฅ์ฑ์ ๋ฐฐ์ ํ ์ ์์ต๋๋ค.
[Informations]
-Specimen : Genomic DNA isolated from peripheral blood leukocytes
-Target disease : Breast-ovarian cancer, familial,1 (OMIM 604370)
Breast-ovarian cancer, familial,2 (OMIM 612555)
-Analyzed gene : BRCA1 on Chr.17q21, BRCA2 on Chr.13q12.3
-Mode of inheritance : Autosomal dominant
-Penetrance :
BRCA1, breast cancer (57-60%), ovarian cancer (40-59%)
BRCA2, breast cancer (49-55%), ovarian cancer (16.5-18%)
(according to NCCN guidelines)
-Method : sequencing
BRCA1, total 22 coding exons; BRCA2, total 26 coding exons
-Reference sequence:
BRCA1- OMIM 113705; NM_007294.3; NG_005905.2
BRCA2- OMIM 600185; NM_000059.3; NG_012772.3
- Output
{
"reported_result": [
{
"gene": "BRCA2",
"refseq_id": [
"NM_000059.3",
"NG_012772.3"
],
"spec_site": "peripheral blood leukocytes",
"spec_method": "sequencing \r\n BRCA1, total 22 coding exons; BRCA2, total 26 coding exons",
"pathogenicity": "pathogenic variation",
"detection_result": "Detected"
},
{
"gene": "BRCA2",
"dbsnp": "rs80359603",
"zygosity": "Heterozygote",
"aa_change": "p.Ala2185Leufs*6",
"dna_change": "c.6553del",
"pathogenicity": "pathogenic variation"
}
]
}
How to use
Environment
python = "^3.10"
peft = "^0.13.2"
trl = "^0.12.1"
vllm = "^0.8.3"
gunicorn = "^21.2.0"
packaging = "^24.0"
ninja = "^1.11.1.1"
fastapi = "^0.115.12"
uvicorn = {extras = ["standard"], version = "^0.34.0"}
Inference with vLLM
- Serving
python -m vllm.entrypoints.openai.api_server \
--model meta-llama/Meta-Llama-3-8B \
--adapter-path techlab-khc/Llama-laboratory-brca \
--gpu-memory-utilization 0.9
- Request
import requests
prompt = '''
{report text}
'''
response = requests.post(
"http://localhost:8000/v1/completions",
headers={"Content-Type": "application/json"},
json={
"model": "meta-llama/Meta-Llama-3-8B",
"prompt": prompt,
"max_tokens": 1000,
"temperature": 0.0
}
)
print(response.json()["choices"][0]["text"])
License
- Base Model: Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright ยฉ Meta Platforms, Inc. All Rights Reserved.
- Adapter: Inherits the terms of the base model.
- Permitted Use: Research and non-commercial use only.
- Prohibited Use: Commercial use of any kind is not allowed. By using this adapter, you agree to be bound by the Llama 3.1 community License Agreement
Disclaimer
- This adapter is intended for research purposes only.
- Any clinical or diagnostic decision should be made by qualified professionals. Outputs are for reference, not for direct medical or clinical application.
Contact
For questions, bug reports, or collaboration, please open an issue in this repository.
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for techlab-khc/Llama-laboratory-brca
Base model
meta-llama/Llama-3.1-8BCollection including techlab-khc/Llama-laboratory-brca
Collection
2 items โข Updated