Skip to content

Commit

Permalink
⬆️ bump medcat==1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferajiang committed Apr 21, 2023
1 parent f09d900 commit 03be084
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 28 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
branches:
- master

env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True

jobs:
Test:
runs-on: ubuntu-20.04
Expand All @@ -29,6 +26,6 @@ jobs:
- name: download model
run: |
python -m spacy download en_core_web_md
pip install https://huggingface.co/kormilitzin/en_core_med7_lg/resolve/9633b53e7f9488408eae5dfff51b831b3b787657/en_core_med7_lg-any-py3-none-any.whl
pip install https://huggingface.co/kormilitzin/en_core_med7_lg/resolve/main/en_core_med7_lg-any-py3-none-any.whl
- name: run pytest
run: pytest ./tests/*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ADD ./notebooks/ /home/notebooks
WORKDIR /home/app

RUN python -m pip install --upgrade pip
RUN pip install https://huggingface.co/kormilitzin/en_core_med7_lg/resolve/9633b53e7f9488408eae5dfff51b831b3b787657/en_core_med7_lg-any-py3-none-any.whl
RUN pip install /home/

RUN pip install https://huggingface.co/kormilitzin/en_core_med7_lg/resolve/main/en_core_med7_lg-any-py3-none-any.whl
RUN python -m spacy download en_core_web_md
52 changes: 34 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
[build-system]
requires = [
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
]
build-backend = "setuptools.build_meta"

[project]
name = "miade"
authors = [
{name = "James Brandreth", email = "[email protected]"},
{name = "Jennifer Jiang", email= "[email protected]"}
]
description = "A set of tools for extracting formattable data from clinical notes stored in electronic health record systems."
requires-python = ">=3.8"
dynamic = ["version"]
dependencies = [
"medcat==1.2.8",
"spacy==3.1.0",
"typing==3.7.4.3",
"pandas",
"typer==0.3.2",
"click==7.1.2",
"pathlib",
"pydantic",
"negspacy",
"scikit-learn",
"medcat==1.7.0",
"spacy>=3.4.2, <3.5.0", # need to be compatible with latest med7 model
"pandas<=1.5.3, <2", # pandas updated to 2.0.0 recently, should we update too?
"typer>=0.7.0",
'click>=8.0.4',
"pathlib>=1.0.1",
"pydantic>=1.10.0", # compatibility with spacy
"negspacy>=1.0.3",
]

[project.optional-dependencies]
dev = [
"pytest>=7.1.3",
"jupyterlab>=3.4.7",
"black>=22.12.0",
]
dashboard = [
"streamlit>=1.20.0",
"streamlit-aggrid>=0.3.4.post3",
"spacy-streamlit>=1.0.5",
"seaborn>=0.12.2",
]

[project.scripts]
Expand All @@ -28,11 +52,3 @@ where = ["src"]

[tool.setuptools.package-data]
miade = ["data/*.csv"]

[build-system]
requires = [
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
]
build-backend = "setuptools.build_meta"

8 changes: 4 additions & 4 deletions src/miade/model_builders/cdbbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ def preprocess_custom(self, output_dir: Path = Path.cwd()) -> Path:
def preprocess(self):
self.vocab_files = []
if self.snomed:
self.vocab_files.append(self.preprocess_snomed(self.temp_dir))
self.vocab_files.append(str(self.preprocess_snomed(self.temp_dir)))
if self.fdb_data_path:
self.vocab_files.append(self.preprocess_fdb(self.temp_dir))
self.vocab_files.append(str(self.preprocess_fdb(self.temp_dir)))
if self.elg_data_path:
self.vocab_files.append(self.preprocess_elg(self.temp_dir))
self.vocab_files.append(str(self.preprocess_elg(self.temp_dir)))
if self.custom_data_paths:
self.vocab_files += self.custom_data_paths
self.vocab_files += str(self.custom_data_paths)

def create_cdb(self) -> CDB:
cdb = self.maker.prepare_csvs(self.vocab_files, full_build=True)
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/common_doses_for_miade.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Clobetasone 0.05% cream,Apply Thinly Once Or Twice A Day,,,,,0.5,d,TRUE,FALSE,
Adapalene 0.1% gel,"Apply Thinly At Night,45 gram",,,,g,1,d,FALSE,FALSE,
Amoxicillin 500mg capsules,"One To Be Taken Three Times A Day,21 capsule",1,,,{cap},0.333333333333333,d,TRUE,FALSE,7
ViATIM vaccine suspension for injection 1ml pre-filled syringes (Sanofi Pasteur),"Immediately,1 pre-filled disposable injection",1,,,{injection},,,,,1
Amitriptyline 10mg tablets,"take one at night, building gradually to five at night,56 tablet",5,,,{tbl},1,d,FALSE,FALSE,
Amitriptyline 10mg tablets,"take one at night, building gradually to five at night,56 tablet",1,,,{tbl},1,d,FALSE,FALSE,
Propranolol 40mg tablets,"One To Be Taken Twice A Day,2 x 28 tablet",1,,,{tbl},0.5,d,TRUE,FALSE,28
Sumatriptan 10mg/0.1ml nasal spray unit dose,"one spray as directed,2 x 2 unit dose",1,,,{unit},,,,,
Phenoxymethylpenicillin 250mg tablets,"TAKE TWO TABLETS EVERY SIX HOURS FOR SEVEN DAYS,64 tablet",2,,,{tbl},6,h,FALSE,FALSE,7
Expand Down

0 comments on commit 03be084

Please sign in to comment.