Skip to content

Commit 45c6fed

Browse files
authored
CU-869anj8ub: Add initial commit of WWC conversion (#153)
* CU-869anj8ub: Add initial commit of WWC conversion * CU-869anj8ub: Update dependency for medcat-den. Use PyPI version * CU-869anj8ub: Update permissions for workflow (minimal) * CU-869anj8ub: Update dependency to medcat 2.2 * CU-869anj8ub: Update workflow to drop 3.9 and add 3.13 * CU-869anj8ub: Fix most typing issues * CU-869anj8ub: Add dunder init files for test folders * CU-869anj8ub: Add CAT-included tests for MCT analysis * CU-869anj8ub: Fix CAT-included tests for MCT analysis * CU-869anj8ub: Remove accidental line * CU-869anj8ub: Fix conditionals in mct export * CU-869anj8ub: Simplify meta-cat eval by using built in method (kind of) * CU-869anj8ub: Small typos in comments * CU-869anj8ub: Force testing against current version of MedCAT on CI * CU-869anj8ub: Install based on latest state without editable flag * CU-869anj8ub: Add simple README * CU-869anj8ub: Add example data for MetaCAT training * CU-869anj8ub: Add meta-annotation training * CU-869anj8ub: Fix issue with category mapping * CU-869anj8ub: Simplfiy alternative category names somewhat * CU-869anj8ub: Fix trainer export passing to MetaCAT train method * CU-869anj8ub: Remove 3rd class from example * CU-869anj8ub: Fix category name issue * CU-869anj8ub: Fix example for meta-cat on its own * CU-869anj8ub: Fix save dir path for meta cat * CU-869anj8ub: Avoid running less supported MetaCAT-only workflow
1 parent 331fa61 commit 45c6fed

File tree

19 files changed

+4275
-0
lines changed

19 files changed

+4275
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: medcat-scripts - Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
paths:
8+
- 'medcat-scripts/**'
9+
- '.github/workflows/medcat-scripts**'
10+
11+
defaults:
12+
run:
13+
working-directory: ./medcat-scripts
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
strategy:
21+
matrix:
22+
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
23+
max-parallel: 4
24+
steps:
25+
- uses: actions/checkout@v5
26+
- name: Install uv for Python ${{ matrix.python-version }}
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
enable-cache: true
31+
- name: Install the project
32+
run: |
33+
uv venv .venv
34+
source .venv/bin/activate
35+
uv run python -m ensurepip
36+
uv pip install -r requirements.txt
37+
uv pip install -r requirements-dev.txt
38+
# reinstall MedCAT from local to test against changes in core lib
39+
uv pip install "../medcat-v2[spacy,deid,meta-cat,rel-cat]"
40+
- name: Check types
41+
run: |
42+
# NOTE: Only testing against .py files in this folder
43+
uv run python -m mypy `git ls-tree --full-tree --name-only -r HEAD | grep ".py$" | grep "^medcat-scripts" | grep -v "tests/" | sed 's|^medcat-scripts/||'` --explicit-package-bases --follow-imports=normal
44+
45+
- name: Setup for notebook tests
46+
run: |
47+
# NOTE: this will make sure there's something in the den to work with below
48+
uv run python tests/setup_for_tests.py
49+
50+
- name: Install IPython kernel
51+
run: |
52+
uv run python -m ipykernel install --name smoketests --user
53+
54+
- name: Run tests
55+
run: |
56+
uv run pytest tests
57+
58+
- name: Test notebooks
59+
run: |
60+
uv run pytest --collect-only --nbmake **/*.ipynb
61+
uv run pytest --nbmake -n=auto --nbmake-kernel=smoketests --nbmake-timeout=1800 **/*.ipynb

medcat-scripts/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# medcat-scripts
2+
3+
This project contains the relevant tools and notebooks to help users work with MedCAT models.
4+
This includes instructions on finetuning models in an unsupervised or supervised manner as well as evaluating MedCATtrainer exports and run models on data.
5+
6+
# Setup
7+
8+
To gain access to these scripts you simply:
9+
```
10+
git clone https://github.com/CogStack/cogstack-nlp.git
11+
cd cogstack-nlp/medcat-scripts
12+
```
13+
You may subsequently need to install the relevant requirements
14+
```
15+
python -m pip install -r requirements.txt
16+
```

medcat-scripts/data/mct_exports/example_mct_export.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)