Jump to content

Algorithms to summarize web news articles


Rahul Dev

Recommended Posts

what do you mean by summarize? =o

you mean you want to make a short snip of it?

how is the news articles stored and how do you access them?

suppose i have already extracted a news article(e.g 300 words) and stored it in my database. Next thing i have to do is summarize that article so that it becomes less than 300 words(say 80 words). to do that i need an algorithm to summarize text that already exist. then implement that algorithm in PHP. I don't need scripts that simply reduces the size of an article but summarizes the articles using artificial intelligence.

How would you summarize it? Either you have to cut it... which is easy. ( http://php.net/manual/en/function.substr.php )

or you have to rewrite it yourself. (which would need another column in your db.)

 

If you also want to extract some "header" / "title" of the news, use preg_replace to replace everything after (if the title is the first line for example) the header/title with nothing, and store it as a string which you output as the title. ( http://no2.php.net/manual/en/function.preg-replace.php )

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.