/gobstract

Simple automatic abstract text generator

Primary LanguageGoMIT LicenseMIT

GoDoc Build Status Go Report Card

Gobstract

Gobstract package make extraction summaries from text provided. The algorithm measures sentence relations (measuring relevant token similarity), position and length to pick the text highlights.

Installation

PoS Tagging

For more information check instructions here.

Abstracts

export MODELS="<postagging trained models folder path>"

go get github.com/lucasmenendez/gobstact

Use it

package main

import (
    "fmt"
    "io/ioutil"
    "github.com/lucasmenendez/gobstract"
)

func main() {
    var input string
    if raw, err := ioutil.ReadFile("input"); err != nil {
        fmt.Println(err)
        return
    } else {
        input = string(raw)
    }

    if t, err := gobstract.NewText(input, "es"); err != nil {
        fmt.Println(err)
    } else {
        var summary []string = t.Summarize()
        for _, sentence := range summary {
            fmt.Println(sentence)
        }
    }    
}