krotima1
commited on
Commit
•
910bd8b
1
Parent(s):
9fa247a
feat: add summarizer
Browse files- MultilingualSummarizer.ipynb +232 -0
MultilingualSummarizer.ipynb
ADDED
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"# Multilingual Summarizer\n",
|
8 |
+
"- Feel free to play with models\n",
|
9 |
+
"- Gpus recommended due to faster summarization\n",
|
10 |
+
"- Firstly, include necessary .py files or clone git repo"
|
11 |
+
]
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"cell_type": "code",
|
15 |
+
"execution_count": null,
|
16 |
+
"metadata": {},
|
17 |
+
"outputs": [],
|
18 |
+
"source": [
|
19 |
+
"import torch as pt\n",
|
20 |
+
"import numpy as np\n",
|
21 |
+
"import pandas as pd\n",
|
22 |
+
"\n",
|
23 |
+
"from collections import OrderedDict\n",
|
24 |
+
"\n",
|
25 |
+
"from transformers import AutoModelForSeq2SeqLM\n",
|
26 |
+
"from transformers import AutoTokenizer\n",
|
27 |
+
"import datasets\n",
|
28 |
+
"\n",
|
29 |
+
"import re\n",
|
30 |
+
"import logging\n",
|
31 |
+
"logging.basicConfig(level=logging.INFO, format='%(asctime)s | %(name)s | %(levelname)s | %(message)s')\n",
|
32 |
+
"\n",
|
33 |
+
"# These files need to be included\n",
|
34 |
+
"from summarization.tokenizer import DatasetTokenizer\n",
|
35 |
+
"from summarization.summarizer import Summarizer\n",
|
36 |
+
"from summarization.summarization_metrics import MetricsComputation\n",
|
37 |
+
"\n",
|
38 |
+
"\n",
|
39 |
+
"\n",
|
40 |
+
"## READ THIS (To run):\n",
|
41 |
+
"# clone this git repo: https://gitlab.fel.cvut.cz/factchecking/experimental-marian-krotil\n",
|
42 |
+
"# insert this .ipynb file into the -/tree/main/projects/python/git_krotima1/source directory\n",
|
43 |
+
"# --> due to the included files / or copy them directly to this notebook\n",
|
44 |
+
"\n",
|
45 |
+
"class MultiSummarizer:\n",
|
46 |
+
" \n",
|
47 |
+
" ## Constructor\n",
|
48 |
+
" # input: model_name : string : Huggingface checkpoint (ctu-aic/m2m100-418M-multilingual-summarization-multilarge-cs, ctu-aic/mt5-base-multilingual-summarization-multilarge-cs, ctu-aic/mbart25-multilingual-summarization-multilarge-cs)\n",
|
49 |
+
" # language : string : cs, en, de, fr, es, tr, ru, zh\n",
|
50 |
+
" # inference_cfg : dict : parameters of generation method\n",
|
51 |
+
" #\n",
|
52 |
+
" # \n",
|
53 |
+
" #\n",
|
54 |
+
" def __init__(self, model_name, language, inference_cfg=None, **kwargs):\n",
|
55 |
+
" logging.info(f\"Initializing multilingual summarizer {model_name}\")\n",
|
56 |
+
" self.name = model_name.split('/')[-1]\n",
|
57 |
+
" self.model = AutoModelForSeq2SeqLM.from_pretrained(model_name)\n",
|
58 |
+
" self.dstTokenizer = DatasetTokenizer(self.name, model_name, language)\n",
|
59 |
+
" self.tokenizer = self.dstTokenizer.get_tokenizer()\n",
|
60 |
+
" self.langid = self.dstTokenizer.get_langid()\n",
|
61 |
+
" self.lang_token = self.dstTokenizer.get_lang_token()\n",
|
62 |
+
" self.inference_cfg = inference_cfg\n",
|
63 |
+
" self.enc_max_len = 512\n",
|
64 |
+
" self.language = language\n",
|
65 |
+
" #cuda/cpu device\n",
|
66 |
+
" if pt.cuda.is_available():\n",
|
67 |
+
" self.model.cuda()\n",
|
68 |
+
"\n",
|
69 |
+
"\n",
|
70 |
+
" ## Function __call__\n",
|
71 |
+
" # input: texts - (list of strings, string, dataset) - texts in selected language to summarize\n",
|
72 |
+
" # golds - (None, list of strings, string) - target summary - if provided the ROUGE scores are computed\n",
|
73 |
+
" # inference_cfg - dictionary with configuration of generation method\n",
|
74 |
+
" # text_column - if texts is in the dataset type, it is column which will be summarized\n",
|
75 |
+
" # \n",
|
76 |
+
" # output: tuple (list of summaries, - {} empty dic if no golds)\n",
|
77 |
+
" # - dict of ROUGE scores if golds are given)\n",
|
78 |
+
" # functionality:\n",
|
79 |
+
" # - converts input to the Huggingface datasets if not provided\n",
|
80 |
+
" # - tokenize & summarize input texts\n",
|
81 |
+
" # - compute scores based on passed arguments\n",
|
82 |
+
" # \n",
|
83 |
+
" def __call__(self, texts, golds=None, inference_cfg=None, text_column=\"\", **kwargs):\n",
|
84 |
+
" \n",
|
85 |
+
" #check input\n",
|
86 |
+
" golds = [golds] if type(golds) == str else golds\n",
|
87 |
+
" assert golds is None or type(golds) == list and type(golds[0]) == str, \"Golds: Expected type: None, string or list of strings\"\n",
|
88 |
+
" \n",
|
89 |
+
" if type(texts) != datasets.Dataset:\n",
|
90 |
+
" texts = [texts] if type(texts) == str else texts\n",
|
91 |
+
" assert type(texts) == list and type(texts[0]) == str, \"Texts: Expected type: dataset, string or list of strings\"\n",
|
92 |
+
" \n",
|
93 |
+
" \n",
|
94 |
+
" self.inference_cfg = inference_cfg if inference_cfg is not None else self.inference_cfg\n",
|
95 |
+
" logging.info(f\"Summarizing data with the generation config: {self.inference_cfg}\")\n",
|
96 |
+
" \n",
|
97 |
+
" #get hgft dataset\n",
|
98 |
+
" dst = datasets.DatasetDict()\n",
|
99 |
+
" if type(texts) != datasets.Dataset:\n",
|
100 |
+
" df = pd.DataFrame({'text': texts})\n",
|
101 |
+
" dst[\"test\"] = datasets.Dataset.from_pandas(df)\n",
|
102 |
+
" else:\n",
|
103 |
+
" dst[\"test\"] = texts\n",
|
104 |
+
" \n",
|
105 |
+
" \n",
|
106 |
+
" #Tokenize input texts\n",
|
107 |
+
" text_column = 'text' if text_column == \"\" else text_column\n",
|
108 |
+
" cfg = {\"text_column\": text_column}\n",
|
109 |
+
" \n",
|
110 |
+
" tok_dst = self.dstTokenizer.tokenize(dst, encoder_input_ids=self.enc_max_len, decoder_input_ids=None,**cfg)[\"test\"]\n",
|
111 |
+
" \n",
|
112 |
+
" #Init Summarizer\n",
|
113 |
+
" summarizer = Summarizer(model = self.model, tokenizer = self.tokenizer,lcode=self.langid, batch_size = 8)\n",
|
114 |
+
" \n",
|
115 |
+
" #Summarize texts\n",
|
116 |
+
" filter_fc = self._filter_final_summaries if self.name.startswith('mt5') else None\n",
|
117 |
+
" summarizer.summarize_dst(tok_dst, filter_fc_batch = filter_fc,**self.inference_cfg)\n",
|
118 |
+
" \n",
|
119 |
+
" \n",
|
120 |
+
" scores = {}\n",
|
121 |
+
" if golds is not None:\n",
|
122 |
+
" #compute scores if gold texts are provided\n",
|
123 |
+
" metrics = MetricsComputation(self.language)\n",
|
124 |
+
" scores = metrics.compute_scores(gold = golds, summary=summarizer.summarized_dst['summary'])\n",
|
125 |
+
" \n",
|
126 |
+
" \n",
|
127 |
+
" return (summarizer.summarized_dst['summary'], scores)\n",
|
128 |
+
" \n",
|
129 |
+
" def _filter_final_summaries(self, batch, **kwargs):\n",
|
130 |
+
" batch[\"summary\"] = [ re.sub(self.lang_token, '', tmp) for tmp in batch[\"summary\"]]\n",
|
131 |
+
" return batch"
|
132 |
+
]
|
133 |
+
},
|
134 |
+
{
|
135 |
+
"cell_type": "code",
|
136 |
+
"execution_count": null,
|
137 |
+
"metadata": {},
|
138 |
+
"outputs": [],
|
139 |
+
"source": [
|
140 |
+
"## Configuration of summarization pipeline\n",
|
141 |
+
"#\n",
|
142 |
+
"def summ_config():\n",
|
143 |
+
" cfg = OrderedDict([\n",
|
144 |
+
" \n",
|
145 |
+
" ## summarization model - checkpoint\n",
|
146 |
+
" # ctu-aic/m2m100-418M-multilingual-summarization-multilarge-cs\n",
|
147 |
+
" # ctu-aic/mt5-base-multilingual-summarization-multilarge-cs\n",
|
148 |
+
" # ctu-aic/mbart25-multilingual-summarization-multilarge-cs\n",
|
149 |
+
" (\"model_name\", \"ctu-aic/mt5-base-multilingual-summarization-multilarge-cs\"),\n",
|
150 |
+
" \n",
|
151 |
+
" ## language of summarization task\n",
|
152 |
+
" # language : string : cs, en, de, fr, es, tr, ru, zh\n",
|
153 |
+
" (\"language\", \"en\"), \n",
|
154 |
+
" \n",
|
155 |
+
" ## generation method parameters in dictionary\n",
|
156 |
+
" #\n",
|
157 |
+
" (\"inference_cfg\", OrderedDict([\n",
|
158 |
+
" (\"num_beams\", 4),\n",
|
159 |
+
" (\"top_k\", 40),\n",
|
160 |
+
" (\"top_p\", 0.92),\n",
|
161 |
+
" (\"do_sample\", True),\n",
|
162 |
+
" (\"temperature\", 0.89),\n",
|
163 |
+
" (\"repetition_penalty\", 1.2),\n",
|
164 |
+
" (\"no_repeat_ngram_size\", None),\n",
|
165 |
+
" (\"early_stopping\", True),\n",
|
166 |
+
" (\"max_length\", 128),\n",
|
167 |
+
" (\"min_length\", 10),\n",
|
168 |
+
" ])),\n",
|
169 |
+
" #texts to summarize values = (list of strings, string, dataset)\n",
|
170 |
+
" (\"texts\",\n",
|
171 |
+
" [\n",
|
172 |
+
" 'Havana, Cuba (CNN)All eyes are going to be on the new kid finally allowed to play and the big kid who for so long wanted nothing to do with him -- Cuba and the United States in the same diplomatic playground. Cuba pulled off a diplomatic coup by marshaling the support of other regional countries to insist on their attendance at the Summit of the Americas. And for the first time since 1962, the U.S. has not blocked Cuba\\'s attempt to join. Now it\\'s time to see how they play and who they play with -- especially Venezuela, which often falls out with Washington for crushing dissent at home and supplying Havana with billions of dollars in oil. Cuba is trying to re-establish itself at the two-day summit in Panama, arriving with more than 100 government officials, diplomats, small business people and artists. But Cuba\\'s attempts to rebrand itself as an open, diverse society stumbled Wednesday when government supporters and anti-Castro supporters brawled in the streets of Panama. Video of the incident showed Cuban government officials exchanging punches and insults with dissidents until Panamanian police in riot gear broke up the melee. With the historic thawing in relations between the U.S. and Cuba, Washington now has urgent business to discuss with Havana. \"We have really big issues with the Cubans that do need to be solved,\" said Ambassador Vicki Huddleston, who served as the chief of the U.S. Interests Section in Havana. She added \"The Cubans are typical of their negotiating style. You think it\\'s going to be easy because we have said \\'We are going to have good relations with you\\' and they say, \\'That\\'s not exciting for us and it is for you.\\' So they are hard negotiators as they always have been.\" The forum could provide the opportunity to push forward an agreement to re-establish formal relations and re-open embassies after nearly four months of negotiations. While President Barack Obama is not scheduled to meet Cuban leader Raul Castro, U.S. officials said there will be opportunities for \"interaction\" between the two leaders. The first time the two heads of state met was in 2013 at Nelson Mandela\\'s funeral. Their brief handshake captured the world\\'s attention and lit up social media. Few people then knew that the two countries were secretly involved in negotiations to thaw five decades of deadlocked Cold War-era relations. Obama had said he had hoped a U.S. Embassy would reopen in Havana before the summit, but Cuban officials have said they cannot imagine a full restoration of diplomatic ties until Cuba is removed from the U.S. State Department list of countries that support terrorism. \"It would be difficult to explain that diplomatic relations have been resumed while Cuba has been unjustly listed as a state sponsor of international terrorism,\" said Josefina Vidal, the general director of U.S. affairs at the Cuban Foreign Ministry and lead negotiator in the talks. Cuba was added to the list in 1982, which includes Syria, Iran and Sudan. The designation carries financial sanctions which Cuban officials say further damages their already ailing economy. The State Department has sent a recommendation to the White House that Cuba be removed, paving the way for the White House to announce its intent to de-list Cuba as early as this week, two administration officials told CNN. Removal from the list \"does not relate to whether or not we agree with everything a country does or whether we agree with its political system, or its foreign policy,\" Deputy National Security Adviser Ben Rhodes said on a conference call with reporters Tuesday. \"It\\'s a very practical review as to whether or not a government is sponsoring terrorism.\" Rhodes also dialed backed rhetoric on Venezuela, saying the country did not pose a national security threat to the United States, despite a recent declaration to that effect. The designation was meant to allow officials to target seven allegedly corrupt Venezuelan officials, but it ignited a firestorm, particularly in Cuba, which has close ties to Venezuela. Deceased Venezuelan President Hugo Chavez was a friend and admirer of former Cuban leader Fidel Castro. Chavez\\'s successor Nicolas Maduro continues to send Cuba tens of thousands of barrels of oil each day, despite his country\\'s own economic turmoil. In exchange, Cuba sends doctors, military advisers and sports trainers to Venezuela. In Cuba\\'s state-run media, criticism of U.S. policy towards Venezuela has overshadowed the improvement in U.S.-Cuba relations. In March, Fidel Castro published a letter criticizing the U.S.\\' \"brutal plans towards\" Venezuela and the Cuban government promised \"unconditional aid\" to help defend against American threats. Its remains to be seen how much Cuba will risk its warming relations with the United States to back up ally Venezuela. But apparently there is little doubt among the Cuban people on what their government should do. A poll of 1,200 Cubans released on Wednesday found that 97% of the people surveyed by Miami-based polling firm Bendixen & Amandi on behalf of The Washington Post and Univision Noticias/Fusion supported improved U.S.-Cuban relations.'\n",
|
173 |
+
" ,\n",
|
174 |
+
" '(CNN)The Palestinian Authority officially became the 123rd member of the International Criminal Court on Wednesday, a step that gives the court jurisdiction over alleged crimes in Palestinian territories. The formal accession was marked with a ceremony at The Hague, in the Netherlands, where the court is based. The Palestinians signed the ICC\\'s founding Rome Statute in January, when they also accepted its jurisdiction over alleged crimes committed \"in the occupied Palestinian territory, including East Jerusalem, since June 13, 2014.\" Later that month, the ICC opened a preliminary examination into the situation in Palestinian territories, paving the way for possible war crimes investigations against Israelis. As members of the court, Palestinians may be subject to counter-charges as well. Israel and the United States, neither of which is an ICC member, opposed the Palestinians\\' efforts to join the body. But Palestinian Foreign Minister Riad al-Malki, speaking at Wednesday\\'s ceremony, said it was a move toward greater justice. \"As Palestine formally becomes a State Party to the Rome Statute today, the world is also a step closer to ending a long era of impunity and injustice,\" he said, according to an ICC news release. \"Indeed, today brings us closer to our shared goals of justice and peace.\" Judge Kuniko Ozaki, a vice president of the ICC, said acceding to the treaty was just the first step for the Palestinians. \"As the Rome Statute today enters into force for the State of Palestine, Palestine acquires all the rights as well as responsibilities that come with being a State Party to the Statute. These are substantive commitments, which cannot be taken lightly,\" she said. Rights group Human Rights Watch welcomed the development. \"Governments seeking to penalize Palestine for joining the ICC should immediately end their pressure, and countries that support universal acceptance of the court\\'s treaty should speak out to welcome its membership,\" said Balkees Jarrah, international justice counsel for the group. \"What\\'s objectionable is the attempts to undermine international justice, not Palestine\\'s decision to join a treaty to which over 100 countries around the world are members.\" In January, when the preliminary ICC examination was opened, Israeli Prime Minister Benjamin Netanyahu described it as an outrage, saying the court was overstepping its boundaries. The United States also said it \"strongly\" disagreed with the court\\'s decision. \"As we have said repeatedly, we do not believe that Palestine is a state and therefore we do not believe that it is eligible to join the ICC,\" the State Department said in a statement. It urged the warring sides to resolve their differences through direct negotiations. \"We will continue to oppose actions against Israel at the ICC as counterproductive to the cause of peace,\" it said. But the ICC begs to differ with the definition of a state for its purposes and refers to the territories as \"Palestine.\" While a preliminary examination is not a formal investigation, it allows the court to review evidence and determine whether to investigate suspects on both sides. Prosecutor Fatou Bensouda said her office would \"conduct its analysis in full independence and impartiality.\" The war between Israel and Hamas militants in Gaza last summer left more than 2,000 people dead. The inquiry will include alleged war crimes committed since June. The International Criminal Court was set up in 2002 to prosecute genocide, crimes against humanity and war crimes. CNN\\'s Vasco Cotovio, Kareem Khadder and Faith Karimi contributed to this report.'\n",
|
175 |
+
" #\"Tady je deset dní držel! První pohled do šíleného úkrytu unesených dětí. Interiér vůbec neodpovídá běžným garážím – stěny jsou obložené izolací, na zemi dlažba a koberec, dvě matrace. „Byl tam nedodělanej sprchovej kout, měl tam vařák na jídlo, stůl, dvě nový matrace na sobě, deky, polštář, ledničku a záchod,“ popsal serveru iDnes.cz Daniel. Garáž měla troje dveře, jedny na klíč, jedny na číselný kód. Protihluková izolace, kterou byl objekt doslova obalený, byla patrná zejména na střeše a zadní stěně zvenku. Zbývá si položit jednu otázku – jak dlouho únosce celou věc plánoval?Už večer před nalezením dvou unesených dětí byla policie v areálu garáží, kde byli vězněni šestnáctiletý chlapec a o tři roky mladší dívka z Litoměřicka. „Nic nenasvědčovalo tomu, že by se tam nacházeli,“ řekl novinářům náměstek ředitele krajské policie Zbyněk Dvořák. Děti nalezli v garáži na ústeckém Střekově minulou středu dopoledne rodiče. Z únosu dětí je obviněn šestatřicetiletý recidivista Zdeněk H. Děti držel od 28. srpna do 7. září. Policie sestavila speciální tým, který bude prověřovat mimo jiné i to, zda se nedopustil dalších skutků.Policie podle Dvořáka při pátrání prověřovala desítky oznámení, podle kterých měly být děti viděny v různých částech Ústeckého kraje, Česka i v zahraničí. Klíčovou roli sehrály v případu dopisy, které dostaly rodiny 6. září. Kriminalisté se primárně zabývali Doksy a okolí, odkud byl dopis odeslaný. „Navíc chlapec měl vztah k Doksům, byli tam na dovolené. Některé indicie šly tam, že je pravděpodobné, že jsou v té lokalitě. I po téhle stopě se 6. a zejména 7. září ráno šlo,“ vysvětlila vedoucí litoměřické policie Helena Pšeničková.Obsah dopisů zkoumali rodiny i písmoznalci. Řada slov byla opakovaně přeškrtaná a přepsaná. „Slova dávala význam střecha, střela, Střekov, současně probíhalo pátrání na Střeleckém ostrově. Dochází k tomu, že večer dostáváme informaci od rodiny, že relevantní má být opravdu Střekov. Kolem desáté hodiny večer probíhá prověrka na místě v areálu těch garáží. Děti nebyly nalezeny. Nic nenasvědčuje tomu, že se tam v tu dobu nacházejí,“ řekl Dvořák.Druhý den ráno se ke garážím vypravili rodiče chlapce. „Informují nás o tom, že z jedné z těch garáží je slyšet hudba,“ doplnil Dvořák. Po prověření zvukových signálů policie do garáže vnikla.Muži hrozí podle stávající právní kvalifikace až osm let vězení. Čelí obvinění z vydírání, zbavení osobní svobody, ohrožování výchovy mládeže a šíření pornografie.Kriminalisté potvrdili, že podezřelým je majitel garáže na Střekově. Je jím šestatřicetiletý recidivista, který byl už před lety odsouzen za pokusy o únos malých dívek na Českolipsku. Soud ho v sobotu poslal do vazby.\",\n",
|
176 |
+
" ]\n",
|
177 |
+
" ),\n",
|
178 |
+
" #Target summaries values = (list of strings, string, None)\n",
|
179 |
+
" ('golds',\n",
|
180 |
+
" [\n",
|
181 |
+
" \"Cuba pulled off a diplomatic coup by gaining attendance at Summit of the Americas. First time since 1962, the U.S. has not blocked Cuba's attempt to join. Cuba is trying to re-establish itself at the two-day summit in Panama.\",\n",
|
182 |
+
" 'Membership gives the ICC jurisdiction over alleged crimes committed in Palestinian territories since last June. Israel and the United States opposed the move, which could open the door to war crimes investigations against Israelis.'\n",
|
183 |
+
" ]),\n",
|
184 |
+
" ])\n",
|
185 |
+
" return cfg\n",
|
186 |
+
"\n",
|
187 |
+
"cfg = summ_config()\n",
|
188 |
+
"msummarizer = MultiSummarizer(**cfg)\n",
|
189 |
+
"ret = msummarizer(**cfg)\n"
|
190 |
+
]
|
191 |
+
},
|
192 |
+
{
|
193 |
+
"cell_type": "code",
|
194 |
+
"execution_count": null,
|
195 |
+
"metadata": {},
|
196 |
+
"outputs": [],
|
197 |
+
"source": [
|
198 |
+
"ret = msummarizer(**cfg)\n",
|
199 |
+
"print(ret)"
|
200 |
+
]
|
201 |
+
},
|
202 |
+
{
|
203 |
+
"cell_type": "code",
|
204 |
+
"execution_count": null,
|
205 |
+
"metadata": {},
|
206 |
+
"outputs": [],
|
207 |
+
"source": []
|
208 |
+
}
|
209 |
+
],
|
210 |
+
"metadata": {
|
211 |
+
"kernelspec": {
|
212 |
+
"display_name": "Python 3",
|
213 |
+
"language": "python",
|
214 |
+
"name": "python3"
|
215 |
+
},
|
216 |
+
"language_info": {
|
217 |
+
"codemirror_mode": {
|
218 |
+
"name": "ipython",
|
219 |
+
"version": 3
|
220 |
+
},
|
221 |
+
"file_extension": ".py",
|
222 |
+
"mimetype": "text/x-python",
|
223 |
+
"name": "python",
|
224 |
+
"nbconvert_exporter": "python",
|
225 |
+
"pygments_lexer": "ipython3",
|
226 |
+
"version": "3.6.8"
|
227 |
+
},
|
228 |
+
"orig_nbformat": 4
|
229 |
+
},
|
230 |
+
"nbformat": 4,
|
231 |
+
"nbformat_minor": 2
|
232 |
+
}
|