Code for TextRank: Brining Order into Texts
Some codes and spliting files are inspired by lovit/textrank
from textrank import TextRank
sents = ['list of str form 1', 'list of str form 2', ...]
stopwords = ["뉴스", "기자", ...]
textrank = TextRank(tokenizer="mecab", stopwords=stopwords, method="iterative")
# sentences extraction
keysents = textrank.summarize(sents)
# keywords extraction
keywords = textrank.keywords(sents)
# sentences extraction
$ python main.py --mode sentences --data_type news --tokenizer mecab --topk 3
# keywords extraction
$ python main.py --mode words --data_type news --tokenizer mecab --topk 3