Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > summarize text

Reply
Thread Tools

summarize text

 
 
robin
Guest
Posts: n/a
 
      05-29-2006
hello list,

does anyone know of a library which permits to summarise text? i've
been looking at nltk but haven't found anything yet. any help would be
very welcome.
thank you all in advance,

robin

 
Reply With Quote
 
 
 
 
Tim Chase
Guest
Posts: n/a
 
      05-29-2006
> does anyone know of a library which permits to summarise text?
> i've been looking at nltk but haven't found anything yet. any
> help would be very welcome.


Well, summarizing text is one of those things that generally
takes a brain-cell or two to do. Automating the process would
require doing it either smartly (some sort of
neural-net/NLP/Markov-chain technology, which is a non-trivial
task--something one might consider braving in the 3rd or 4th-year
of a university computer-science program), or doing it fairly
dumbly. As an example of a "dumb" solution, you can use regexps
to trim off the first few words and the last few words and call
that a "summary":

>>> import re
>>> r = re.compile(r'^(.{8}.*?\b)\s.*\s(\b.{8}.*?)', re.DOTALL)
>>> s = """This is the first line

.... and it has a second line
.... and a third line
.... and the last line is the fourth line."""
>>> result = r.sub(r"\1...\2",s.strip())
>>> result

'This is the...fourth line.'

You can adjust the "{8}" portions for more or less
leader/trailing context characters.

The regexp might need a bit of tweaking for somewhat short
strings, but if they're fairly short, one might not need to
summarize them

-tkc






 
Reply With Quote
 
 
 
 
gene tani
Guest
Posts: n/a
 
      05-29-2006

robin wrote:
> hello list,
>
> does anyone know of a library which permits to summarise text? i've
> been looking at nltk but haven't found anything yet. any help would be


unclear what you're asking, maybe look at:
http://www.cs.waikato.ac.nz/~ml/weka/index.html

http://www.kdnuggets.com/software/suites.html
http://www.ailab.si/orange

http://mallet.cs.umass.edu/index.php/Main_Page
http://minorthird.sourceforge.net/
http://www.dia.uniroma3.it/db/roadRunner/

http://www.lemurproject.org/

 
Reply With Quote
 
robin
Guest
Posts: n/a
 
      05-31-2006
thanks for all your replies. lemur looks pretty interesting!
robin

gene tani wrote:
> robin wrote:
> > hello list,
> >
> > does anyone know of a library which permits to summarise text? i've
> > been looking at nltk but haven't found anything yet. any help would be

>
> unclear what you're asking, maybe look at:
> http://www.cs.waikato.ac.nz/~ml/weka/index.html
>
> http://www.kdnuggets.com/software/suites.html
> http://www.ailab.si/orange
>
> http://mallet.cs.umass.edu/index.php/Main_Page
> http://minorthird.sourceforge.net/
> http://www.dia.uniroma3.it/db/roadRunner/
>
> http://www.lemurproject.org/


 
Reply With Quote
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      06-05-2006
.... sorry, I thought you said "summarize Proust".


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you help me summarize all the bad things with global variables? DeMarcus C++ 13 09-14-2010 05:43 PM
summarize picture phones vs compacts? Bruce Lewis Digital Photography 3 03-27-2006 09:19 PM
summarize bytes bastardx Perl 7 06-16-2005 04:38 PM
How to summarize and how to get the network given a host address. ws00sw Cisco 10 03-03-2005 02:38 PM
MS Excel - How can I summarize a table? Will Pivot Table Reports do this for me? hugh jass Computer Support 3 09-10-2003 11:02 PM



Advertisments