func main() { gr := new(crfpp.Group) e := gr.ReadFile("template", "train.txt") if e != nil { fmt.Println(e) return } else { fmt.Println("gr is ready") } e = gr.ProcessData("model.txt", 1, 0.0001, 4, 10000) if e != nil { fmt.Println(e.Error()) } }
func Learn(template, train, model string) error { c := conf.GetConfig() freq := c.GetFreq() maxLimit := c.GetMaxLimit() cost := c.GetCost() eta := c.GetEta() gr := new(crfpp.Group) e := gr.ReadFile(template, train) if e != nil { return e } e = gr.ProcessData(model, freq, eta, cost, maxlimit) if e != nil { return e } return nil }