gobstract

package module
v0.0.0-...-5237494 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2018 License: MIT Imports: 8 Imported by: 0

README

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)
        }
    }    
}

Documentation

Overview

Package gobstract package make extraction summaries from text provided. The algorithm measures sentence relations, position and similarity to pick the most important text sentences.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Text

type Text struct {
	// contains filtered or unexported fields
}

Text struct evolves text sentences and associated language to use them across the algorithm.

func NewText

func NewText(input, langCode string) (*Text, error)

NewText function initializes Text struct splitting sentences, checking text lengthRaw and loading the according language.

func (*Text) Summarize

func (t *Text) Summarize() (summary []string)

Summarize function initializes a Scorer and return scoring process result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL