preprocessing

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT

README

Preprocessing

GoDoc Go Report Card Build Status

Data preprocessing library for machine learning.

Installation

$ go get github.com/idaifish/preprocessing/...

Get Started

import (
	"fmt"

	"github.com/idaifish/preprocessing/text"
)

func main() {
	corpus := []string{
		"This is the first document.",
		"This is the second second document.",
		"And the third one.",
		"Is this the first document?",
	}
	tokenizer := text.NewTokenizer(10, text.NewDefaultConfig())
	tokenizer.FitOnTexts(corpus)

	fmt.Println(tokenizer.TextsToSequences([]string{"This is a text document to analyze."}))
}
import (
	"fmt"

	"github.com/idaifish/preprocessing/sequence"
)

func main() {
	intSeq := [][]int{{1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}}
	fmt.Println(sequence.PadSequences(intSeq, 3, "post", "pre", 0))
}

Directories

Path Synopsis
Package sequence provides utilities for preprocessing sequence data.
Package sequence provides utilities for preprocessing sequence data.
Package text provides utilities for text input preprocessing.
Package text provides utilities for text input preprocessing.

Jump to

Keyboard shortcuts

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