/lexrankmmr

LexRank and MMR package for Japanese documents

Primary LanguageGoMIT LicenseMIT

lexrankmmr

GoDoc Build Status

Algorithm

LexRank: Graph-based Lexical Centrality as Salience in Text Summarization

The Use of MMR, Diversity-Based Reranking for Reordering Documents and Producing Summaries

Dependency

install

go get github.com/ramenjuniti/lexrankmmr

Usage

package main

import github.com/ramenjuniti/lexrankmmr

func main() {
    text := "Please input the document you want to summarize here."
    summary, err := lexrankmmr.New(
        lexrankmmr.MaxLines(maxLines),            // option (default 0)
        lexrankmmr.MaxCharacters(maxCharacters),  // option (default 0)
        lexrankmmr.Threshold(threshold),          // option (default 0.1)
        lexrankmmr.Tolerance(tolerance),          // option (default 0.0001)
        lexrankmmr.Damping(damping),              // option (default 0.85)
        lexrankmmr.Lambda(lambda),                // option (default 1.0)
    )
    err = summary.Summarize(text)
    if err != nil {
        log.Fatal(err)
    }
}

License

This software is released under the MIT License, see LICENSE.