-
-
Notifications
You must be signed in to change notification settings - Fork 86
/
convert.go
34 lines (31 loc) · 932 Bytes
/
convert.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2020 spaGO Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package app
import (
"github.com/nlpodyssey/spago/pkg/nlp/sequencelabeler"
"github.com/urfave/cli"
)
func newConvertCommandFor(app *NERApp) cli.Command {
return cli.Command{
Name: "convert",
Usage: "Run the " + programName + " to convert a pre-processed Flair model.",
UsageText: programName + " convert --model-folder --model-name",
Description: "Run the " + programName + " converter.",
Flags: []cli.Flag{
cli.StringFlag{
Name: "model-folder",
Destination: &app.modelFolder,
Required: true,
},
cli.StringFlag{
Name: "model-name",
Destination: &app.modelName,
Required: true,
},
},
Action: func(c *cli.Context) {
sequencelabeler.Convert(app.modelFolder, app.modelName)
},
}
}