Import evaluate was added
Browse files
notebooks/T5_Base_Model_Interface.ipynb
CHANGED
@@ -502,11 +502,29 @@
|
|
502 |
},
|
503 |
{
|
504 |
"cell_type": "code",
|
505 |
-
"execution_count":
|
506 |
"id": "e869ae4a-6126-4256-98b4-4c36556e4cec",
|
507 |
"metadata": {},
|
508 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
"source": [
|
|
|
|
|
|
|
|
|
510 |
"def ROUGE_evaluate(data_set : list):\n",
|
511 |
" date = data_set\n",
|
512 |
" for i in range(len(generated_summaries)):\n",
|
|
|
502 |
},
|
503 |
{
|
504 |
"cell_type": "code",
|
505 |
+
"execution_count": 1,
|
506 |
"id": "e869ae4a-6126-4256-98b4-4c36556e4cec",
|
507 |
"metadata": {},
|
508 |
+
"outputs": [
|
509 |
+
{
|
510 |
+
"name": "stderr",
|
511 |
+
"output_type": "stream",
|
512 |
+
"text": [
|
513 |
+
"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",
|
514 |
+
"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",
|
515 |
+
"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",
|
516 |
+
"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",
|
517 |
+
"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",
|
518 |
+
"To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
|
519 |
+
"2024-04-12 23:41:18.890366: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n"
|
520 |
+
]
|
521 |
+
}
|
522 |
+
],
|
523 |
"source": [
|
524 |
+
"import evaluate\n",
|
525 |
+
"\n",
|
526 |
+
"rouge = evaluate.load(\"rouge\")\n",
|
527 |
+
"\n",
|
528 |
"def ROUGE_evaluate(data_set : list):\n",
|
529 |
" date = data_set\n",
|
530 |
" for i in range(len(generated_summaries)):\n",
|
notebooks/T5_California_Model_Interface.ipynb
CHANGED
@@ -429,6 +429,10 @@
|
|
429 |
"metadata": {},
|
430 |
"outputs": [],
|
431 |
"source": [
|
|
|
|
|
|
|
|
|
432 |
"def ROUGE_evaluate(data_set : list):\n",
|
433 |
" date = data_set\n",
|
434 |
" for i in range(len(generated_summaries)):\n",
|
|
|
429 |
"metadata": {},
|
430 |
"outputs": [],
|
431 |
"source": [
|
432 |
+
"import evaluate\n",
|
433 |
+
"\n",
|
434 |
+
"rouge = evaluate.load(\"rouge\")\n",
|
435 |
+
"\n",
|
436 |
"def ROUGE_evaluate(data_set : list):\n",
|
437 |
" date = data_set\n",
|
438 |
" for i in range(len(generated_summaries)):\n",
|
notebooks/T5_Congres_Bill_Model_Interface.ipynb
CHANGED
@@ -2,33 +2,19 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"id": "89751719-bb82-42ef-b49e-182e81b0c478",
|
7 |
"metadata": {},
|
8 |
-
"outputs": [
|
9 |
-
{
|
10 |
-
"name": "stderr",
|
11 |
-
"output_type": "stream",
|
12 |
-
"text": [
|
13 |
-
"2024-04-10 19:08:23.066747: 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",
|
14 |
-
"2024-04-10 19:08:23.106579: 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",
|
15 |
-
"2024-04-10 19:08:23.106623: 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",
|
16 |
-
"2024-04-10 19:08:23.106650: 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",
|
17 |
-
"2024-04-10 19:08:23.113912: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
|
18 |
-
"To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
|
19 |
-
"2024-04-10 19:08:24.171199: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n"
|
20 |
-
]
|
21 |
-
}
|
22 |
-
],
|
23 |
"source": [
|
24 |
"from transformers import pipeline\n",
|
25 |
"\n",
|
26 |
-
"summarizer = pipeline(\"summarization\", model=\"cheaptrix/
|
27 |
]
|
28 |
},
|
29 |
{
|
30 |
"cell_type": "code",
|
31 |
-
"execution_count":
|
32 |
"id": "883134f1-934d-422f-a64a-0a37073542c0",
|
33 |
"metadata": {},
|
34 |
"outputs": [],
|
@@ -43,7 +29,7 @@
|
|
43 |
},
|
44 |
{
|
45 |
"cell_type": "code",
|
46 |
-
"execution_count":
|
47 |
"id": "c7f5e7f6-ac9f-4ba7-acbf-1ba7d031ef81",
|
48 |
"metadata": {},
|
49 |
"outputs": [
|
@@ -64,7 +50,7 @@
|
|
64 |
},
|
65 |
{
|
66 |
"cell_type": "code",
|
67 |
-
"execution_count":
|
68 |
"id": "cca1a292-1ab5-452f-b998-d404bfc633d8",
|
69 |
"metadata": {},
|
70 |
"outputs": [
|
@@ -75,7 +61,7 @@
|
|
75 |
" '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.'}"
|
76 |
]
|
77 |
},
|
78 |
-
"execution_count":
|
79 |
"metadata": {},
|
80 |
"output_type": "execute_result"
|
81 |
}
|
@@ -86,7 +72,7 @@
|
|
86 |
},
|
87 |
{
|
88 |
"cell_type": "code",
|
89 |
-
"execution_count":
|
90 |
"id": "22b594f4-b8a1-4296-bd19-31e799a368e7",
|
91 |
"metadata": {},
|
92 |
"outputs": [
|
@@ -97,7 +83,7 @@
|
|
97 |
" '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.'}"
|
98 |
]
|
99 |
},
|
100 |
-
"execution_count":
|
101 |
"metadata": {},
|
102 |
"output_type": "execute_result"
|
103 |
}
|
@@ -108,7 +94,7 @@
|
|
108 |
},
|
109 |
{
|
110 |
"cell_type": "code",
|
111 |
-
"execution_count":
|
112 |
"id": "7f0a025a-290f-4811-b504-793e2e0dbde2",
|
113 |
"metadata": {},
|
114 |
"outputs": [
|
@@ -119,7 +105,7 @@
|
|
119 |
" '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.'}"
|
120 |
]
|
121 |
},
|
122 |
-
"execution_count":
|
123 |
"metadata": {},
|
124 |
"output_type": "execute_result"
|
125 |
}
|
@@ -130,7 +116,7 @@
|
|
130 |
},
|
131 |
{
|
132 |
"cell_type": "code",
|
133 |
-
"execution_count":
|
134 |
"id": "e0b81c81-b0ba-4285-988a-ce9b070e215c",
|
135 |
"metadata": {},
|
136 |
"outputs": [
|
@@ -141,7 +127,7 @@
|
|
141 |
" '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.'}"
|
142 |
]
|
143 |
},
|
144 |
-
"execution_count":
|
145 |
"metadata": {},
|
146 |
"output_type": "execute_result"
|
147 |
}
|
@@ -152,18 +138,18 @@
|
|
152 |
},
|
153 |
{
|
154 |
"cell_type": "code",
|
155 |
-
"execution_count":
|
156 |
"id": "8da96ded-73dd-474f-8c2b-b684f1aa825c",
|
157 |
"metadata": {},
|
158 |
"outputs": [
|
159 |
{
|
160 |
"data": {
|
161 |
"text/plain": [
|
162 |
-
"{'generated': '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.',\n",
|
163 |
" '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.'}"
|
164 |
]
|
165 |
},
|
166 |
-
"execution_count":
|
167 |
"metadata": {},
|
168 |
"output_type": "execute_result"
|
169 |
}
|
@@ -174,7 +160,7 @@
|
|
174 |
},
|
175 |
{
|
176 |
"cell_type": "code",
|
177 |
-
"execution_count":
|
178 |
"id": "6d51741f-fb47-48d2-a387-ef87577817df",
|
179 |
"metadata": {},
|
180 |
"outputs": [
|
@@ -185,7 +171,7 @@
|
|
185 |
" 'summary': 'This concurrent resolution recognizes Abortion Provider Appreciation Day.'}"
|
186 |
]
|
187 |
},
|
188 |
-
"execution_count":
|
189 |
"metadata": {},
|
190 |
"output_type": "execute_result"
|
191 |
}
|
@@ -196,7 +182,7 @@
|
|
196 |
},
|
197 |
{
|
198 |
"cell_type": "code",
|
199 |
-
"execution_count":
|
200 |
"id": "a69ce9c9-f18f-4aed-80f2-53fd81311555",
|
201 |
"metadata": {},
|
202 |
"outputs": [
|
@@ -207,7 +193,7 @@
|
|
207 |
" '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.\"}"
|
208 |
]
|
209 |
},
|
210 |
-
"execution_count":
|
211 |
"metadata": {},
|
212 |
"output_type": "execute_result"
|
213 |
}
|
@@ -218,7 +204,7 @@
|
|
218 |
},
|
219 |
{
|
220 |
"cell_type": "code",
|
221 |
-
"execution_count":
|
222 |
"id": "14a0bc12-abe5-4dca-b97c-13577cf63ee5",
|
223 |
"metadata": {},
|
224 |
"outputs": [
|
@@ -229,7 +215,7 @@
|
|
229 |
" '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.'}"
|
230 |
]
|
231 |
},
|
232 |
-
"execution_count":
|
233 |
"metadata": {},
|
234 |
"output_type": "execute_result"
|
235 |
}
|
@@ -240,7 +226,7 @@
|
|
240 |
},
|
241 |
{
|
242 |
"cell_type": "code",
|
243 |
-
"execution_count":
|
244 |
"id": "7d4415fe-7d50-4c12-9039-c338651f8972",
|
245 |
"metadata": {},
|
246 |
"outputs": [
|
@@ -251,7 +237,7 @@
|
|
251 |
" '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.'}"
|
252 |
]
|
253 |
},
|
254 |
-
"execution_count":
|
255 |
"metadata": {},
|
256 |
"output_type": "execute_result"
|
257 |
}
|
@@ -262,7 +248,7 @@
|
|
262 |
},
|
263 |
{
|
264 |
"cell_type": "code",
|
265 |
-
"execution_count":
|
266 |
"id": "ff9959f8-4c7a-4af3-8e3e-83cfde0f227a",
|
267 |
"metadata": {},
|
268 |
"outputs": [
|
@@ -273,7 +259,7 @@
|
|
273 |
" '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.\"}"
|
274 |
]
|
275 |
},
|
276 |
-
"execution_count":
|
277 |
"metadata": {},
|
278 |
"output_type": "execute_result"
|
279 |
}
|
@@ -284,7 +270,7 @@
|
|
284 |
},
|
285 |
{
|
286 |
"cell_type": "code",
|
287 |
-
"execution_count":
|
288 |
"id": "54e8d283-2011-4f9a-b20e-70c90cff42be",
|
289 |
"metadata": {},
|
290 |
"outputs": [
|
@@ -295,7 +281,7 @@
|
|
295 |
" 'summary': 'This concurrent resolution expresses the sense that the Senate should provide its advice and consent to ratification of the Convention on Biological Diversity.'}"
|
296 |
]
|
297 |
},
|
298 |
-
"execution_count":
|
299 |
"metadata": {},
|
300 |
"output_type": "execute_result"
|
301 |
}
|
@@ -306,7 +292,7 @@
|
|
306 |
},
|
307 |
{
|
308 |
"cell_type": "code",
|
309 |
-
"execution_count":
|
310 |
"id": "cd4a017c-69d3-4891-b011-bdd19ca4a742",
|
311 |
"metadata": {},
|
312 |
"outputs": [
|
@@ -317,7 +303,7 @@
|
|
317 |
" '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.'}"
|
318 |
]
|
319 |
},
|
320 |
-
"execution_count":
|
321 |
"metadata": {},
|
322 |
"output_type": "execute_result"
|
323 |
}
|
@@ -328,18 +314,18 @@
|
|
328 |
},
|
329 |
{
|
330 |
"cell_type": "code",
|
331 |
-
"execution_count":
|
332 |
"id": "e2a659be-e404-447e-8a35-5dbd365e4faf",
|
333 |
"metadata": {},
|
334 |
"outputs": [
|
335 |
{
|
336 |
"data": {
|
337 |
"text/plain": [
|
338 |
-
"{'generated': '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
|
339 |
" '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.'}"
|
340 |
]
|
341 |
},
|
342 |
-
"execution_count":
|
343 |
"metadata": {},
|
344 |
"output_type": "execute_result"
|
345 |
}
|
@@ -350,7 +336,7 @@
|
|
350 |
},
|
351 |
{
|
352 |
"cell_type": "code",
|
353 |
-
"execution_count":
|
354 |
"id": "d859483d-a664-4eb4-8910-8c590461d48e",
|
355 |
"metadata": {},
|
356 |
"outputs": [
|
@@ -361,7 +347,7 @@
|
|
361 |
" '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.\"}"
|
362 |
]
|
363 |
},
|
364 |
-
"execution_count":
|
365 |
"metadata": {},
|
366 |
"output_type": "execute_result"
|
367 |
}
|
@@ -372,7 +358,7 @@
|
|
372 |
},
|
373 |
{
|
374 |
"cell_type": "code",
|
375 |
-
"execution_count":
|
376 |
"id": "c66b1673-d087-4b52-88d4-ef5990ecbd90",
|
377 |
"metadata": {},
|
378 |
"outputs": [
|
@@ -383,7 +369,7 @@
|
|
383 |
" '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.'}"
|
384 |
]
|
385 |
},
|
386 |
-
"execution_count":
|
387 |
"metadata": {},
|
388 |
"output_type": "execute_result"
|
389 |
}
|
@@ -394,7 +380,7 @@
|
|
394 |
},
|
395 |
{
|
396 |
"cell_type": "code",
|
397 |
-
"execution_count":
|
398 |
"id": "205ff67d-894d-40f4-814c-d9f2d3eea1d0",
|
399 |
"metadata": {},
|
400 |
"outputs": [
|
@@ -405,7 +391,7 @@
|
|
405 |
" '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).'}"
|
406 |
]
|
407 |
},
|
408 |
-
"execution_count":
|
409 |
"metadata": {},
|
410 |
"output_type": "execute_result"
|
411 |
}
|
@@ -424,7 +410,7 @@
|
|
424 |
},
|
425 |
{
|
426 |
"cell_type": "code",
|
427 |
-
"execution_count":
|
428 |
"id": "3a6116df-634c-4cdc-8e17-e17519f06aa7",
|
429 |
"metadata": {},
|
430 |
"outputs": [],
|
@@ -442,7 +428,7 @@
|
|
442 |
},
|
443 |
{
|
444 |
"cell_type": "code",
|
445 |
-
"execution_count":
|
446 |
"id": "4351fd53-9f09-4794-b34c-092732d27ff1",
|
447 |
"metadata": {},
|
448 |
"outputs": [
|
@@ -453,7 +439,7 @@
|
|
453 |
" 'summary': 'Saving Access to Laboratory Services Act This bill modifies provisions relating to Medicare payment rates for clinical diagnostic laboratory services, including by requiring payment rates for certain widely available clinical diagnostic laboratory tests to be based on a statistical sampling of private sector rates.'}"
|
454 |
]
|
455 |
},
|
456 |
-
"execution_count":
|
457 |
"metadata": {},
|
458 |
"output_type": "execute_result"
|
459 |
}
|
@@ -464,18 +450,18 @@
|
|
464 |
},
|
465 |
{
|
466 |
"cell_type": "code",
|
467 |
-
"execution_count":
|
468 |
"id": "f8f57bd4-5082-4c0a-a61b-523814f60db6",
|
469 |
"metadata": {},
|
470 |
"outputs": [
|
471 |
{
|
472 |
"data": {
|
473 |
"text/plain": [
|
474 |
-
"{'generated': '
|
475 |
" 'summary': 'Agriculture Resilience Act of 2023 This bill establishes, expands, and revises multiple programs and activities of the Department of Agriculture (USDA) primarily to reduce carbon emissions from the agriculture sector. Specifically, USDA must finalize and implement a plan to achieve net-zero emissions from the sector by 2040. USDA must periodically review and revise the plan, as necessary, and annually report on its implementation. Additionally, the bill expands the scope of various USDA research, extension, and education programs; conservation programs; and livestock programs to incorporate climate change adaptation and mitigation. Expanded activities include efforts to improve soil health and preserve farmland and grassland. Further, the bill changes programs that support renewable energy in rural areas to address carbon emissions in the agriculture sector. Among these changes, the bill provides statutory authority for the AgSTAR program for reducing methane emissions from livestock waste and requires the program to be moved from the Environmental Protection Agency to USDA. The bill also addresses food waste, for example, by (1) standardizing the voluntary labels used by food producers to indicate the date by which food should be used or discarded, and (2) making composting activities eligible for support through USDA conservation programs. Moreover, the bill establishes grants to reduce and prevent food waste in landfills and in schools.'}"
|
476 |
]
|
477 |
},
|
478 |
-
"execution_count":
|
479 |
"metadata": {},
|
480 |
"output_type": "execute_result"
|
481 |
}
|
@@ -494,11 +480,15 @@
|
|
494 |
},
|
495 |
{
|
496 |
"cell_type": "code",
|
497 |
-
"execution_count":
|
498 |
"id": "e869ae4a-6126-4256-98b4-4c36556e4cec",
|
499 |
"metadata": {},
|
500 |
"outputs": [],
|
501 |
"source": [
|
|
|
|
|
|
|
|
|
502 |
"def ROUGE_evaluate(data_set : list):\n",
|
503 |
" data = data_set\n",
|
504 |
" for i in range(len(data)):\n",
|
@@ -519,7 +509,7 @@
|
|
519 |
},
|
520 |
{
|
521 |
"cell_type": "code",
|
522 |
-
"execution_count":
|
523 |
"id": "9d9df0d5-8436-44e2-8be8-01ba1f699436",
|
524 |
"metadata": {},
|
525 |
"outputs": [
|
@@ -560,7 +550,7 @@
|
|
560 |
},
|
561 |
{
|
562 |
"cell_type": "code",
|
563 |
-
"execution_count":
|
564 |
"id": "342d6f20-3992-4a4e-b68b-0c67b80674af",
|
565 |
"metadata": {},
|
566 |
"outputs": [
|
@@ -569,7 +559,7 @@
|
|
569 |
"output_type": "stream",
|
570 |
"text": [
|
571 |
"{'rouge1': 0.9545454545454546, 'rouge2': 0.9069767441860465, 'rougeL': 0.9545454545454546, 'rougeLsum': 0.9545454545454546}\n",
|
572 |
-
"{'rouge1': 0.
|
573 |
]
|
574 |
}
|
575 |
],
|
@@ -580,7 +570,7 @@
|
|
580 |
{
|
581 |
"cell_type": "code",
|
582 |
"execution_count": null,
|
583 |
-
"id": "
|
584 |
"metadata": {},
|
585 |
"outputs": [],
|
586 |
"source": []
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 4,
|
6 |
"id": "89751719-bb82-42ef-b49e-182e81b0c478",
|
7 |
"metadata": {},
|
8 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
"source": [
|
10 |
"from transformers import pipeline\n",
|
11 |
"\n",
|
12 |
+
"summarizer = pipeline(\"summarization\", model=\"cheaptrix/congress_bill_summary_model\")"
|
13 |
]
|
14 |
},
|
15 |
{
|
16 |
"cell_type": "code",
|
17 |
+
"execution_count": 5,
|
18 |
"id": "883134f1-934d-422f-a64a-0a37073542c0",
|
19 |
"metadata": {},
|
20 |
"outputs": [],
|
|
|
29 |
},
|
30 |
{
|
31 |
"cell_type": "code",
|
32 |
+
"execution_count": 6,
|
33 |
"id": "c7f5e7f6-ac9f-4ba7-acbf-1ba7d031ef81",
|
34 |
"metadata": {},
|
35 |
"outputs": [
|
|
|
50 |
},
|
51 |
{
|
52 |
"cell_type": "code",
|
53 |
+
"execution_count": 7,
|
54 |
"id": "cca1a292-1ab5-452f-b998-d404bfc633d8",
|
55 |
"metadata": {},
|
56 |
"outputs": [
|
|
|
61 |
" '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.'}"
|
62 |
]
|
63 |
},
|
64 |
+
"execution_count": 7,
|
65 |
"metadata": {},
|
66 |
"output_type": "execute_result"
|
67 |
}
|
|
|
72 |
},
|
73 |
{
|
74 |
"cell_type": "code",
|
75 |
+
"execution_count": 8,
|
76 |
"id": "22b594f4-b8a1-4296-bd19-31e799a368e7",
|
77 |
"metadata": {},
|
78 |
"outputs": [
|
|
|
83 |
" '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.'}"
|
84 |
]
|
85 |
},
|
86 |
+
"execution_count": 8,
|
87 |
"metadata": {},
|
88 |
"output_type": "execute_result"
|
89 |
}
|
|
|
94 |
},
|
95 |
{
|
96 |
"cell_type": "code",
|
97 |
+
"execution_count": 9,
|
98 |
"id": "7f0a025a-290f-4811-b504-793e2e0dbde2",
|
99 |
"metadata": {},
|
100 |
"outputs": [
|
|
|
105 |
" '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.'}"
|
106 |
]
|
107 |
},
|
108 |
+
"execution_count": 9,
|
109 |
"metadata": {},
|
110 |
"output_type": "execute_result"
|
111 |
}
|
|
|
116 |
},
|
117 |
{
|
118 |
"cell_type": "code",
|
119 |
+
"execution_count": 10,
|
120 |
"id": "e0b81c81-b0ba-4285-988a-ce9b070e215c",
|
121 |
"metadata": {},
|
122 |
"outputs": [
|
|
|
127 |
" '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.'}"
|
128 |
]
|
129 |
},
|
130 |
+
"execution_count": 10,
|
131 |
"metadata": {},
|
132 |
"output_type": "execute_result"
|
133 |
}
|
|
|
138 |
},
|
139 |
{
|
140 |
"cell_type": "code",
|
141 |
+
"execution_count": 11,
|
142 |
"id": "8da96ded-73dd-474f-8c2b-b684f1aa825c",
|
143 |
"metadata": {},
|
144 |
"outputs": [
|
145 |
{
|
146 |
"data": {
|
147 |
"text/plain": [
|
148 |
+
"{'generated': '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 .',\n",
|
149 |
" '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.'}"
|
150 |
]
|
151 |
},
|
152 |
+
"execution_count": 11,
|
153 |
"metadata": {},
|
154 |
"output_type": "execute_result"
|
155 |
}
|
|
|
160 |
},
|
161 |
{
|
162 |
"cell_type": "code",
|
163 |
+
"execution_count": 12,
|
164 |
"id": "6d51741f-fb47-48d2-a387-ef87577817df",
|
165 |
"metadata": {},
|
166 |
"outputs": [
|
|
|
171 |
" 'summary': 'This concurrent resolution recognizes Abortion Provider Appreciation Day.'}"
|
172 |
]
|
173 |
},
|
174 |
+
"execution_count": 12,
|
175 |
"metadata": {},
|
176 |
"output_type": "execute_result"
|
177 |
}
|
|
|
182 |
},
|
183 |
{
|
184 |
"cell_type": "code",
|
185 |
+
"execution_count": 13,
|
186 |
"id": "a69ce9c9-f18f-4aed-80f2-53fd81311555",
|
187 |
"metadata": {},
|
188 |
"outputs": [
|
|
|
193 |
" '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.\"}"
|
194 |
]
|
195 |
},
|
196 |
+
"execution_count": 13,
|
197 |
"metadata": {},
|
198 |
"output_type": "execute_result"
|
199 |
}
|
|
|
204 |
},
|
205 |
{
|
206 |
"cell_type": "code",
|
207 |
+
"execution_count": 14,
|
208 |
"id": "14a0bc12-abe5-4dca-b97c-13577cf63ee5",
|
209 |
"metadata": {},
|
210 |
"outputs": [
|
|
|
215 |
" '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.'}"
|
216 |
]
|
217 |
},
|
218 |
+
"execution_count": 14,
|
219 |
"metadata": {},
|
220 |
"output_type": "execute_result"
|
221 |
}
|
|
|
226 |
},
|
227 |
{
|
228 |
"cell_type": "code",
|
229 |
+
"execution_count": 15,
|
230 |
"id": "7d4415fe-7d50-4c12-9039-c338651f8972",
|
231 |
"metadata": {},
|
232 |
"outputs": [
|
|
|
237 |
" '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.'}"
|
238 |
]
|
239 |
},
|
240 |
+
"execution_count": 15,
|
241 |
"metadata": {},
|
242 |
"output_type": "execute_result"
|
243 |
}
|
|
|
248 |
},
|
249 |
{
|
250 |
"cell_type": "code",
|
251 |
+
"execution_count": 16,
|
252 |
"id": "ff9959f8-4c7a-4af3-8e3e-83cfde0f227a",
|
253 |
"metadata": {},
|
254 |
"outputs": [
|
|
|
259 |
" '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.\"}"
|
260 |
]
|
261 |
},
|
262 |
+
"execution_count": 16,
|
263 |
"metadata": {},
|
264 |
"output_type": "execute_result"
|
265 |
}
|
|
|
270 |
},
|
271 |
{
|
272 |
"cell_type": "code",
|
273 |
+
"execution_count": 17,
|
274 |
"id": "54e8d283-2011-4f9a-b20e-70c90cff42be",
|
275 |
"metadata": {},
|
276 |
"outputs": [
|
|
|
281 |
" 'summary': 'This concurrent resolution expresses the sense that the Senate should provide its advice and consent to ratification of the Convention on Biological Diversity.'}"
|
282 |
]
|
283 |
},
|
284 |
+
"execution_count": 17,
|
285 |
"metadata": {},
|
286 |
"output_type": "execute_result"
|
287 |
}
|
|
|
292 |
},
|
293 |
{
|
294 |
"cell_type": "code",
|
295 |
+
"execution_count": 18,
|
296 |
"id": "cd4a017c-69d3-4891-b011-bdd19ca4a742",
|
297 |
"metadata": {},
|
298 |
"outputs": [
|
|
|
303 |
" '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.'}"
|
304 |
]
|
305 |
},
|
306 |
+
"execution_count": 18,
|
307 |
"metadata": {},
|
308 |
"output_type": "execute_result"
|
309 |
}
|
|
|
314 |
},
|
315 |
{
|
316 |
"cell_type": "code",
|
317 |
+
"execution_count": 19,
|
318 |
"id": "e2a659be-e404-447e-8a35-5dbd365e4faf",
|
319 |
"metadata": {},
|
320 |
"outputs": [
|
321 |
{
|
322 |
"data": {
|
323 |
"text/plain": [
|
324 |
+
"{'generated': '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',\n",
|
325 |
" '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.'}"
|
326 |
]
|
327 |
},
|
328 |
+
"execution_count": 19,
|
329 |
"metadata": {},
|
330 |
"output_type": "execute_result"
|
331 |
}
|
|
|
336 |
},
|
337 |
{
|
338 |
"cell_type": "code",
|
339 |
+
"execution_count": 20,
|
340 |
"id": "d859483d-a664-4eb4-8910-8c590461d48e",
|
341 |
"metadata": {},
|
342 |
"outputs": [
|
|
|
347 |
" '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.\"}"
|
348 |
]
|
349 |
},
|
350 |
+
"execution_count": 20,
|
351 |
"metadata": {},
|
352 |
"output_type": "execute_result"
|
353 |
}
|
|
|
358 |
},
|
359 |
{
|
360 |
"cell_type": "code",
|
361 |
+
"execution_count": 21,
|
362 |
"id": "c66b1673-d087-4b52-88d4-ef5990ecbd90",
|
363 |
"metadata": {},
|
364 |
"outputs": [
|
|
|
369 |
" '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.'}"
|
370 |
]
|
371 |
},
|
372 |
+
"execution_count": 21,
|
373 |
"metadata": {},
|
374 |
"output_type": "execute_result"
|
375 |
}
|
|
|
380 |
},
|
381 |
{
|
382 |
"cell_type": "code",
|
383 |
+
"execution_count": 22,
|
384 |
"id": "205ff67d-894d-40f4-814c-d9f2d3eea1d0",
|
385 |
"metadata": {},
|
386 |
"outputs": [
|
|
|
391 |
" '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).'}"
|
392 |
]
|
393 |
},
|
394 |
+
"execution_count": 22,
|
395 |
"metadata": {},
|
396 |
"output_type": "execute_result"
|
397 |
}
|
|
|
410 |
},
|
411 |
{
|
412 |
"cell_type": "code",
|
413 |
+
"execution_count": 23,
|
414 |
"id": "3a6116df-634c-4cdc-8e17-e17519f06aa7",
|
415 |
"metadata": {},
|
416 |
"outputs": [],
|
|
|
428 |
},
|
429 |
{
|
430 |
"cell_type": "code",
|
431 |
+
"execution_count": 24,
|
432 |
"id": "4351fd53-9f09-4794-b34c-092732d27ff1",
|
433 |
"metadata": {},
|
434 |
"outputs": [
|
|
|
439 |
" 'summary': 'Saving Access to Laboratory Services Act This bill modifies provisions relating to Medicare payment rates for clinical diagnostic laboratory services, including by requiring payment rates for certain widely available clinical diagnostic laboratory tests to be based on a statistical sampling of private sector rates.'}"
|
440 |
]
|
441 |
},
|
442 |
+
"execution_count": 24,
|
443 |
"metadata": {},
|
444 |
"output_type": "execute_result"
|
445 |
}
|
|
|
450 |
},
|
451 |
{
|
452 |
"cell_type": "code",
|
453 |
+
"execution_count": 25,
|
454 |
"id": "f8f57bd4-5082-4c0a-a61b-523814f60db6",
|
455 |
"metadata": {},
|
456 |
"outputs": [
|
457 |
{
|
458 |
"data": {
|
459 |
"text/plain": [
|
460 |
+
"{'generated': 'USDA must periodically review and revise the plan, as necessary, and annually report on its implementation. Additionally, the bill expands the scope of various USDA research, extension, and education programs; conservation programs; and livestock programs to incorporate climate change adaptation and mitigation. Expanded activities include efforts to improve soil health and preserve farmland and grassland. Further, the Bill changes programs that support renewable energy in rural areas to address carbon emissions in the agriculture sector.',\n",
|
461 |
" 'summary': 'Agriculture Resilience Act of 2023 This bill establishes, expands, and revises multiple programs and activities of the Department of Agriculture (USDA) primarily to reduce carbon emissions from the agriculture sector. Specifically, USDA must finalize and implement a plan to achieve net-zero emissions from the sector by 2040. USDA must periodically review and revise the plan, as necessary, and annually report on its implementation. Additionally, the bill expands the scope of various USDA research, extension, and education programs; conservation programs; and livestock programs to incorporate climate change adaptation and mitigation. Expanded activities include efforts to improve soil health and preserve farmland and grassland. Further, the bill changes programs that support renewable energy in rural areas to address carbon emissions in the agriculture sector. Among these changes, the bill provides statutory authority for the AgSTAR program for reducing methane emissions from livestock waste and requires the program to be moved from the Environmental Protection Agency to USDA. The bill also addresses food waste, for example, by (1) standardizing the voluntary labels used by food producers to indicate the date by which food should be used or discarded, and (2) making composting activities eligible for support through USDA conservation programs. Moreover, the bill establishes grants to reduce and prevent food waste in landfills and in schools.'}"
|
462 |
]
|
463 |
},
|
464 |
+
"execution_count": 25,
|
465 |
"metadata": {},
|
466 |
"output_type": "execute_result"
|
467 |
}
|
|
|
480 |
},
|
481 |
{
|
482 |
"cell_type": "code",
|
483 |
+
"execution_count": 28,
|
484 |
"id": "e869ae4a-6126-4256-98b4-4c36556e4cec",
|
485 |
"metadata": {},
|
486 |
"outputs": [],
|
487 |
"source": [
|
488 |
+
"import evaluate\n",
|
489 |
+
"\n",
|
490 |
+
"rouge = evaluate.load(\"rouge\")\n",
|
491 |
+
"\n",
|
492 |
"def ROUGE_evaluate(data_set : list):\n",
|
493 |
" data = data_set\n",
|
494 |
" for i in range(len(data)):\n",
|
|
|
509 |
},
|
510 |
{
|
511 |
"cell_type": "code",
|
512 |
+
"execution_count": 29,
|
513 |
"id": "9d9df0d5-8436-44e2-8be8-01ba1f699436",
|
514 |
"metadata": {},
|
515 |
"outputs": [
|
|
|
550 |
},
|
551 |
{
|
552 |
"cell_type": "code",
|
553 |
+
"execution_count": 30,
|
554 |
"id": "342d6f20-3992-4a4e-b68b-0c67b80674af",
|
555 |
"metadata": {},
|
556 |
"outputs": [
|
|
|
559 |
"output_type": "stream",
|
560 |
"text": [
|
561 |
"{'rouge1': 0.9545454545454546, 'rouge2': 0.9069767441860465, 'rougeL': 0.9545454545454546, 'rougeLsum': 0.9545454545454546}\n",
|
562 |
+
"{'rouge1': 0.5190311418685121, 'rouge2': 0.5156794425087108, 'rougeL': 0.5190311418685121, 'rougeLsum': 0.5190311418685121}\n"
|
563 |
]
|
564 |
}
|
565 |
],
|
|
|
570 |
{
|
571 |
"cell_type": "code",
|
572 |
"execution_count": null,
|
573 |
+
"id": "5440b405-19fe-4a11-860b-0cbf37227e11",
|
574 |
"metadata": {},
|
575 |
"outputs": [],
|
576 |
"source": []
|