3 ms·
Do you mind summarizing a bit how you generate snippets? We were discussing this on MetaOptimize recently (http://metaoptimize.com/qa/questions/2815/how-are-se
by bravura 16y ago
Do you mind summarizing a bit how you generate snippets?
We were discussing this on MetaOptimize recently (http://metaoptimize.com/qa/questions/2815/how-are-search-engine-snippets-generated http://metaoptimize.com/qa/questions/2815/how-are-search-eng...), but I'm curious to hear about alternate approaches.
- deleted 16y ago[deleted]
- nl 16y agoI build a summariser for classifier4j (http://classifier4j.cvs.sourceforge.net/viewvc/classifier4j/newbuild/core/src/java/net/sf/classifier4J/summariser/SimpleSummariser.java?revision=1.6&view=markup http://classifier4j.cvs.sourceforge.net/viewvc/classifier4j/...). It's 5 years old now, but the summaries it generates are competitive quality-wise with most things out there (eg, the MS Word summarizer). Unfortunately I don't have an online demo working atm (like I said - 5 years old) My algorithm is something I made up, and from memory it works like this: 1) Remove HTML, stem, remove stopwords etc 2) Sort unique words by popularity in the text 3) Split the original text on sentence boundaries. 4) Include each sentence that first mentions the next most popular word, until the summary is the maximum length requested. Like most things, it's surprising how well a simple algorithm like that works. There are ports for C#, and Googling just then apparently someone has done a python port too.