Build a Text Summarizer in Java
Get the Code here : https://github.com/ajhalthor/text-summarizer
Follow me on Twitter : https://twitter.com/ajhalthor
Take a look at the original by Shlomi Babluki : http://thetokenizer.com/2013/04/28/build-your-own-summary-tool/
TRANSCRIPT OVERVIEW
ALGORITHM
1. Take the full CONTENT and split it into PARAGRAPHS.
2. Split each PARAGRAPH into SENTENCES.
3. Compare every sentence with every other. This is done by Counting the number of common words and then Normalize this by dividing by average number of words per sentence.
4. These intermediate scores/values are stored in an INTERSECTION matrix
5. Create the key-value dictionary
- Key : Sentence
- Value : Sum of intersection values with this sentence
6. From every paragraph, extract the sentences with the highest score.
7. Sort the selected sentences in order of appearance in the original text to preserve content and meaning.
And like that, you have generated a summary of the original text.
CLASSES IN JAVA PROJECT
1. Sentence : The entire text is divided into a number of paragraphs and each paragraph is divided into a number of sentences.
2. Paragraph : Every paragraph has a number associated with it and an Array List of sentences.
3. Sentence Comparitor : Compare Sentence objects based on Score
4. SentenceComparatorForSummary : Compare Sentence objects based on position in text.
5. SummayTool : akes care of all the operations from extracting sentences to generating the summary.
HOW IS MY SUMMARIZER BETTER THAN THE ORIGINAL ?
My text summarizer selects number of sentences from a paragraph depending on the length. This is an improvement over the original text summarizer implementation that only selects 1 sentence per paragraph regardless of length. So, If the author decides to crunch everything into 1 paragraph, then only one sentence would be chosen. In the current implementation, we set it to accept several sentences for larger paragraphs. It delivers cogent summaries for general essays, reviews and publications.
RUN THIS PROGRAM
$ javac -d bin improved_summary.java
$ java -classpath bin improved_summary
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Build a Text Summarizer in Java», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.