• Stars
    star
    232
  • Rank 172,847 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Summpy

Text summarization (sentence extraction) module with simple HTTP API. (Currently supports Japanese only)

License

MIT License

Requirements

Python 2.7.*

  • numpy
  • scipy
  • scikit-learn
  • networkx
  • cherrypy
  • MeCab or janome
  • pulp (if you use ILP-based method)

Quick start

pip install summpy
python -m summpy.server -h 127.0.0.1 -p 8080
curl http://127.0.0.1:8080/summarize\?sent_limit\=3\&text\=要約したい文章を入力。

Input Parameters

  • text: text (utf-8)
  • algo: (optional)
    • lexrank: LexRank, a graph-based summarization (default)
    • clexrank: Continuous LexRank
    • divrank: (experimental) DivRank (Diverse Rank, graph-based method). Since DivRank aims to provide non-redundant and high coverage information, it is suitable for multi-document summarization.
    • mcp: ILP-based method. Extracts sentences in terms of Maximum Coverage Problem.

Hyper parameters for how many sentences are shown (optional)

  • sent_limit: number of sentences (only {lex,clex,div}rank)
  • char_limit: number of characters
  • imp_require: cumulative scores [0.0-1.0] (only {lex,clex,div}rank)

Example

from (http://blog.recruit-tech.co.jp/2015/08/28/recruit_two_cx/)

Request

curl http://127.0.0.1:8080/summarize\?sent_limit\=3\&text\=突然ですが、リクルートのリボンモデルを耳にしたことはあるでしょうか?...

Response (JSON format)

{
  summary: [
    "リクルートが提供する多くのサービスが後に言及するカスタマーとクライアント双方のマッチングを実現するサービスと称される背景にはこのリボンモデルがあります。", 
    "そしてこのリボンモデルこそ、リクルートにおけるUXデザインそのもの、とも言えることができます。", 
    "リボンモデルは国際規格の普及によって生まれた構想ではないものの、リボンモデルの構造はカスタマーとクライアントの体験設計基盤とも捉えることができ、UXデザインの普及・浸透と足並を揃えるかのように組織内に醸成されていきました。"
  ],
  debug_info: {}
}

Try with browser

http://<hostname>:<port>/static/test.html

Python API

Example (Continuous LexRank)

from summpy.lexrank import summarize

# ensure type(text) is unicode
sentences, debug_info = summarize(
    text, sent_limit=5, continuous=True, debug=True
)

for sent in sentences:
    print sent.strip().encode(encoding)

For further details, see main part of summpy/lexrank.py or mcp_summ.py.

References

  • G. Erkan and D. Radev. LexRank: graph-based lexical centrality as salience in text summarization. J. Artif. Int. Res. 22(1), pages 457-479, 2004. (link)

  • Q. Mei, J. Guo, and D. Radev. DivRank: the Interplay of Prestige and Diversity in Information Networks. In Proceedings of the 16th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD '10), pages 1009-1018, 2010. (link)

  • H. Takamura and M. Okumura. Text Summarization Model Based on Maximum Coverage Problem and its Variant. In Proceedings of the 12th Conference of the European Chapter of the Association for Computational Linguistics (EACL '09), pages 781-789, 2009. (link)

More Repositories

1

agreed

agreed is Consumer Driven Contract tool with JSON mock server.
JavaScript
214
star
2

location-state

State management library for React that synchronizes with history entries supporting Next.js App Router.
TypeScript
106
star
3

redux-pluto

redux pluto
TypeScript
73
star
4

redux-async-loader

Async data loader for Redux apps.
JavaScript
69
star
5

recoil-sync-next

recoil-sync stores for Next.js
TypeScript
59
star
6

r-isucon

TypeScript
52
star
7

codable-model-optimizer

meta-heuristics solver for easy modeling
Python
30
star
8

redux-effects-steps

Multiple steps version of redux-effects
JavaScript
29
star
9

specter

Specter is a data fetch layer using speculative execution.
JavaScript
22
star
10

agreed-core

agreed is Consumer Driven Contract utilities with JSON mock server.
JavaScript
20
star
11

xchainer

ニューラルネットワークライブラリchainerの拡張モジュールです
Python
18
star
12

sec-guide-android-lint

HTML
16
star
13

speed-hackathon-jsconf.jp

JavaScript
13
star
14

agreed-ui

JavaScript
13
star
15

bootcamp_security_2018

2018年度のbootcampのセキュリティ教材
JavaScript
13
star
16

react-redux-analytics

Analytics middleware for React+Redux
JavaScript
13
star
17

dicon

DICONtainer Generator for go.
Go
11
star
18

redux-effects-fetchr

yahoo/fetchr binding for redux-effects
JavaScript
10
star
19

agrios

📦👍 Package your agreed server as axios adapter
JavaScript
8
star
20

agreed-typed

TypeScript
8
star
21

shirabe

Pluggable survey tool kit for Chromium, Firefox, Webkit
TypeScript
8
star
22

agreed-server

JavaScript
7
star
23

redux-action-replay

JavaScript
7
star
24

crisp-dm-event

Jupyter Notebook
6
star
25

todo-manager

新人研修用Todo管理ツール
HTML
6
star
26

bootcamp-2022-android

2022年新人向けAndroid研修の資料です
Kotlin
6
star
27

drctrl

Automatically configuration tool for DataRobot.
Python
6
star
28

RISUCON2022Summer

RECRUIT ISUCON 2022 Summer
Go
5
star
29

casval

Casual Vulnerability Analyzer
Python
5
star
30

duplayer

Go
5
star
31

babel-plugin-flow-onlyupdateforkeys

A babel plugin to generate args of recompose.onlyUpdateForKeys from flow type.
JavaScript
5
star
32

redux-effects-geolocation

redux-effects middleware for Geolocation API
JavaScript
4
star
33

sonarish

JavaScript
4
star
34

MovieExport

For gephi
Java
4
star
35

bootcamp-js

JavaScript
3
star
36

reservoir-computing

reservoir computing
Python
2
star
37

bootcamp-2023-nextjs

bootcamp-2023-nextjs
TypeScript
2
star
38

redux-effects-socket-io

socket.io bindings for redux-effects family
JavaScript
2
star
39

eslint-plugin-atomic-redesign

ESLint rules for Atomic ReDesigned projects.
TypeScript
2
star
40

redux-effects-fetchr-cache

caching middleware for redux-effects-fetchr
JavaScript
2
star
41

bootcamp-2022-nextjs

TypeScript
2
star
42

redux-effects-universal-cookie

Universal version of redux-effects-cookie
JavaScript
2
star
43

bootcamp-2021-ts-example

TypeScript
2
star
44

eslint-plugin-react-data-attr

TypeScript
1
star
45

casval-rem

Casval REM (Casval Remote Execution Module)
Python
1
star
46

go-ams

Go
1
star
47

paper-generator

This tool uses artificial data and makes data insertion to a document and papers.
Python
1
star
48

rtc_blog

HTML
1
star
49

redux-effects-formdata-uploader

Redux Effects FormData Uploader
JavaScript
1
star
50

bootcamp-js-example

JavaScript
1
star
51

react-redux-analytics-td

TreasureData plugin for react-redux-analytics
JavaScript
1
star
52

aris-cam2image-to-kvs

ROS2 package to send camera images to AWS Kinesis Video Stream
Python
1
star
53

aris-awsiotcore-to-nav2

ROS2 package to receive navigation messages from AWS IoT Core
Python
1
star
54

redux-page-scope

Page scope state management for Redux
JavaScript
1
star
55

bootcamp-2021-ts

TypeScript
1
star