-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade dependencies and retrain models
- Loading branch information
Showing
15 changed files
with
183 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
#!/bin/bash | ||
#@meta {desc: 'build production models from scratch', date: '2024-04-11'} | ||
|
||
# before starting, make sure to increment: | ||
# - resources/default.conf msid_model:version | ||
# - dist-resources/app.conf deeplearn_model_packer:version | ||
|
||
./src/bin/preprocess.sh && \ | ||
cp config/system.conf config/system-sensitive-data.conf && \ | ||
cat /dev/null > config/system.conf && \ | ||
./src/bin/package.sh && \ | ||
./dist summary -c config/glove300.conf --validation -o stage/model-performance.csv && \ | ||
mv config/system-sensitive-data.conf config/system.conf | ||
./src/bin/package.sh > package.log && \ | ||
mv config/system-sensitive-data.conf config/system.conf && \ | ||
mv package.log stage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python | ||
|
||
from typing import Iterable, Dict | ||
from dataclasses import dataclass, field | ||
import sys | ||
import re | ||
from pathlib import Path | ||
from io import TextIOBase | ||
import pandas as pd | ||
from tabulate import tabulate | ||
from zensols.config import Dictable | ||
|
||
|
||
@dataclass | ||
class ResultSummarizer(Dictable): | ||
result_path: Path = field() | ||
|
||
def _to_readme_dataframe(self, df: pd.DataFrame) -> pd.DataFrame: | ||
type_re: re.Pattern = re.compile( | ||
r'^(.+) (Header|Section)(?: Type)?: 1$') | ||
cols: Dict[str, str] = { | ||
'name': 'Name', | ||
'type': 'Type', | ||
'resid': 'Id', | ||
'wF1v': 'wF1', | ||
'mF1v': 'mF1', | ||
'MF1v': 'MF1', | ||
'accv': 'acc' | ||
} | ||
for col in 'wF1v mF1v MF1v accv'.split(): | ||
df[col] = df[col].round(3) | ||
df['resid'] = df['resid'].apply( | ||
lambda s: re.sub(r'^(.+)-1$', r'\1', s)) | ||
#type_ser: pd.Series = df['name'].apply( | ||
df['type'] = df['name'].apply( | ||
lambda s: re.sub(type_re, r'\2', s)) | ||
df['name'] = df['name'].apply( | ||
lambda s: re.sub(type_re, r"`\1`", s)) | ||
#df.insert(0, 'type', type_ser) | ||
df = df.sort_values('type name'.split(), ascending=False) | ||
df = df[list(cols.keys())] | ||
df = df.rename(columns=cols) | ||
return df | ||
|
||
def _to_readme_table(self, df: pd.DataFrame) -> str: | ||
tab: str = tabulate( | ||
df, | ||
headers=df.columns, | ||
tablefmt='orgtbl', | ||
showindex=False) | ||
return tab.replace('+', '|') | ||
|
||
def write(self, depth: int = 0, writer: TextIOBase = sys.stdout): | ||
res_paths: Iterable[Path] = filter( | ||
lambda p: p.suffix == '.csv', self.result_path.iterdir()) | ||
for path in res_paths: | ||
df: pd.DataFrame = pd.read_csv(path, index_col=0) | ||
df = self._to_readme_dataframe(df) | ||
self._write_line(f'{path}:', depth, writer) | ||
self._write_block(self._to_readme_table(df), depth, writer) | ||
self._write_divider(depth, writer) | ||
|
||
|
||
def main(): | ||
summarizer = ResultSummarizer(Path('stage')) | ||
summarizer.write() | ||
|
||
|
||
if (__name__ == '__main__'): | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: mimicsid | ||
channels: | ||
- defaults | ||
dependencies: | ||
- python==3.11.11 | ||
- numpy==1.25.2 | ||
- nmslib==2.1.1 | ||
- pip | ||
- pip: | ||
## third party | ||
- torch==2.1.2 | ||
- transformers~=4.48.1 | ||
## framework | ||
- zensols.util==1.15.1 | ||
- zensols.nlp==1.12.1 | ||
- zensols.dbpg==1.4.0 | ||
# deep learning | ||
- zensols.deeplearn==1.13.3 | ||
- zensols.deepnlp==1.17.1 | ||
# clinical | ||
- zensols.mednlp~=1.8.0 | ||
- zensols.mimic==1.8.0 | ||
## models | ||
- https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.6.0/en_core_web_sm-3.6.0-py3-none-any.whl | ||
- https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.6.0/en_core_web_md-3.6.0-py3-none-any.whl | ||
- https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.3/en_core_sci_md-0.5.3.tar.gz | ||
- https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.3/en_ner_bionlp13cg_md-0.5.3.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
zensols.deepnlp~=1.15.0 | ||
zensols.deepnlp~=1.17.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
zensols.dbpg~=1.4.0 | ||
zensols.deepnlp~=1.17.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
zensols.deeplearn~=1.13.0 | ||
zensols.mednlp~=1.8.0 | ||
zensols.mimic~=1.8.0 | ||
zensols.deeplearn==1.13.3 | ||
zensols.mimic==1.8.0 |
Submodule zenbuild
updated
32 files
+0 −117 | bin/betterbibdb.py | |
+74 −0 | bin/chlogutil.py | |
+0 −44 | bin/pybuildinstall.sh | |
+0 −6 | bin/requirements.txt | |
+0 −186 | src/emacs/zb-org-mode.el | |
+20 −28 | src/mk/elisp.mk | |
+11 −1 | src/mk/git.mk | |
+21 −21 | src/mk/orgmode-publish.mk | |
+6 −2 | src/mk/python.mk | |
+15 −3 | src/mk/tex-bibstract.mk | |
+25 −8 | src/mk/tex.mk | |
+0 −2 | src/proj/elisp.mk | |
+8 −0 | src/proj/tex.mk | |
+0 −193 | src/sty/zenacademic.sty | |
+0 −43 | src/sty/zenacl.sty | |
+0 −330 | src/sty/zenacro.sty | |
+0 −132 | src/sty/zenfig.sty | |
+0 −63 | src/sty/zenhref.sty | |
+0 −123 | src/sty/zenletter.sty | |
+0 −95 | src/sty/zenlist.sty | |
+0 −86 | src/sty/zenlisting.sty | |
+0 −273 | src/sty/zenmath.sty | |
+0 −119 | src/sty/zennlp.sty | |
+0 −9 | src/sty/zennohref.sty | |
+0 −121 | src/sty/zenposter.sty | |
+0 −21 | src/sty/zenpronoun.sty | |
+0 −116 | src/sty/zenreport.sty | |
+0 −69 | src/sty/zensec.sty | |
+0 −226 | src/sty/zenslides.sty | |
+0 −255 | src/sty/zentable.sty | |
+0 −81 | src/sty/zentacl.sty | |
+0 −118 | src/sty/zenunfloat.sty |