llSourcell/How_to_make_a_text_summarizer
소개
Siraj Raval이 YouTube에 공개한 "How to Make a Text Summarizer - Intro to Deep Learning #10"의 코드입니다.
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalHow_to_make_a_text_summarizer
This is the code for "How to Make a Text Summarizer - Intro to Deep Learning #10" by Siraj Raval on Youtube.
Coding Challenge - Due Date - Thursday, March 23rd at 12 PM PST
The challenge for this video is to make a text summarizer for a set of articles with Keras. You can use any textual dataset to do this. By doing this you'll learn more about encoder-decoder architecture and the role of attention in deep learning. Good luck!
Overview
This is the code for this video on Youtube by Siraj Raval as part of the Deep Learning Nanodegree with Udacity. We're using an encoder-decoder architecture to generate a headline from a news article.
Dependencies
- Tensorflow or Theano
- Keras
- python-Levenshtein (pip install python-levenshtein)
Use pip to install any missing dependencies.
Basic Usage
Data
The video example is made from the text at the start of the article, which I call description (or desc),
and the text of the original headline (or head). The texts should be already tokenized and the tokens separated by spaces.
This is a good example dataset. You can use the 'content' as the 'desc' and the 'title' as the 'head'.
Once you have the data ready save it in a python pickle file as a tuple:
(heads, descs, keywords) were heads is a list of all the head strings,
descs is a list of all the article strings in the same order and length as heads.
I ignore the keywrods information so you can place None.
Here is a link on how to get similar datasets
Build a vocabulary of words
The vocabulary-embedding notebook describes how a dictionary is built for the tokens and how an initial embedding matrix is built from GloVe.
Train a model
The train notebook describes how a model is trained on the data using Keras.
Use model to generate new headlines
The predict notebook generate headlines by the trained model and showes the attention weights used to pick words from the description. The text generation includes a feature which was not described in the original paper, it allows for words that are outside the training vocabulary to be copied from the description to the generated headline.
Examples of headlines generated
Good (cherry-picked) examples of headlines generated:

Examples of attention weights

Credits
The credit for this code goes to udibr i've merely created a wrapper to make it easier to get started.
관련 프로젝트 살펴보기
불러오는 중…