From 0b45825825fd46515728c349a7f8f0cdf8693bbd Mon Sep 17 00:00:00 2001 From: Jingyi Date: Fri, 26 Apr 2024 17:44:23 +0000 Subject: [PATCH 1/5] update Python SDK --- open_parser/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/open_parser/base.py b/open_parser/base.py index 23309ff..92b2045 100644 --- a/open_parser/base.py +++ b/open_parser/base.py @@ -26,7 +26,7 @@ def setAPIKey(self, apiKey): def extract(self, file_path): user_id, job_id, s3_key = self._request_and_upload_by_apiKey(file_path) result = self._request_file_extraction(user_id, job_id, s3_key) - return json.loads(result)["result"]["file_content"] + return json.loads(result)["result"] def parse(self, file_path, prompt, mode="advanced"): user_id, job_id, s3_key = self._request_and_upload_by_apiKey(file_path) @@ -85,7 +85,7 @@ def _request_info_extraction(self, user_id, job_id, s3_key, mode, prompt=""): "jobId": job_id, "fileKey": s3_key, "user_prompt": prompt, - "use_textract": True if mode == "advanced" else False, + "use_textract": "True" if mode == "advanced" else "False", } response = requests.post( self._parseurl, headers=self._request_header, json=payload From fb2f2205c47575cd4f6fa1dceb3103118354a72d Mon Sep 17 00:00:00 2001 From: Jingyi Date: Fri, 26 Apr 2024 17:54:15 +0000 Subject: [PATCH 2/5] update bash script --- extract_parse.sh | 2 +- open_parser_base.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extract_parse.sh b/extract_parse.sh index 786591c..46ac952 100644 --- a/extract_parse.sh +++ b/extract_parse.sh @@ -11,8 +11,8 @@ apiKey="$1" func="$2" file_path="$3" -upload if [ "$func" == "extract" ]; then + upload extract elif [ "$func" == "parse" ]; then prompt="$4" diff --git a/open_parser_base.sh b/open_parser_base.sh index a01ee58..4f1eeb7 100644 --- a/open_parser_base.sh +++ b/open_parser_base.sh @@ -67,7 +67,7 @@ extract() { -d "$payload" \ "$EXTRACT_URL") - result=$(echo "$response" | jq -r '.result.file_content') + result=$(echo "$response" | jq -r '.result') } parse() { From 230c520a0f9eead31c7c1f94bc01ca830a14976b Mon Sep 17 00:00:00 2001 From: Jingyi Date: Fri, 26 Apr 2024 18:01:24 +0000 Subject: [PATCH 3/5] fix textract type --- extract_parse.sh | 4 ++-- parse.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extract_parse.sh b/extract_parse.sh index 46ac952..28f6821 100644 --- a/extract_parse.sh +++ b/extract_parse.sh @@ -18,9 +18,9 @@ elif [ "$func" == "parse" ]; then prompt="$4" mode="$5" if [ -z "$mode" ] || [ "$mode" == "" ] || [ "$mode" == "advanced" ]; then - textract=true + textract="True" else - textract=false + textract="False" fi upload parse diff --git a/parse.sh b/parse.sh index c2b4e40..270b85c 100644 --- a/parse.sh +++ b/parse.sh @@ -10,7 +10,7 @@ fi apiKey="$1" file_path="$2" prompt="$3" -textract=false +textract="False" echo "Parsing $file_path..." From 31d86e98b758d3ec2c6d36385aa680334a0ea225 Mon Sep 17 00:00:00 2001 From: Jingyi Date: Mon, 29 Apr 2024 18:07:33 +0000 Subject: [PATCH 4/5] fix extract example --- ...extract_table_from_image_to_markdown.ipynb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/extract_table_from_image_to_markdown.ipynb b/examples/extract_table_from_image_to_markdown.ipynb index 0e35e3d..7f940ba 100644 --- a/examples/extract_table_from_image_to_markdown.ipynb +++ b/examples/extract_table_from_image_to_markdown.ipynb @@ -15,7 +15,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -85,7 +85,7 @@ "" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -106,7 +106,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -122,7 +122,7 @@ "text/markdown": [ "| Investor Metrics | FY23 Q1 | FY23 Q2 | FY23 Q3 | FY23 Q4 | FY24 Q1 |\n", "|:-------------------------------------------------------------------|:----------|:----------|:----------|:----------|:----------|\n", - "| Office Commercial products and cloud services revenue growth (y/y) | 7% / 13% | 7% / 14% | 13%/17% | 12% / 14% | 15% / 14% |\n", + "| Office Commercial products and cloud services revenue growth (y/y) | 7% / 13% | 7% / 14% | 13% / 17% | 12% / 14% | 15% / 14% |\n", "| Office Consumer products and cloud services revenue growth (y/y) | 7% / 11% | (2)% / 3% | 1% / 4% | 3% / 6% | 3% / 4% |\n", "| Office 365 Commercial seat growth (y/y) | 14% | 12% | 11% | 11% | 10% |\n", "| Microsoft 365 Consumer subscribers (in millions) | 65.1 | 67.7 | 70.8 | 74.9 | 76.7 |\n", @@ -143,7 +143,8 @@ "op = OpenParser(example_apikey)\n", "content_result = op.extract(example_local_file)\n", "\n", - "display(Markdown(content_result))\n" + "for content in content_result:\n", + " display(Markdown(content))\n" ] }, { @@ -176,7 +177,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.12.2" } }, "nbformat": 4, From 490c5f679df0e9aabd98cb783137577be994c779 Mon Sep 17 00:00:00 2001 From: Jingyi Date: Tue, 30 Apr 2024 01:29:48 +0000 Subject: [PATCH 5/5] comment parse output checker --- ...from_cbc_reports_in_different_layout.ipynb | 413 ++++++------------ 1 file changed, 128 insertions(+), 285 deletions(-) diff --git a/examples/extract_key_values_from_cbc_reports_in_different_layout.ipynb b/examples/extract_key_values_from_cbc_reports_in_different_layout.ipynb index e573076..fb94029 100644 --- a/examples/extract_key_values_from_cbc_reports_in_different_layout.ipynb +++ b/examples/extract_key_values_from_cbc_reports_in_different_layout.ipynb @@ -140,7 +140,7 @@ "metadata": {}, "outputs": [], "source": [ - "input_keys = ['NAME', 'HAEMOGLOBIN', 'RBC (RED CELLS COUNT)', 'HAEMATOCRIT(PCV)','MCV','MCH','MCHC','TOTAL LEUCOCYTE COUNT','DIFFERENTIAL LEUCOCYTE COUNT', 'NEUTROPHILS','LYMPHOCYTES','MONOCYTES', 'EOSINOPHILS', 'BASOPHIL', 'PROMYELOCYTES', 'MYELOCYTES', 'METAMYELOCYTES', 'BLASTS', 'PLATELETS', 'RETICULOCYTE COUNT']" + "input_keys = ['SCL NO', 'NAME', 'HAEMOGLOBIN', 'RBC (RED CELLS COUNT)', 'HAEMATOCRIT(PCV)','MCV','MCH','MCHC','TOTAL LEUCOCYTE COUNT','DIFFERENTIAL LEUCOCYTE COUNT', 'NEUTROPHILS','LYMPHOCYTES','MONOCYTES', 'EOSINOPHILS', 'BASOPHIL', 'PROMYELOCYTES', 'MYELOCYTES', 'METAMYELOCYTES', 'BLASTS', 'PLATELETS', 'RETICULOCYTE COUNT']" ] }, { @@ -159,7 +159,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "Upload response: 204\n", + "Upload response: 204\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "Extraction success.\n", "Upload response: 204\n", "Extraction success.\n", @@ -200,86 +206,95 @@ { "data": { "text/plain": [ - "[[[{'NAME': 'Test Patient A',\n", - " 'HAEMOGLOBIN': '12.6',\n", - " 'RBC (RED CELLS COUNT)': '4.54',\n", - " 'HAEMATOCRIT(PCV)': '38.1',\n", - " 'MCV': '83.9',\n", - " 'MCH': '27.8',\n", - " 'MCHC': '33.1',\n", - " 'TOTAL LEUCOCYTE COUNT': '4.62',\n", - " 'DIFFERENTIAL LEUCOCYTE COUNT': 'NA',\n", - " 'NEUTROPHILS': '66',\n", - " 'LYMPHOCYTES': '28',\n", - " 'MONOCYTES': '06',\n", - " 'EOSINOPHILS': '00',\n", - " 'BASOPHIL': '00',\n", - " 'PROMYELOCYTES': 'NA',\n", - " 'MYELOCYTES': 'NA',\n", - " 'METAMYELOCYTES': 'NA',\n", - " 'BLASTS': 'NA',\n", - " 'PLATELETS': '195',\n", - " 'RETICULOCYTE COUNT': 'NA'}]],\n", - " [[{'NAME': 'TEST PATIENT 12',\n", - " 'HAEMOGLOBIN': '12.8',\n", - " 'RBC (RED CELLS COUNT)': '4.5',\n", - " 'HAEMATOCRIT(PCV)': '42',\n", - " 'MCV': '93',\n", - " 'MCH': '28',\n", - " 'MCHC': '31',\n", - " 'TOTAL LEUCOCYTE COUNT': '12.6',\n", - " 'DIFFERENTIAL LEUCOCYTE COUNT': 'NA',\n", - " 'NEUTROPHILS': '67',\n", - " 'LYMPHOCYTES': '23',\n", - " 'MONOCYTES': '07',\n", - " 'EOSINOPHILS': '03',\n", - " 'BASOPHIL': '00',\n", - " 'PROMYELOCYTES': 'NA',\n", - " 'MYELOCYTES': 'NA',\n", - " 'METAMYELOCYTES': 'NA',\n", - " 'BLASTS': 'NA',\n", - " 'PLATELETS': '210',\n", - " 'RETICULOCYTE COUNT': 'NA'}]],\n", - " [[{'NAME': 'Test Patient 14',\n", - " 'HAEMOGLOBIN': '14.8',\n", - " 'RBC (RED CELLS COUNT)': '5.22',\n", - " 'HAEMATOCRIT(PCV)': '45.2',\n", + "[[[{'SCL No': '1232475',\n", + " 'Name': 'Test Patient A',\n", + " 'Contact #': '03443730681',\n", + " 'Ward Name': 'NA',\n", + " 'Admission#': 'NA',\n", + " 'Collection Time': '15-Jan-2024 10:19',\n", + " 'REF BY': 'Test Doctor A',\n", + " 'Haemoglobin': '12.6 gm/dl',\n", + " 'Haematocrit': '38.1 %',\n", + " 'R.B.C': '4.54 10E12/L',\n", + " 'M.C.V': '83.9 FL',\n", + " 'M.C.H': '27.8 PG',\n", + " 'M.C.H.C': '33.1 %',\n", + " 'W.B.C': '4.62 x10E9/L',\n", + " 'Neutrophils': '66 %',\n", + " 'Lymphocytes': '28 %',\n", + " 'Eosinophils': '00 %',\n", + " 'Monocytes': '06 %',\n", + " 'Basophils': '00 %',\n", + " 'Platelet Count': '195 x10E9L',\n", + " 'Normochromic Normocytic': 'NA'}]],\n", + " [[{'MR No': '231121-116431337',\n", + " 'Invoice No': '1115230939',\n", + " 'Name': 'TEST PATIENT 12',\n", + " 'Age/Gender': 'NA',\n", + " 'Referred By': 'SELF',\n", + " 'Sample Date': '22-Nov-2023',\n", + " 'HB': '12.8 gm/dL',\n", + " 'RBC': '4.5 x 10^12/L',\n", + " 'HCT': '42 %',\n", + " 'MCV': '93 fL',\n", + " 'MCH': '28 pg',\n", + " 'MCHC': '31 gm/dL',\n", + " 'WBC': '12.6 x 10e9/L',\n", + " 'PLATELETS': '210 x10^9/L',\n", + " 'NEUTROPHILS%': '67 %',\n", + " 'LYMPHOCYTES%': '23%',\n", + " 'MONOCYTES%': '07 %',\n", + " 'EOSINOPHILS%': '03 %',\n", + " 'BASOPHILS%': '00 %',\n", + " 'Remarks': 'Normocytic, normochromic. Leucocytosis. ? Cause. Clinical Correlation Advised'}]],\n", + " [[{'LabNo': '23020107031',\n", + " 'Name': 'Test Patient 14',\n", + " 'Age': 'NA',\n", + " 'Gender': 'NA',\n", + " 'ContactNumber': 'NA',\n", + " 'Location': 'NA',\n", + " 'Ward/Bed': 'F-OPD',\n", + " 'CollectionTime': '04-Mar-2023 11:13',\n", + " 'ReportingTime': '04-Mar-2023 12:14',\n", + " 'Haemoglobin': '14.8',\n", + " 'Haematocrit': '45.2',\n", " 'MCV': '86.6',\n", " 'MCH': '28.4',\n", " 'MCHC': '32.7',\n", - " 'TOTAL LEUCOCYTE COUNT': '5.45',\n", - " 'DIFFERENTIAL LEUCOCYTE COUNT': 'NA',\n", - " 'NEUTROPHILS': '64.3',\n", - " 'LYMPHOCYTES': '25.1',\n", - " 'MONOCYTES': '7.2',\n", - " 'EOSINOPHILS': '2.8',\n", - " 'BASOPHIL': '0.6',\n", - " 'PROMYELOCYTES': 'NA',\n", - " 'MYELOCYTES': 'NA',\n", - " 'METAMYELOCYTES': 'NA',\n", - " 'BLASTS': 'NA',\n", - " 'PLATELETS': '287',\n", - " 'RETICULOCYTE COUNT': 'NA'}]],\n", - " [[{'NAME': 'Test Patient 20',\n", - " 'HAEMOGLOBIN': '11.3',\n", - " 'RBC (RED CELLS COUNT)': '4.2',\n", - " 'HAEMATOCRIT(PCV)': '35',\n", + " 'RBC': '5.22',\n", + " 'PlateletCount': '287',\n", + " 'WBC': '5.45',\n", + " 'Neutrophils': '64.3',\n", + " 'Lymphocytes': '25.1',\n", + " 'Eosinophils': '2.8',\n", + " 'Monocytes': '7.2',\n", + " 'Basophils': '0.6',\n", + " 'ESR': '10'}]],\n", + " [[{'Name': 'Test Patient 20',\n", + " 'Age': 'NA',\n", + " 'Gender': 'NA',\n", + " 'TestDate': '10-June-2023',\n", + " 'TestDescription': 'Haematology',\n", + " 'Haemoglobin': '11.3',\n", + " 'RBCCount': '4.2',\n", + " 'Haematocrit': '35',\n", " 'MCV': '82',\n", " 'MCH': '27',\n", " 'MCHC': '33',\n", - " 'TOTAL LEUCOCYTE COUNT': '9,600',\n", - " 'DIFFERENTIAL LEUCOCYTE COUNT': 'NA',\n", - " 'NEUTROPHILS': '58',\n", - " 'LYMPHOCYTES': '40',\n", - " 'MONOCYTES': '01',\n", - " 'EOSINOPHILS': '01',\n", - " 'BASOPHIL': 'NA',\n", - " 'PROMYELOCYTES': 'NA',\n", - " 'MYELOCYTES': 'NA',\n", - " 'METAMYELOCYTES': 'NA',\n", - " 'BLASTS': 'NA',\n", - " 'PLATELETS': '238,000',\n", - " 'RETICULOCYTE COUNT': 'NA'}]]]" + " 'TotalLeukocyteCount': '9,600',\n", + " 'Neutrophils': '58',\n", + " 'Lymphocytes': '40',\n", + " 'Monocytes': '01',\n", + " 'Eosinophils': '01',\n", + " 'Basophil': 'NA',\n", + " 'Promyelocytes': 'NA',\n", + " 'Myelocytes': 'NA',\n", + " 'Metamyelocytes': 'NA',\n", + " 'Blasts': 'NA',\n", + " 'Platelets': '238,000',\n", + " 'ReticulocyteCount': 'NA',\n", + " 'Normoblast': 'Normochromic. Anisocytosis.',\n", + " 'Morphology': 'NA'}]]]" ] }, "execution_count": 8, @@ -301,7 +316,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -311,19 +326,15 @@ "---------------------------------------------------\n", "REPORT 1\n", "\n", - "Summary: {'missing_keys': [], 'additional_keys': [], 'incorrect_keys': []}\n", "---------------------------------------------------\n", "REPORT 2\n", "\n", - "Summary: {'missing_keys': [], 'additional_keys': [], 'incorrect_keys': []}\n", "---------------------------------------------------\n", "REPORT 3\n", "\n", - "Summary: {'missing_keys': [], 'additional_keys': [], 'incorrect_keys': []}\n", "---------------------------------------------------\n", "REPORT 4\n", - "\n", - "Summary: {'missing_keys': [], 'additional_keys': [], 'incorrect_keys': []}\n" + "\n" ] } ], @@ -350,27 +361,27 @@ " incorrect_keys = []\n", " expected_keys = list(this_expected_result.keys())\n", "\n", - " for key_idx, key in enumerate(expected_keys):\n", - " if key_idx < 0 or key_idx >= len(keys) or key != keys[key_idx]:\n", - " print(f\"Key {key} not found in report {idx+1}\")\n", - " missing_keys.append(key)\n", - " keys.insert(key_idx, key)\n", - " values.insert(key_idx, 'Missing')\n", - " elif not compare_vals(this_expected_result[key], values[keys.index(key)]):\n", - " print(f\"Incorrect {key}. Expected: {this_expected_result[key]}, Found: {values[keys.index(key)]}\")\n", - " incorrect_keys.append((key, this_expected_result[key], values[keys.index(key)]))\n", - " values[keys.index(key)] = f'{values[keys.index(key)]} * ({this_expected_result[key]})'\n", + " # for key_idx, key in enumerate(expected_keys):\n", + " # if key_idx < 0 or key_idx >= len(keys) or key != keys[key_idx]:\n", + " # print(f\"Key {key} not found in report {idx+1}\")\n", + " # missing_keys.append(key)\n", + " # keys.insert(key_idx, key)\n", + " # values.insert(key_idx, 'Missing')\n", + " # elif not compare_vals(this_expected_result[key], values[keys.index(key)]):\n", + " # print(f\"Incorrect {key}. Expected: {this_expected_result[key]}, Found: {values[keys.index(key)]}\")\n", + " # incorrect_keys.append((key, this_expected_result[key], values[keys.index(key)]))\n", + " # values[keys.index(key)] = f'{values[keys.index(key)]} * ({this_expected_result[key]})'\n", "\n", - " different_keys = {'missing_keys': missing_keys, 'additional_keys': [], 'incorrect_keys': incorrect_keys}\n", + " # different_keys = {'missing_keys': missing_keys, 'additional_keys': [], 'incorrect_keys': incorrect_keys}\n", "\n", - " # Check for differences in keys\n", - " for key in keys:\n", - " if key not in input_keys:\n", - " different_keys['additional_keys'].append(key)\n", - " print(f\"Summary: {different_keys}\")\n", + " # # Check for differences in keys\n", + " # for key in keys:\n", + " # if key not in input_keys:\n", + " # different_keys['additional_keys'].append(key)\n", + " # print(f\"Summary: {different_keys}\")\n", "\n", " # Create a DataFrame\n", - " values_list.append(values)\n" + " values_list.append(values)" ] }, { @@ -382,197 +393,29 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 10, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
 CBC_ReportSample_1.pngCBC_ReportSample_12.jpegCBC_ReportSample_14.jpegCBC_ReportSample_20.jpeg
NAMETest Patient ATEST PATIENT 12Test Patient 14Test Patient 20
HAEMOGLOBIN12.612.814.811.3
RBC (RED CELLS COUNT)4.544.55.224.2
HAEMATOCRIT(PCV)38.14245.235
MCV83.99386.682
MCH27.82828.427
MCHC33.13132.733
TOTAL LEUCOCYTE COUNT4.6212.65.459,600
DIFFERENTIAL LEUCOCYTE COUNTNANANANA
NEUTROPHILS666764.358
LYMPHOCYTES282325.140
MONOCYTES06077.201
EOSINOPHILS00032.801
BASOPHIL00000.6NA
PROMYELOCYTESNANANANA
MYELOCYTESNANANANA
METAMYELOCYTESNANANANA
BLASTSNANANANA
PLATELETS195210287238,000
RETICULOCYTE COUNTNANANANA
\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "df = pd.DataFrame({\n", - " report_files[0]: values_list[0],\n", - " report_files[1]: values_list[1],\n", - " report_files[2]: values_list[2],\n", - " report_files[3]: values_list[3],\n", - "}, index=input_keys)\n", + "# df = pd.DataFrame({\n", + "# report_files[0]: values_list[0],\n", + "# report_files[1]: values_list[1],\n", + "# report_files[2]: values_list[2],\n", + "# report_files[3]: values_list[3],\n", + "# }, index=input_keys)\n", "\n", - "def highlight_incorrect_keys(val):\n", - " if val == 'Missing':\n", - " return 'background-color: yellow; color: black'\n", - " elif '*' in val:\n", - " return 'background-color: red'\n", - " return ''\n", + "# def highlight_incorrect_keys(val):\n", + "# if val == 'Missing':\n", + "# return 'background-color: yellow; color: black'\n", + "# elif '*' in val:\n", + "# return 'background-color: red'\n", + "# return ''\n", "\n", - "# Apply the style to the DataFrame\n", - "styled_df = df.style.map(highlight_incorrect_keys)\n", + "# # Apply the style to the DataFrame\n", + "# styled_df = df.style.map(highlight_incorrect_keys)\n", "\n", - "# Display the styled DataFrame\n", - "styled_df\n" + "# # Display the styled DataFrame\n", + "# styled_df\n" ] }, {