Giter Site home page Giter Site logo

textrank-doc-summary's Introduction

TextRank-Doc-Summary

분석 동기

블로그를 운영하는 블로거로서 만약 블로그를 자동으로 요약해서 글 제일 위에 나타낼 수 있다면 읽으러 오는 사람에게 얼마나 좋을까? 생각에 문서를 요약하는 프로그램을 생각하게 되었습니다.

먼저 영어 문서의 한에서 tensorflow 를 이용하여 문장을 요약한 것을 학습 시켜주는 프로그램을 만들었습니다. 하지만 영어 문서의 한에서는 한글 블로그에 문서 요약을 넣을 수 없으므로 TextRank 를 이용하여 한글 문서에서도 문서 요약을 가능하게 해주는 문서요약시스템을 간단히 구현해보았습니다.

프로젝트 바로가기 ✔️



Step 1. 필요한 패키지 설치

  • pip install newspaper3k # url 크롤링 패키지
  • pip install jpype1
  • pip install konlpy # 한글 형태소 분석기
  • pip install scikit-learn # TF-IDF를 위한 머신러닝 패키지

Step 2. 데이터 수집

2

  1. url을 이용해 문장을 추출하거나, text를 직접 입력해 문장을 추출합니다.

  2. TF-IDF 모델을 만들기 위한 전처리 과정을 합니다.

불용어를 추가하여 twitter를 이용해 문장으로 분리 한 뒤 문장을 형태소 단위로 나눈 후 품사 태 깅을 통해 명사들만 추출합니다.


Step 3. 머신러닝을 이용하여 문장의 가중치 그래프 만들기

  1. TF-IDF 모델 생성

문서에서 단어의 중요성을 계산하여 단어를 추출하는 TF-IDF를 이용합니다.

3

TF-IDF를 계산하기 위해 머신러닝 패키지인 scikit-learn을 이용합니다

  1. 그래프 생성

TextRank를 적용시키기 위해 생성된 문장의 가중치 그래프를 만듭니다.

3


Step 4. TextRank를 이용한 텍스트 요약

4

  1. 위의 공식을 이용한 알고리즘 적용

4

  1. 문서를 요약해주는 함수 생성 (default = 3줄)

4

  1. 문서의 키워드를 리턴 해주는 함수 생성 (default = 10단어)

4


Step 5. 검증

  1. 파이선 GUI tkinter를 이용하여 문서요약시스템을 보다 쉽게 사용할 수 있도록 구현하였 습니다.
  2. 문서요약은 8줄로 되도록 만들었으며 단어는 default인 10개의 단어가 나오도록 하였습니 다.
  3. mqtt 프로토콜을 분석하여 정리한 제 블로그 주소입니다.
    url : https://wnsgml972.github.io/wnsgml972.github.io/mqtt/mqtt.html

4

textrank-doc-summary's People

Contributors

wnsgml972 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hangj11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.