"The site of the earliest known civilization, located in the southernmost part of Mesopotamia, between the Tigris and Euphrates rivers, in the area that later became Babylonia and is now southern Iraq, from around Baghdad to the Persian Gulf."
A Go library and command line utility for creating a summary from HTML or plain text files. This package also contains a simple evaluation framework for evaluating the various methods to generate text summaries.
go get github.com/chasedputnam/sumerpackage main
import (
"fmt"
"github.com/chasedputnam/sumer"
"github.com/chasedputnam/sumer/nlp"
)
func main() {
// Create a parser and summarizer
tok := nlp.NewTokenizer("english")
parser := nlp.NewParser(tok)
summarizer, err := sumer.NewSummarizer("lsa", "english")
if err != nil {
panic(err)
}
// Parse and summarize text
doc := parser.Parse("Your text content here...")
sentences := summarizer.Summarize(doc, 1)
for _, s := range sentences {
fmt.Println(s.Text())
}
}lsa- Latent Semantic Analysis (default)lexrank- LexRank graph-based rankingtextrank- TextRank graph-based rankingluhn- Luhn's classic algorithm (1958)edmundson- Weighted heuristics (cue, key, title, location)sumbasic- Greedy probability maximizationkl- KL-divergence minimizationreduction- Pairwise word overlaprandom- Random baseline
See ARCHITECTURE.md for detailed documentation on the implementation.
MIT
