Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core structure updates: image and text featurizer #172

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Prev Previous commit
Next Next commit
task template
  • Loading branch information
zzachw committed Jun 14, 2023
commit ba0898b5606882e8284fe8c7bafe27d621fb4929
3 changes: 3 additions & 0 deletions pyhealth/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .task_template import TaskTemplate
from .drug_recommendation import (
drug_recommendation_eicu_fn,
drug_recommendation_mimic3_fn,
Expand Down Expand Up @@ -29,3 +30,5 @@
sleep_staging_isruc_fn,
sleep_staging_shhs_fn,
)
from .covid19_cxr_classification import COVID19CXRClassification
from .medical_transcriptions_classification import MedicalTranscriptionsClassification
14 changes: 14 additions & 0 deletions pyhealth/tasks/task_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Dict, List


@dataclass(frozen=True)
class TaskTemplate(ABC):
task_name: str
input_schema: Dict[str, str]
output_schema: Dict[str, str]

@abstractmethod
def __call__(self, patient) -> List[Dict]:
raise NotImplementedError