pyhealth.tasks.MedicalTranscriptionsClassification#

class pyhealth.tasks.medical_transcriptions_classification.MedicalTranscriptionsClassification(code_mapping=None)[source]#

Bases: BaseTask

Task for classifying medical transcriptions into medical specialties.

This task takes medical transcription text as input and predicts the corresponding medical specialty. It processes patient records containing mtsamples events and extracts transcription and medical specialty information.

task_name#

Name of the task

Type:

str

input_schema#

Schema defining input features

Type:

Dict[str, str]

output_schema#

Schema defining output features

Type:

Dict[str, str]

Examples

>>> from pyhealth.datasets import MedicalTranscriptionsDataset
>>> from pyhealth.tasks import MedicalTranscriptionsClassification
>>> dataset = MedicalTranscriptionsDataset(
...     root="/path/to/medical_transcriptions",
... )
>>> task = MedicalTranscriptionsClassification()
>>> samples = dataset.set_task(task)
task_name: str = 'MedicalTranscriptionsClassification'#
input_schema: Dict[str, str] = {'transcription': 'text'}#
output_schema: Dict[str, str] = {'medical_specialty': 'multiclass'}#
pre_filter(df)#
Return type:

LazyFrame