tag:blogger.com,1999:blog-1693014329567144872.post5885644632137894746..comments2023-08-27T06:49:20.658+01:00Comments on The Glowing Python: Text summarization with NLTKJustGlowinghttp://www.blogger.com/profile/17212021288715206641noreply@blogger.comBlogger88125tag:blogger.com,1999:blog-1693014329567144872.post-40994885366968730502022-01-21T07:42:42.477+00:002022-01-21T07:42:42.477+00:00this example was written using python 2 and urllib...this example was written using python 2 and urllib2 doesn't exist in python 3. You need to use urllib.requestJustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-41353871811905150702022-01-21T06:58:07.275+00:002022-01-21T06:58:07.275+00:00Hello sir, im getting the following error. Could y...Hello sir, im getting the following error. Could you please help?<br />ModuleNotFoundError: No module named 'urllib2'<br /><br />i have tried to install the it on cmd but it throws the following error<br />ERROR: Could not find a version that satisfies the requirement urllib2 (from versions: none)<br />ERROR: No matching distribution found for urllib2<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-59183465198263985652021-04-26T09:35:57.547+01:002021-04-26T09:35:57.547+01:00hi there, please check previous comments.hi there, please check previous comments.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-61161279594380953892021-04-26T09:32:33.487+01:002021-04-26T09:32:33.487+01:00# frequencies normalization and fitering
32 ... # frequencies normalization and fitering<br /> 32 m = float(max(freq.values()))<br />---> 33 for w in freq.keys():<br /> 34 freq[w] = freq[w]/m<br /> 35 if freq[w] >= self._max_cut or freq[w] <= self._min_cut:<br /><br />RuntimeError: dictionary changed size during iterationAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-5216532592110050542020-05-12T19:20:04.259+01:002020-05-12T19:20:04.259+01:00Hi Guglielmo, you can open a local file with the f...Hi Guglielmo, you can open a local file with the function open(). Once you open the file you need to read the file in memory and that depends on the file is structured.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-73128856309146777122020-05-12T18:42:49.481+01:002020-05-12T18:42:49.481+01:00Hello, very useful and interesting algorithm. I...Hello, very useful and interesting algorithm. I'm new to python. May I ask how to modify the algorithm to parse and summarize text from a local txt file?<br /><br />Many thanksGuglielmohttps://www.blogger.com/profile/17935081177328742455noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-81061434857362848632019-12-02T08:27:11.083+00:002019-12-02T08:27:11.083+00:00Hi Cynthia,
I wrote this using a paper I read qui...Hi Cynthia,<br /><br />I wrote this using a paper I read quite a long ago. Unfortunately I can't find it anymore.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-88330457784519607222019-12-01T18:33:40.630+00:002019-12-01T18:33:40.630+00:00Hello,
Is this your own algorithm for summarizatio...Hello,<br />Is this your own algorithm for summarization? If not, which method did you used? Can I get a paper about this method? Please, help me out!Cynthiahttps://www.blogger.com/profile/00607646287267607462noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-15000498960548422682018-09-14T06:36:08.635+01:002018-09-14T06:36:08.635+01:00what if two sentences have same ranking.. How will...what if two sentences have same ranking.. How will be the sentences ranked in summary Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-23676762200311111902018-05-01T09:10:50.247+01:002018-05-01T09:10:50.247+01:00see my comment belowsee my comment belowSushant Gautamhttps://www.blogger.com/profile/05917327922253709178noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-78801332023166208402018-05-01T09:10:12.553+01:002018-05-01T09:10:12.553+01:00It seem that many of you have the urllib2 error ge...It seem that many of you have the urllib2 error generally in python3: The simple solution to this i found as:<br />import urllib.request<br />#and<br />req = urllib.request.Request(url)<br />page = urllib.request.urlopen(req).read().decode('utf8')<br />soup = BeautifulSoup(page,"html5lib")<br /><br />The another thing is to mention "html5lib" in BeautifulSoup to remove parser error.<br />Others are seem to correct<br /><br />Sushant Gautamhttps://www.blogger.com/profile/05917327922253709178noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-86698396955401308892018-03-22T17:40:33.432+00:002018-03-22T17:40:33.432+00:00I had the same issue,I solved it by removind a lea...I had the same issue,I solved it by removind a leading blank space for that lineAnonymoushttps://www.blogger.com/profile/11727322938206759779noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-63739427091204464192018-03-22T13:50:48.753+00:002018-03-22T13:50:48.753+00:00Check the comments above.Check the comments above.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-11106401464627681212018-03-22T13:45:52.277+00:002018-03-22T13:45:52.277+00:0031 # frequencies normalization and fitering
... 31 # frequencies normalization and fitering<br /> 32 m = float(max(freq.values()))<br />---> 33 for w in freq.keys():<br /> 34 freq[w] = freq[w]/m<br /> 35 if freq[w] >= self._max_cut or freq[w] <= self._min_cut:<br /><br />RuntimeError: dictionary changed size during iterationAnonymoushttps://www.blogger.com/profile/05089049326170580587noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-77119805758040127102018-02-05T11:34:34.947+00:002018-02-05T11:34:34.947+00:00Hi i've been having error on this line "f...Hi i've been having error on this line "for article_url in to_summarize[:5]:" I have python3 and i tried a lot fixing this error but couldnt. Can you please help? It would mean everything!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-13166317621665248952018-02-05T11:32:01.373+00:002018-02-05T11:32:01.373+00:00Did you solve this error Tarun? I am having the sa...Did you solve this error Tarun? I am having the same errorAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-51799316061552102122018-02-05T11:28:45.525+00:002018-02-05T11:28:45.525+00:00Hi i've been having error on this line "f...Hi i've been having error on this line "for article_url in to_summarize[:5]:" I have python3 and i tried a lot fixing this error but couldnt. Can you please help? It would mean everything!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-65779629856541661512018-01-09T14:48:42.145+00:002018-01-09T14:48:42.145+00:00Can you please tell me how to remove the error or ...Can you please tell me how to remove the error or urllib2? it is continuously giving this error and my python is not installing urllib2. Please Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-74276007387392153252017-12-11T14:08:17.129+00:002017-12-11T14:08:17.129+00:00This error is resolved.I am getting new error.
ti...This error is resolved.I am getting new error.<br /><br />title= fs.get_only_text(aa)<br />TypeError: get_only_text() takes exactly 1 argument (2 given)Anonymoushttps://www.blogger.com/profile/10892511453627145975noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-4357242565740771362017-12-11T09:08:44.865+00:002017-12-11T09:08:44.865+00:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/10892511453627145975noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-48878930602477309342017-12-10T07:57:24.715+00:002017-12-10T07:57:24.715+00:00Did you copy the function get_only_text ?Did you copy the function get_only_text ?JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-13868008209866680212017-12-10T07:51:14.717+00:002017-12-10T07:51:14.717+00:00Did you copy the function get_only_text ? Did you copy the function get_only_text ? JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-53900186987352134072017-12-10T07:44:49.886+00:002017-12-10T07:44:49.886+00:00title, text = get_only_text(url)
NameError: name &...title, text = get_only_text(url)<br />NameError: name 'get_only_text' is not defined<br /><br />I am getting this error in the last. Please help me to solve it out.Anonymoushttps://www.blogger.com/profile/10892511453627145975noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-75765625644979546372017-11-24T17:39:39.695+00:002017-11-24T17:39:39.695+00:00Thanks for this, is it possible to summarize email...Thanks for this, is it possible to summarize emails and chats, where the text is extracted and summarized for the conversation or thread?Anonymoushttps://www.blogger.com/profile/01759538569338105467noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-76802199787572845162017-11-06T06:53:46.866+00:002017-11-06T06:53:46.866+00:00It looks same as original what was the changes tha...It looks same as original what was the changes that you made to make it work in python3?Anonymoushttps://www.blogger.com/profile/14626045164519565936noreply@blogger.com