{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "f2b5097c-3928-435d-8a86-a9f0116f9441", "metadata": {}, "outputs": [], "source": [ "from transformers import AutoTokenizer\n", "\n", "checkpoint = \"google-t5/t5-small\"\n", "tokenizer = AutoTokenizer.from_pretrained(checkpoint)" ] }, { "cell_type": "code", "execution_count": 2, "id": "3a43b482-4b73-4d88-8197-9e63b7029d17", "metadata": {}, "outputs": [], "source": [ "prefix = \"summarize: \"\n", "\n", "\n", "def preprocess_function(examples):\n", " inputs = [prefix + doc for doc in examples[\"text\"]]\n", " model_inputs = tokenizer(inputs, max_length=1024, truncation=True)\n", "\n", " labels = tokenizer(text_target=examples[\"summary\"], max_length=128, truncation=True)\n", "\n", " model_inputs[\"labels\"] = labels[\"input_ids\"]\n", " return model_inputs" ] }, { "cell_type": "code", "execution_count": 3, "id": "0baf8721-cc3c-47f9-a79c-def8397f548a", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2024-04-10 19:08:16.517364: I tensorflow/core/util/port.cc:111] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n", "2024-04-10 19:08:16.557667: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n", "2024-04-10 19:08:16.557712: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n", "2024-04-10 19:08:16.557734: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n", "2024-04-10 19:08:16.565003: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n", "To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", "2024-04-10 19:08:17.697728: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n" ] } ], "source": [ "from transformers import DataCollatorForSeq2Seq\n", "\n", "data_collator = DataCollatorForSeq2Seq(tokenizer=tokenizer, model=checkpoint)" ] }, { "cell_type": "code", "execution_count": 4, "id": "8de1fe91-7871-4e61-b8f4-392a60b92d1e", "metadata": {}, "outputs": [], "source": [ "def compute_metrics(eval_pred):\n", " predictions, labels = eval_pred\n", " decoded_preds = tokenizer.batch_decode(predictions, skip_special_tokens=True)\n", " labels = np.where(labels != -100, labels, tokenizer.pad_token_id)\n", " decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True)\n", "\n", " result = rouge.compute(predictions=decoded_preds, references=decoded_labels, use_stemmer=True)\n", "\n", " prediction_lens = [np.count_nonzero(pred != tokenizer.pad_token_id) for pred in predictions]\n", " result[\"gen_len\"] = np.mean(prediction_lens)\n", "\n", " return {k: round(v, 4) for k, v in result.items()}" ] }, { "cell_type": "code", "execution_count": 5, "id": "b9e50d2c-84b5-4f34-b8c0-667fe835f767", "metadata": {}, "outputs": [], "source": [ "import json\n", "\n", "cleaned_test_data = []\n", "# Opening JSON file\n", "with open(\"cleaned_bill_sum_test_data.json\") as json_file:\n", " cleaned_test_data = json.load(json_file)" ] }, { "cell_type": "code", "execution_count": 6, "id": "ca7908ff-e08e-4f9a-8407-006c634732c7", "metadata": {}, "outputs": [], "source": [ "from transformers import AutoModelForSeq2SeqLM, Seq2SeqTrainingArguments, Seq2SeqTrainer\n", "\n", "model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint)" ] }, { "cell_type": "code", "execution_count": 7, "id": "fc7e7286-c80d-4f6e-9e27-a867df58a447", "metadata": {}, "outputs": [], "source": [ "from transformers import pipeline\n", "\n", "summarizer = pipeline(\"summarization\", model=model, tokenizer=tokenizer)" ] }, { "cell_type": "code", "execution_count": 8, "id": "f40cba73-72b1-4a81-a33d-b29e7d99b899", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Token indices sequence length is longer than the specified maximum sequence length for this model (548 > 512). Running this sequence through the model will result in indexing errors\n" ] } ], "source": [ "generated_summaries = []\n", "for i in range(len(cleaned_test_data)):\n", " summary = summarizer(cleaned_test_data[i]['text'])\n", " generated_summaries.append({\"generated\" : summary[0]['summary_text'], \"summary\" : cleaned_test_data[i]['summary']})" ] }, { "cell_type": "code", "execution_count": 9, "id": "6988fdaa-d0a7-4ead-9e6c-efe0faed0d41", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': 'ACCEPT resolution 2023-01-25 Introduced in Senate Adopting Cryptocurrency in Congress as an Exchange of Payment for Transactions Resolution or the ACCEPT Resolution This resolution requires the Architect of the Capitol, the Secretary of the Senate, and the Chief Administrative Officer of the House of Representatives to encourage Capitol gift shops to accept cryptocurrency . this file contains bill summaries for federal legislation .',\n", " 'summary': 'Adopting Cryptocurrency in Congress as an Exchange of Payment for Transactions Resolution or the ACCEPT Resolution This resolution requires the Architect of the Capitol, the Secretary of the Senate, and the Chief Administrative Officer of the House of Representatives to encourage Capitol gift shops to accept cryptocurrency and to enter into contracts with vendors that accept cryptocurrency to provide food service and vending machines in the Capitol.'}" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[0]" ] }, { "cell_type": "code", "execution_count": 10, "id": "550e0419-e591-4b93-a98a-6b9a93771ccf", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-07-25 Introduced in Senate This concurrent resolution commends the bravery, courage, and resolve of the women and men of Iran . the resolution condemns (1) the brutal beating and death of Mahsa Amini; (2) the violent suppression by the Iranian regime of women and women participating in the current demonstrations .',\n", " 'summary': 'This concurrent resolution commends the bravery, courage, and resolve of the women and men of Iran who are (1) participating in the current protests to defend their fundamental human rights, and (2) risking their safety to speak out against the human rights abuses committed by the Iranian regime. The resolution condemns (1) the brutal beating and death of Mahsa Amini; and (2) the violent suppression by the Iranian regime of women and men participating in the current demonstrations, including children, and calls for transparent accountability for all killings of protesters by Iranian security forces. Finally, the resolution encourages continued efforts by the Biden Administration to respond to the protests, including the recent sanctioning of the Iranian morality police.'}" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[1]" ] }, { "cell_type": "code", "execution_count": 11, "id": "5b4ae304-3d18-43bb-af21-8e7a10055ace", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': 'a concurrent resolution calls for honoring the 237th anniversary of the enactment of the Virginia Statute for Religious Freedom on religious freedom day, January 16, 2023 . the resolution affirms that religious freedom includes the right of individuals of any faith and individuals of no faith to live, work, associate, and worship .',\n", " 'summary': 'This concurrent resolution calls for honoring the 237th anniversary of the enactment of the Virginia Statute for Religious Freedom on Religious Freedom Day, January 16, 2023. The resolution affirms that religious freedom includes the right of individuals of any faith and individuals of no faith to live, work, associate, and worship in accordance with their beliefs; all people of the United States can be unified in supporting religious freedom because it is a fundamental human right; and the American people will remain forever unshackled in matters of faith.'}" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[2]" ] }, { "cell_type": "code", "execution_count": 12, "id": "6fe7ec86-c00a-4035-b333-984a1d0d3758", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-02-16 Introduced in Senate This concurrent resolution requires the Joint Committee on the Library to approve or deny the statue of Rev. Billy Graham . this file contains bill summaries for federal legislation and details the effects the legislative text may have on current law and federal programs .',\n", " 'summary': 'This concurrent resolution requires the Joint Committee on the Library to approve or deny the statue of Rev. Billy Graham for placement in the National Statuary Hall within 30 days after North Carolina submits specific information about the statute, including its dimensions and final weight.'}" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[3]" ] }, { "cell_type": "code", "execution_count": 13, "id": "547ae1b9-a596-4ae0-aa4f-0f9a93fdc4f7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-03-09 Introduced in Senate This concurrent resolution declares that Congress should not impose any new performance fee, tax, royalty, or other charge relating to the public performance of sound recordings on a local radio station . this file contains bill summaries for federal legislation .',\n", " 'summary': 'This concurrent resolution declares that Congress should not impose any new performance fee, tax, royalty, or other charge relating to the public performance of sound recordings on a local radio station for broadcasting sound recordings over the air or on any business for such public performance of sound recordings.'}" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[4]" ] }, { "cell_type": "code", "execution_count": 14, "id": "5eb82a5e-8f1a-46a0-a928-e9a19918b397", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-03-09 Introduced in Senate This concurrent resolution recognizes \"Abortion Provider Appreciation Day\" this file contains bill summaries for federal legislation . a bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law .',\n", " 'summary': 'This concurrent resolution recognizes Abortion Provider Appreciation Day.'}" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[5]" ] }, { "cell_type": "code", "execution_count": 15, "id": "497ceac3-d31f-40ae-b1a6-03ef91a74902", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': \"2023-11-02 Passed Senate This concurrent resolution condemns Russia's unjust and arbitrary detention of Russian democratic opposition leader Vladimir Kara-Murza . it calls for his immediate release and the release of all other Russian opposition leaders .\",\n", " 'summary': \"This concurrent resolution condemns Russia's unjust and arbitrary detention of Russian democratic opposition leader Vladimir Kara-Murza and calls for his immediate release and the release of all other Russian opposition leaders. It also calls for the release of all political prisoners in Russia and in Belarus, as well as for the release of Ukrainian citizens held by Russia, and calls on the President and leaders of the free world to work tirelessly for the release of political prisoners in Russia.\"}" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[6]" ] }, { "cell_type": "code", "execution_count": 16, "id": "8dacc198-616c-4e4a-8feb-2946cd79e83e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-03-23 Introduced in Senate This concurrent resolution expresses the sense of Congress that tax-exempt fraternal benefit societies provide critical benefits to the people and communities of the united states . this file contains bill summaries for federal legislation and details the effects the legislative text may have on current law and federal programs .',\n", " 'summary': 'This concurrent resolution expresses the sense of Congress that tax-exempt fraternal benefit societies provide critical benefits to the people and communities of the United States and their work should continue to be promoted.'}" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[7]" ] }, { "cell_type": "code", "execution_count": 17, "id": "9840e4e9-6c45-4a4f-bea5-7905c8564ad5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-04-27 Introduced in Senate This concurrent resolution expresses the sense of Congress that climate change caused by human activities constitutes a climate emergency . it demands the president use existing authorities and emergency powers to mitigate and address its consequences and causes .',\n", " 'summary': 'This concurrent resolution expresses the sense of Congress that climate change caused by human activities constitutes a climate emergency, which demands the President use existing authorities and emergency powers to mitigate and prepare for the consequences of the emergency.'}" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[8]" ] }, { "cell_type": "code", "execution_count": 18, "id": "9274312e-db9a-4a69-98c0-026c8571eb01", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': 'a bill summary describes the most significant provisions of a piece of legislation . the document is not subject to copyright protection and is in the public domain . it is authored by the Congressional Research Service .',\n", " 'summary': \"Fiscal State of the Nation Resolution This concurrent resolution requires the congressional budget committees to conduct an annual joint hearing to receive a presentation from the Comptroller General regarding (1) the Government Accountability Office's audit of the financial statement of the executive branch, and (2) the financial position and condition of the federal government.\"}" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[9]" ] }, { "cell_type": "code", "execution_count": 19, "id": "dcb8951d-2d21-4578-aecb-f363904a0504", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-05-31 Introduced in Senate This concurrent resolution expresses the sense that the Senate should provide its advice and consent to ratification of the Convention on Biological Diversity . this file contains bill summaries for federal legislation and details the effects the legislative text may have on current law and federal programs .',\n", " 'summary': 'This concurrent resolution expresses the sense that the Senate should provide its advice and consent to ratification of the Convention on Biological Diversity.'}" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[10]" ] }, { "cell_type": "code", "execution_count": 20, "id": "dd26c5d5-d6df-4213-b0ef-de281a97a1c9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-07-18 Introduced in Senate This concurrent resolution calls on the media to voluntarily adopt certain practices . it calls for coverage that (1) denies murderers a public platform; (2) minimizes the potential for media reporting to increase the likelihood of future mass public murders .',\n", " 'summary': 'This concurrent resolution calls on the media to voluntarily adopt certain practices to prevent further harm from its coverage of mass public murders. Specifically, it calls for coverage that (1) denies murderers a public platform; (2) minimizes the potential for media reporting to increase the likelihood of future mass public murders (i.e., the media contagion effect); and (3) prioritizes the victims of, and heroism in the response to, mass public murders.'}" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[11]" ] }, { "cell_type": "code", "execution_count": 21, "id": "06dc9580-d980-4901-9aab-ae125b01689a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-07-27 Introduced in Senate This concurrent resolution affirms, more than 400 years after the arrival of the first slave ship, that the United States owes a debt of remembrance to those who lived through slavery . it urges the establishment of a U.S. Commission on Truth, Racial Healing, and Transformation .',\n", " 'summary': 'This concurrent resolution affirms, more than 400 years after the arrival of the first slave ship, that the United States owes a debt of remembrance to those who lived through slavery or other historical injustices against people of color, as well as to their descendants. It also urges the establishment of a U.S. Commission on Truth, Racial Healing, and Transformation.'}" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[12]" ] }, { "cell_type": "code", "execution_count": 22, "id": "6fd5488c-9ab3-4009-aacd-1414b78ce86c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-10-04 Introduced in Senate This concurrent resolution recognizes the disparity between wages paid to Latina women in comparison to men . a bill summary describes the most significant provisions of a piece of legislation .',\n", " 'summary': \"This concurrent resolution recognizes the disparity between wages paid to Latina women in comparison to men and reaffirms Congress's support for ensuring equal pay and closing the gender wage gap.\"}" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[13]" ] }, { "cell_type": "code", "execution_count": 23, "id": "0761573c-56f5-486d-a1fd-049cac959071", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2023-10-26 Introduced in Senate This concurrent resolution expresses the sense of Congress that a carbon tax would be detrimental to families and businesses . this file contains bill summaries for federal legislation and details the effects the legislative text may have on current law and federal programs .',\n", " 'summary': 'This concurrent resolution expresses the sense of Congress that a carbon tax would be detrimental to families and businesses and would severely harm the economic and national security of the country.'}" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[14]" ] }, { "cell_type": "code", "execution_count": 24, "id": "713ea198-a3e6-46b1-b8e1-dd823ea0e04f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'generated': '2024-02-13 Introduced in Senate This concurrent resolution provides for a correction in the official title of H.R. 815 . a bill summary describes the most significant provisions of a piece of legislation .',\n", " 'summary': 'This concurrent resolution makes a correction to the official title of H.R. 815 (Making emergency supplemental appropriations for the fiscal year ending September 30, 2024, and for other purposes).'}" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "generated_summaries[15]" ] }, { "cell_type": "markdown", "id": "68c08713-89d9-4611-8cf5-9c86bed5fc29", "metadata": {}, "source": [ "# ROUGE EVALUATION" ] }, { "cell_type": "code", "execution_count": 1, "id": "e869ae4a-6126-4256-98b4-4c36556e4cec", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2024-04-12 23:41:17.816687: I tensorflow/core/util/port.cc:111] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n", "2024-04-12 23:41:17.854792: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n", "2024-04-12 23:41:17.854821: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n", "2024-04-12 23:41:17.854843: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n", "2024-04-12 23:41:17.861609: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n", "To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", "2024-04-12 23:41:18.890366: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n" ] } ], "source": [ "import evaluate\n", "\n", "rouge = evaluate.load(\"rouge\")\n", "\n", "def ROUGE_evaluate(data_set : list):\n", " date = data_set\n", " for i in range(len(generated_summaries)):\n", " rouge = evaluate.load('rouge')\n", " predictions = [generated_summaries[i]['generated']]\n", " references = [generated_summaries[i]['summary']]\n", " results = rouge.compute(predictions=predictions, references=references)\n", " print(results)" ] }, { "cell_type": "code", "execution_count": 27, "id": "9d9df0d5-8436-44e2-8be8-01ba1f699436", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'rouge1': 0.7538461538461538, 'rouge2': 0.71875, 'rougeL': 0.7230769230769232, 'rougeLsum': 0.7230769230769232}\n", "{'rouge1': 0.5325443786982248, 'rouge2': 0.4790419161676647, 'rougeL': 0.5207100591715977, 'rougeLsum': 0.5207100591715977}\n", "{'rouge1': 0.7338129496402878, 'rouge2': 0.7153284671532847, 'rougeL': 0.7194244604316548, 'rougeLsum': 0.7194244604316548}\n", "{'rouge1': 0.5319148936170212, 'rouge2': 0.41304347826086957, 'rougeL': 0.5106382978723404, 'rougeLsum': 0.5106382978723404}\n", "{'rouge1': 0.6808510638297872, 'rouge2': 0.6521739130434783, 'rougeL': 0.6808510638297872, 'rougeLsum': 0.6808510638297872}\n", "{'rouge1': 0.2909090909090909, 'rouge2': 0.2641509433962264, 'rougeL': 0.2909090909090909, 'rougeLsum': 0.2909090909090909}\n", "{'rouge1': 0.5499999999999999, 'rouge2': 0.5084745762711864, 'rougeL': 0.5333333333333333, 'rougeLsum': 0.5333333333333333}\n", "{'rouge1': 0.6067415730337079, 'rouge2': 0.5747126436781609, 'rougeL': 0.6067415730337079, 'rougeLsum': 0.6067415730337079}\n", "{'rouge1': 0.7804878048780488, 'rouge2': 0.725, 'rougeL': 0.7804878048780488, 'rougeLsum': 0.7804878048780488}\n", "{'rouge1': 0.2222222222222222, 'rouge2': 0.022727272727272724, 'rougeL': 0.17777777777777778, 'rougeLsum': 0.17777777777777778}\n", "{'rouge1': 0.6133333333333333, 'rouge2': 0.6027397260273972, 'rougeL': 0.6133333333333333, 'rougeLsum': 0.6133333333333333}\n", "{'rouge1': 0.6837606837606838, 'rouge2': 0.6434782608695652, 'rougeL': 0.6666666666666667, 'rougeLsum': 0.6666666666666667}\n", "{'rouge1': 0.8141592920353982, 'rouge2': 0.7747747747747747, 'rougeL': 0.8141592920353982, 'rougeLsum': 0.8141592920353982}\n", "{'rouge1': 0.5151515151515151, 'rouge2': 0.46875, 'rougeL': 0.5151515151515151, 'rougeLsum': 0.5151515151515151}\n", "{'rouge1': 0.5822784810126582, 'rouge2': 0.4675324675324675, 'rougeL': 0.5569620253164557, 'rougeLsum': 0.5569620253164557}\n", "{'rouge1': 0.46875, 'rouge2': 0.2903225806451613, 'rougeL': 0.40625, 'rougeLsum': 0.40625}\n" ] } ], "source": [ "ROUGE_evaluate(generated_summaries)" ] }, { "cell_type": "code", "execution_count": null, "id": "f0fff4ba-a967-4fac-88da-88d238967680", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.7" } }, "nbformat": 4, "nbformat_minor": 5 }