cehrbert 1.3.0__tar.gz → 1.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cehrbert-1.3.0 → cehrbert-1.3.2}/PKG-INFO +2 -2
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/evaluation.py +3 -2
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/evaluation_parse_args.py +2 -2
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/runners/hf_cehrbert_finetune_runner.py +10 -6
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert.egg-info/PKG-INFO +2 -2
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/integration_tests/runners/hf_cehrbert_pretrain_runner_test.py +37 -8
- {cehrbert-1.3.0 → cehrbert-1.3.2}/.github/workflows/python-build.yml +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/.github/workflows/tests.yml +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/.gitignore +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/.pre-commit-config.yaml +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/LICENSE +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/README.md +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/db_properties.ini +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/deepspeed_configs/zero1.json +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/deepspeed_configs/zero2.json +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/deepspeed_configs/zero3.json +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/full_grid_search_config.ini +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/images/cehr_bert_architecture.png +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/images/tokenization_att_generation.png +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/pyproject.toml +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/sample_configs/hf_cehrbert_finetuning_runner_config.yaml +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/sample_configs/hf_cehrbert_pretrain_runner_config.yaml +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/sample_configs/hf_cehrbert_pretrain_runner_meds_config.yaml +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/sample_data/finetune/full/fake_data.parquet +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/sample_data/finetune/test/fake_data.parquet +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/sample_data/finetune/train/fake_data.parquet +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/sample_data/pretrain/patient_sequence.parquet +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/setup.cfg +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/simple_grid_search_config.ini +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/config/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/config/grid_search_config.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/config/output_names.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/data_classes.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/data_generator_base.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/graph_sample_method.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/hf_dataset.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/hf_dataset_collator.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/hf_dataset_mapping.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/meds_to_cehrbert_conversion_rules/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/meds_to_cehrbert_conversion_rules/meds_to_cehrbert_base.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/meds_to_cehrbert_conversion_rules/meds_to_cehrbert_micmic4.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/meds_to_cehrbert_conversion_rules/meds_to_cehrbert_omop.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/meds_utils.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/patient_block.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/learning_objective.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/tokenizer.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/evaluation_parameters.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/model_evaluators/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/model_evaluators/bert_model_evaluators.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/model_evaluators/frequency_model_evaluators.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/model_evaluators/hierarchical_bert_evaluators.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/model_evaluators/model_evaluators.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/model_evaluators/sequence_model_evaluators.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/transfer_learning_evaluation.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/keras_transformer/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/keras_transformer/bert.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/keras_transformer/extras.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/keras_transformer/position.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/med_extension/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/med_extension/schema_extension.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/bert_models.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/bert_models_visit_prediction.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/evaluation_models.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/hf_models/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/hf_models/config.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/hf_models/hf_cehrbert.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/hf_models/hf_modeling_outputs.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/hf_models/tokenization_hf_cehrbert.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/hf_models/tokenization_utils.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/hierachical_bert_model_v2.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/hierachical_phenotype_model_new.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/layers/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/layers/custom_layers.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/layers/hierarchical_custom_layers.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/loss_schedulers.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/models/parse_args.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/runners/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/runners/hf_cehrbert_pretrain_runner.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/runners/hf_runner_argument_dataclass.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/runners/runner_util.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/tools/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/tools/download_omop_tables.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/trainers/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/trainers/model_trainer.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/trainers/train_cehr_bert.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/utils/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/utils/checkpoint_utils.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/utils/logging_utils.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/utils/model_utils.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/utils/stat_utils.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert.egg-info/SOURCES.txt +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert.egg-info/dependency_links.txt +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert.egg-info/entry_points.txt +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert.egg-info/requires.txt +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert.egg-info/top_level.txt +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/integration_tests/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/integration_tests/runners/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/integration_tests/runners/hf_cehrbert_pretrain_runner_streaming_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/integration_tests/trainers/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/integration_tests/trainers/train_cehr_bert_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/bert_masked_language_modeling_learning_objective_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/hf_data_generator/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/hf_data_generator/hf_generate_start_end_index_mapping_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/hf_data_generator/hf_masked_language_modeling_mapping_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/hf_data_generator/hf_med_to_cehrbert_mapping_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/hf_data_generator/hf_sort_patient_sequence_dataset_mapping_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/hf_data_generator/meds_utils_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/hf_data_generator/omop_meds_generate_demographics_and_patient_blocks_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/visit_prediction_learning_objective_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/models/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/models/concept_value_decoder_layer_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/models/hf_models/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/models/hf_models/hf_cehrbert_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/models/hf_models/numeric_concept_statistics_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/models/hf_models/tokenization_hf_cehrbert_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/utils/__init__.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/utils/truncated_offline_statistics_test.py +0 -0
- {cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/utils/truncated_online_statistics_test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: cehrbert
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.2
|
|
4
4
|
Summary: CEHR-BERT: Incorporating temporal information from structured EHR data to improve prediction tasks
|
|
5
5
|
Author-email: Chao Pang <chaopang229@gmail.com>, Xinzhuo Jiang <xj2193@cumc.columbia.edu>, Krishna Kalluri <kk3326@cumc.columbia.edu>, Nishanth Parameshwar Pavinkurve <np2689@cumc.columbia.edu>, Karthik Natarajan <kn2174@cumc.columbia.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -318,8 +318,9 @@ def evaluate_baseline_models(args):
|
|
|
318
318
|
# Load the training data
|
|
319
319
|
dataset = pd.read_parquet(args.data_path)
|
|
320
320
|
test_person_ids = None
|
|
321
|
-
if args.
|
|
322
|
-
|
|
321
|
+
if args.patient_splits_folder:
|
|
322
|
+
patient_splits = pd.read_parquet(args.patient_splits_folder)
|
|
323
|
+
test_person_ids = patient_splits[patient_splits.split == "test"]
|
|
323
324
|
|
|
324
325
|
LogisticRegressionModelEvaluator(
|
|
325
326
|
dataset=dataset,
|
|
@@ -43,8 +43,8 @@ def create_evaluation_args():
|
|
|
43
43
|
required=baseline_model_required,
|
|
44
44
|
)
|
|
45
45
|
main_parser.add_argument(
|
|
46
|
-
"--
|
|
47
|
-
dest="
|
|
46
|
+
"--patient_splits_folder",
|
|
47
|
+
dest="patient_splits_folder",
|
|
48
48
|
action="store",
|
|
49
49
|
help="The test person_ids data",
|
|
50
50
|
required=False,
|
|
@@ -346,11 +346,15 @@ def do_predict(test_dataloader: DataLoader, model_args: ModelArguments, training
|
|
|
346
346
|
with torch.no_grad():
|
|
347
347
|
for index, batch in enumerate(tqdm(test_dataloader, desc="Predicting")):
|
|
348
348
|
person_ids = batch.pop("person_id").numpy().squeeze().astype(int)
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
349
|
+
# Extract and process index_dates
|
|
350
|
+
index_dates = None
|
|
351
|
+
if "index_date" in batch:
|
|
352
|
+
try:
|
|
353
|
+
timestamps = batch.pop("index_date").numpy().squeeze().tolist()
|
|
354
|
+
# Handle potential NaN or invalid timestamps
|
|
355
|
+
index_dates = [datetime.fromtimestamp(ts) if not np.isnan(ts) else None for ts in timestamps]
|
|
356
|
+
except (ValueError, OverflowError, TypeError):
|
|
357
|
+
index_dates = [None] * len(timestamps)
|
|
354
358
|
batch = {k: v.to(device) for k, v in batch.items()}
|
|
355
359
|
# Forward pass
|
|
356
360
|
output = model(**batch, output_attentions=False, output_hidden_states=False)
|
|
@@ -377,7 +381,7 @@ def do_predict(test_dataloader: DataLoader, model_args: ModelArguments, training
|
|
|
377
381
|
test_prediction_pd = pd.read_parquet(test_prediction_folder)
|
|
378
382
|
# Compute metrics and save results
|
|
379
383
|
metrics = compute_metrics(
|
|
380
|
-
references=test_prediction_pd.boolean_value, probs=test_prediction_pd.
|
|
384
|
+
references=test_prediction_pd.boolean_value, probs=test_prediction_pd.predicted_boolean_probability
|
|
381
385
|
)
|
|
382
386
|
metrics["test_loss"] = np.mean(test_losses)
|
|
383
387
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: cehrbert
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.2
|
|
4
4
|
Summary: CEHR-BERT: Incorporating temporal information from structured EHR data to improve prediction tasks
|
|
5
5
|
Author-email: Chao Pang <chaopang229@gmail.com>, Xinzhuo Jiang <xj2193@cumc.columbia.edu>, Krishna Kalluri <kk3326@cumc.columbia.edu>, Nishanth Parameshwar Pavinkurve <np2689@cumc.columbia.edu>, Karthik Natarajan <kn2174@cumc.columbia.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -7,6 +7,7 @@ from pathlib import Path
|
|
|
7
7
|
|
|
8
8
|
from datasets import disable_caching
|
|
9
9
|
|
|
10
|
+
from cehrbert.runners.hf_cehrbert_finetune_runner import main as finetune_main
|
|
10
11
|
from cehrbert.runners.hf_cehrbert_pretrain_runner import main
|
|
11
12
|
|
|
12
13
|
disable_caching()
|
|
@@ -19,13 +20,21 @@ class HfCehrBertRunnerIntegrationTest(unittest.TestCase):
|
|
|
19
20
|
def setUp(self):
|
|
20
21
|
# Get the root folder of the project
|
|
21
22
|
root_folder = Path(os.path.abspath(__file__)).parent.parent.parent.parent
|
|
22
|
-
|
|
23
|
+
self.pretrain_data_folder = os.path.join(root_folder, "sample_data", "pretrain")
|
|
24
|
+
self.finetune_data_folder = os.path.join(root_folder, "sample_data", "finetune", "full")
|
|
23
25
|
# Create a temporary directory to store model and tokenizer
|
|
24
26
|
self.temp_dir = tempfile.mkdtemp()
|
|
25
27
|
self.model_folder_path = os.path.join(self.temp_dir, "model")
|
|
28
|
+
self.finetuned_model_folder_path = os.path.join(self.temp_dir, "model_finetuned")
|
|
26
29
|
Path(self.model_folder_path).mkdir(parents=True, exist_ok=True)
|
|
27
30
|
self.dataset_prepared_path = os.path.join(self.temp_dir, "dataset_prepared_path")
|
|
28
31
|
Path(self.dataset_prepared_path).mkdir(parents=True, exist_ok=True)
|
|
32
|
+
|
|
33
|
+
def tearDown(self):
|
|
34
|
+
# Remove the temporary directory
|
|
35
|
+
shutil.rmtree(self.temp_dir)
|
|
36
|
+
|
|
37
|
+
def test_train_model(self):
|
|
29
38
|
sys.argv = [
|
|
30
39
|
"hf_cehrbert_pretraining_runner.py",
|
|
31
40
|
"--model_name_or_path",
|
|
@@ -35,19 +44,39 @@ class HfCehrBertRunnerIntegrationTest(unittest.TestCase):
|
|
|
35
44
|
"--output_dir",
|
|
36
45
|
self.model_folder_path,
|
|
37
46
|
"--data_folder",
|
|
38
|
-
|
|
47
|
+
self.pretrain_data_folder,
|
|
39
48
|
"--dataset_prepared_path",
|
|
40
49
|
self.dataset_prepared_path,
|
|
41
50
|
"--max_steps",
|
|
42
51
|
"10",
|
|
43
52
|
]
|
|
44
|
-
|
|
45
|
-
def tearDown(self):
|
|
46
|
-
# Remove the temporary directory
|
|
47
|
-
shutil.rmtree(self.temp_dir)
|
|
48
|
-
|
|
49
|
-
def test_train_model(self):
|
|
50
53
|
main()
|
|
54
|
+
sys.argv = [
|
|
55
|
+
"hf_cehrbert_finetune_runner.py",
|
|
56
|
+
"--model_name_or_path",
|
|
57
|
+
self.model_folder_path,
|
|
58
|
+
"--tokenizer_name_or_path",
|
|
59
|
+
self.model_folder_path,
|
|
60
|
+
"--output_dir",
|
|
61
|
+
self.finetuned_model_folder_path,
|
|
62
|
+
"--data_folder",
|
|
63
|
+
self.finetune_data_folder,
|
|
64
|
+
"--dataset_prepared_path",
|
|
65
|
+
self.dataset_prepared_path,
|
|
66
|
+
"--max_steps",
|
|
67
|
+
"10",
|
|
68
|
+
"--save_strategy",
|
|
69
|
+
"steps",
|
|
70
|
+
"--evaluation_strategy",
|
|
71
|
+
"steps",
|
|
72
|
+
"--do_train",
|
|
73
|
+
"true",
|
|
74
|
+
"--do_predict",
|
|
75
|
+
"true",
|
|
76
|
+
"--load_best_model_at_end",
|
|
77
|
+
"true",
|
|
78
|
+
]
|
|
79
|
+
finetune_main()
|
|
51
80
|
|
|
52
81
|
|
|
53
82
|
if __name__ == "__main__":
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/sample_configs/hf_cehrbert_pretrain_runner_meds_config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/__init__.py
RENAMED
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/hf_dataset.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/meds_utils.py
RENAMED
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/data_generators/hf_data_generator/patient_block.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/model_evaluators/bert_model_evaluators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/src/cehrbert/evaluations/model_evaluators/model_evaluators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/data_generators/hf_data_generator/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/models/concept_value_decoder_layer_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/models/hf_models/tokenization_hf_cehrbert_test.py
RENAMED
|
File without changes
|
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/utils/truncated_offline_statistics_test.py
RENAMED
|
File without changes
|
{cehrbert-1.3.0 → cehrbert-1.3.2}/tests/unit_tests/utils/truncated_online_statistics_test.py
RENAMED
|
File without changes
|