chest2vec_0.6B_kor
Chest radiology text embedding model for Korean and English reports:
Qwen/Qwen3-Embedding-0.6B contrastively LoRA-adapted for chest CT and
chest radiograph report retrieval. Embedding = left-padding-aware last-token (EOS) pooling + L2-norm. Embedding dim: 1024.
Korean version of chest2vec/chest2vec_0.6B, with the same architecture and interface.
No MIMIC data was used in training.
Self-contained AutoModel
The LoRA adapter is merged into the weights (model.safetensors) and the tokenizer is bundled, so loading needs no chest2vec
package and no download of the base Qwen3-Embedding weights:
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("lukeingawesome/chest2vec_0.6B_kor", trust_remote_code=True).eval()
tok = AutoTokenizer.from_pretrained("lukeingawesome/chest2vec_0.6B_kor", trust_remote_code=True)
docs = ["우상엽에 2.3 cm 크기의 침상 결절이 있으며 폐암이 의심됨.",
"Moderate right pleural effusion with passive atelectasis."]
doc_emb = model.embed_texts(docs, tokenizer=tok) # [N, 1024], L2-normalized
q_emb = model.embed_instruction_query(
"Retrieve the chest CT report that is similar to the given report.",
["우측 폐 상엽 결절"], tokenizer=tok)
vals, idx = model.cosine_topk(q_emb, doc_emb, k=2)
Korean and English reports share one embedding space, so a Korean query can retrieve an English report and the reverse.
Matryoshka embeddings
Trained with Matryoshka representation learning. Truncate to 512 or 256 dimensions (the first N dimensions, re-normalised):
emb512 = model.embed_texts(docs, tokenizer=tok, dim=512)
emb256 = model.embed_texts(docs, tokenizer=tok, dim=256)
Use the same dim for queries and corpus.
Instructions
Queries can be instruction-conditioned (Instruct: {instruction}\nQuery: {report}). Apply the instruction to the query side only and
embed the corpus without one, for example Retrieve the chest CT report that is similar to the given report. or
Retrieve the CXR report that is similar to the given report.
Training
| Base model | Qwen/Qwen3-Embedding-0.6B (revision c54f2e6e) |
| Method | LoRA (rank 16, alpha 32) on all attention and MLP projections, merged after training |
| Objective | multi-positive sigmoid contrastive loss with learned temperature and false-negative masking; Matryoshka dimensions 1024, 512 and 256 |
| Data | de-identified Korean and English chest CT and chest radiograph reports from a Korean hospital, and public report datasets other than MIMIC |
| Schedule | 1 epoch, 1,852,288 training examples, global batch 384, learning rate 1e-4, maximum length 1,024 tokens, bfloat16 |
Limitations
Trained on reports from one Korean hospital and public non-MIMIC report datasets. Retrieval quality on report styles, languages or institutions outside the training data has not been measured. The model produces embeddings only. It does not generate text or make diagnoses.
Licence
CC BY-NC 4.0 (non-commercial use). The base model, Qwen3-Embedding-0.6B, is released under Apache-2.0.