A robust Julia package for medical named entity recognition (NER) using spaCy models. MediSeven.jl provides state-of-the-art extraction of medical entities like drugs, dosages, frequencies, and routes from clinical text.
using Pkg
Pkg.add("MediSeven")
Or from the Julia REPL:
] add MediSeven
using MediSeven
# Load model (automatic fallback if primary model fails)
model = load_model()
# Process single text
doc = model("Take 500mg paracetamol every 6 hours for pain")
println("Entities found: $(length(doc.ents))")
# Process batch
texts = [
"Administer 40mg lisinopril daily",
"Apply 0.1% tacrolimus ointment BID"
]
docs = model(texts)
# Default loading with fallbacks
model = load_model()
# Specify model and batch size
model = load_model(model_name="kormilitzin/en_core_med7_lg", batch_size=16)
# Disable fallbacks (strict mode)
model = load_model(model_name="my_model", use_fallback=false)
# Single text
doc = process!(text, model)
# or
doc = model(text)
# Batch processing
docs = process!(texts, model)
# or
docs = model(texts)
for entity in doc.ents
println("$(entity.label): '$(entity.text)' at $(entity.start):$(entity.stop)")
end
MediSeven.jl automatically tries multiple spaCy models in order of preference:
kormilitzin/en_core_med7_lg (primary) en_core_med7_lg en_core_web_sm en_core_web_md en_core_web_lg
git clone https://github.com/liyakhathshaik/MediSeven.jl.git
cd MediSeven.jl
julia --project=. -e "using Pkg; Pkg.instantiate()"
julia --project=. -e "using Pkg; Pkg.test()"
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
This package is a Julia port of the original Med7 Python package by Andrey Kormilitzin et al., which is licensed under the Apache License 2.0.
Copyright 2020 Andrey Kormilitzin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@software{mediseven_jl,
title = {MediSeven.jl: Medical Named Entity Recognition for Julia},
author = {Liyakhath Shaik},
year = {2025},
url = {https://github.com/liyakhathshaik/MediSeven.jl},
note = {Julia port of Med7 Python package by Andrey Kormilitzin et al.}
}