pyBioMedLink
pyBioMedLink is an open-source python library for bio-medical term linking.
Usage
Use Case 1 for BioDomain Linking using Qwen3
corpus = [
"Epigenetic",
"DNA Repair",
"Metal Binding and Homeostasis"
"Synapse",
"Immune System",
"Cell Cycle",
"Lipid Metabolism",
"Vasculature",
]
query = "aging"
linker = Qwen3PromptLinker(
corpus,
model_name="Qwen/Qwen3-0.6B"
)
top_k = 3
predictions = linker.predict_aux(query, top_k)
print(f"Predictions for query '{query}': {predictions}")
# {'labels': ['Cell Cycle', 'DNA Repair', 'Epigenetic'], "thinking_content": ..., "content": ..., "error_msg": ...}
Use Case 2 for IR baselines
from pybiomedlink.linker import BM25Linker
corpus = [
"Hello there good man!",
"It is quite windy in London",
"How is the weather today?"
]
query = "windy London"
bm25_linker = BM25Linker(corpus)
top_k = 2
predictions = bm25_linker.predict(query, top_k)
print(f"Predictions for query '{query}': {predictions}")
# ['It is quite windy in London', 'How is the weather today?']
pred_score_results = bm25_linker.predict_aux(query, top_k)
print(f"Predictions with scores for query '{query}': {pred_score_results}")
# {'labels': ['It is quite windy in London', 'How is the weather today?', 'Hello there good man!'], 'scores': [0.9372947225064051, 0.0, 0.0]}
Supported Models
Zero-shot models:
- BM25Linker: A BM25-based linker
- LevenshteinLinker: A Levenshtein distance-based linker
- TransformerEmbLinker: A Transformer-based embedding linker
- Qwen3PromptLinker: A Qwen3-based prompt linker. Note: can only return a ranked list without scores.
How to run tests
To run the tests, you can use the following command:
uv run python -m pytest -v tests/
uv run python -m pytest -v -s tests/test_Transformer.py
Metadata
Release files for pyBioMedLink 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pybiomedlink-0.2.1.tar.gz | 13.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybiomedlink-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.9 kB
Release files / pybiomedlink-0.2.1.tar.gz
| Download URL | pybiomedlink-0.2.1.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d8df138dc44df0addaf63f7c6d0ad8e76a312d462a38bbce677a439f82a69b66
|
|
BLAKE2b-256 checksum How to use checksums |
f3d13047563f641abc0d383f2b25e655e9f89b9aacd7959d90990ade251ad032
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.0
|
Release files / pybiomedlink-0.2.1-py3-none-any.whl
| Download URL | pybiomedlink-0.2.1-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
590737414cdbabc176aafa7d290639c9bf7a02b279ec976893d567f19615e2bc
|
|
BLAKE2b-256 checksum How to use checksums |
72609b40d241ed3b73b9cb8794b5746ea89d46611d9c807165643af1bf1c9c10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.0
|
Security for pyBioMedLink 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.