Documentation ¶
Index ¶
- Constants
- Variables
- func AllCommands() *commander.Command
- func CombineJointCorpus(graphs, goldLats, ambLats []interface{}) ([]interface{}, int)
- func CombineLatticesCorpus(goldLats, ambLats []interface{}) ([]interface{}, int, int, int)
- func CombineToGoldMorph(goldLat, ambLat nlp.LatticeSentence) (m *disambig.MDConfig, spelloutsAdded int)
- func CombineToGoldMorphs(goldLats, ambLats []interface{}) ([]interface{}, int)
- func DepCmd() *commander.Command
- func DepConfigOut(outModelFile string, b search.Interface, t transition.TransitionSystem)
- func DepEval(test, gold interface{}) *eval.Result
- func DepEvalCmd() *commander.Command
- func DepEvalConfigOut()
- func DepEvalConll(test, gold interface{}) *eval.Result
- func DepEvalTrainAndParse(cmd *commander.Command, args []string) error
- func DepTrainAndParse(cmd *commander.Command, args []string) error
- func EstimatedBeamTransitions() int
- func GenLemmas(cmd *commander.Command, args []string) error
- func GenLemmasCmd() *commander.Command
- func GenLemmasConfigOut()
- func GenSegSequence(iAmbLat, iGoldLat interface{}) nlp.LatticeSentence
- func GenSegSequences(ambLats, goldLats []interface{}) []nlp.LatticeSentence
- func GenUnAmbLemmas(cmd *commander.Command, args []string) error
- func GenUnAmbLemmasCmd() *commander.Command
- func GenUnAmbLemmasConfigOut()
- func GetAsLabeledDepGraph(instance interface{}) util.Equaler
- func GetAsTaggedSentence(instance interface{}) util.Equaler
- func GetInstances(instances []interface{}, getFunc InstanceFunc) []interface{}
- func GetJointMDConfig(instance interface{}) util.Equaler
- func GetLemmas(conf *disambig.MDConfig, pf nlp.MDParam) nlp.AmbMorphs
- func GetLemmasCorpus(goldSequences []*disambig.MDConfig, rawSents []nlp.BasicSentence, ...)
- func GetMDConfigAsLattices(instance interface{}) util.Equaler
- func GetMDConfigAsMappings(instance interface{}) util.Equaler
- func GetMorphGraph(instance interface{}) util.Equaler
- func GetMorphGraphAsLattices(instance interface{}) util.Equaler
- func GetUnAmbLemmas(conf *disambig.MDConfig, pf nlp.MDParam) nlp.DisAmbMorphs
- func GetUnAmbLemmasCorpus(goldSequences []*disambig.MDConfig, rawSents []nlp.BasicSentence, ...)
- func GoldSeg(cmd *commander.Command, args []string) error
- func GoldSegCmd() *commander.Command
- func GoldSegConfigOut()
- func HebMA(cmd *commander.Command, args []string) error
- func HebMACmd() *commander.Command
- func HebMAConfigOut()
- func InitCommand(cmd *commander.Command, args []string)
- func JointCmd() *commander.Command
- func JointConfigOut(outModelFile string, b search.Interface, t transition.TransitionSystem)
- func JointEval(test, gold interface{}, metric string) *eval.Result
- func JointTrainAndParse(cmd *commander.Command, args []string) error
- func Limit(instances []interface{}, limit int) []interface{}
- func MA(cmd *commander.Command, args []string) error
- func MACmd() *commander.Command
- func MAConfigOut()
- func MALearn(cmd *commander.Command, args []string) error
- func MALearnCmd() *commander.Command
- func MALearnConfigOut()
- func MDConfigOut(outModelFile string, b search.Interface, t transition.TransitionSystem)
- func MDTrainAndParse(cmd *commander.Command, args []string) error
- func MakeDepEvalStopCondition(instances []interface{}, goldInstances []interface{}, ...) perceptron.StopCondition
- func MakeJointEvalStopCondition(instances []interface{}, goldInstances []interface{}, ...) perceptron.StopCondition
- func MakeMorphEvalStopCondition(instances []interface{}, goldInstances []interface{}, ...) perceptron.StopCondition
- func MdCmd() *commander.Command
- func MorphEval(test, gold interface{}, metric string) *eval.Result
- func NewAppWrapCommand(f func(cmd *commander.Command, args []string) error) func(cmd *commander.Command, args []string) error
- func Parse(instances []interface{}, parser Parser) []interface{}
- func SetupDepEnum(relations []string)
- func SetupEnum(relations []string)
- func SetupEvalEnum(relations []string)
- func SetupExtractor(setup *transition.FeatureSetup, transTypes []byte) *transition.GenericExtractor
- func SetupMDEnum()
- func SetupMorphTransEnum(relations []string)
- func SetupRelationEnum(labels []string)
- func SetupTransEnum(relations []string)
- func Train(trainingSet []perceptron.DecodedInstance, Iterations int, filename string, ...) *perceptron.LinearPerceptron
- func TrainingSequences(trainingSet []interface{}, instFunc InstanceFunc, goldFunc GoldFunc) []perceptron.DecodedInstance
- func ValidMAGold(cmd *commander.Command, args []string) error
- func ValidMAGoldConfigOut(t transition.TransitionSystem)
- func ValidateCorpus(goldSequences []perceptron.DecodedInstance) map[string]int
- func ValidateInstance(decoded perceptron.DecodedInstance) string
- func ValidateMAGoldCmd() *commander.Command
- func VerifyExists(filename string) bool
- func VerifyFlags(cmd *commander.Command, required []string)
- func WriteModel(file string, data *Serialization)
- func Xliter8(cmd *commander.Command, args []string) error
- func Xliter8Cmd() *commander.Command
- func Xliter8ConfigOut()
- type GoldFunc
- type InstanceFunc
- type Parser
- type Serialization
Constants ¶
View Source
const ( NUM_CPUS_FLAG = "cpus" VERSION = "0.0.0.2" )
View Source
const ( APPROX_MORPH_TRANSITIONS = 100 APPROX_WORDS, APPROX_POS = 100, 100 WORDS_POS_FACTOR = 5 APPROX_MHOSTS, APPROX_MSUFFIXES = 128, 16 )
An approximation of the number of different MD-X:Y:Z transitions Pre-allocating the enumeration saves frequent reallocation during training and parsing
Variables ¶
View Source
var ( CPUs int CPUProfile string )
View Source
var ( // processing options Iterations, BeamSize int DepBeamSize int ConcurrentBeam bool NumFeatures int UsePOP bool // global enumerations ERel, ETrans, EWord, EPOS, EWPOS, EMHost, EMSuffix *util.EnumSet ETokens *util.EnumSet EMorphProp *util.EnumSet // enumeration offsets of transitions SH, RE, PR, LA, RA, IDLE, POP, MD transition.Transition AlignBeam bool AverageScores bool // string arrays can't be const, so let it be a var DEFAULT_MODEL_DIRS = []string{".", "data"} DEFAULT_CONF_DIRS = []string{".", "conf"} )
View Source
var AppCommands []*commander.Command = []*commander.Command{ DepCmd(), MdCmd(), JointCmd(), MALearnCmd(), MACmd(), HebMACmd(), }
View Source
var (
DEFAULT_DATA_DIRS = []string{".", "data/bgulex"}
)
View Source
var (
JointStrategy, OracleStrategy string
)
View Source
var (
UseWB bool
)
Functions ¶
func AllCommands ¶
func CombineJointCorpus ¶
func CombineJointCorpus(graphs, goldLats, ambLats []interface{}) ([]interface{}, int)
func CombineLatticesCorpus ¶
func CombineToGoldMorph ¶
func CombineToGoldMorph(goldLat, ambLat nlp.LatticeSentence) (m *disambig.MDConfig, spelloutsAdded int)
func CombineToGoldMorphs ¶
func CombineToGoldMorphs(goldLats, ambLats []interface{}) ([]interface{}, int)
func DepConfigOut ¶ added in v1.1.0
func DepConfigOut(outModelFile string, b search.Interface, t transition.TransitionSystem)
func DepEvalCmd ¶
func DepEvalConfigOut ¶
func DepEvalConfigOut()
func DepEvalConll ¶
Assumes sorted inputs of equal length
func DepTrainAndParse ¶ added in v1.1.0
func EstimatedBeamTransitions ¶
func EstimatedBeamTransitions() int
func GenLemmasCmd ¶
func GenLemmasConfigOut ¶
func GenLemmasConfigOut()
func GenSegSequence ¶
func GenSegSequence(iAmbLat, iGoldLat interface{}) nlp.LatticeSentence
func GenSegSequences ¶
func GenSegSequences(ambLats, goldLats []interface{}) []nlp.LatticeSentence
func GenUnAmbLemmasCmd ¶
func GenUnAmbLemmasConfigOut ¶
func GenUnAmbLemmasConfigOut()
func GetAsLabeledDepGraph ¶
func GetAsTaggedSentence ¶
func GetInstances ¶
func GetInstances(instances []interface{}, getFunc InstanceFunc) []interface{}
func GetJointMDConfig ¶
func GetLemmasCorpus ¶
func GetMDConfigAsLattices ¶
func GetMDConfigAsMappings ¶
func GetMorphGraph ¶
func GetMorphGraphAsLattices ¶
func GetUnAmbLemmas ¶
func GetUnAmbLemmasCorpus ¶
func GoldSegCmd ¶
func GoldSegConfigOut ¶
func GoldSegConfigOut()
func HebMAConfigOut ¶
func HebMAConfigOut()
func InitCommand ¶
func JointConfigOut ¶
func JointConfigOut(outModelFile string, b search.Interface, t transition.TransitionSystem)
func MAConfigOut ¶
func MAConfigOut()
func MALearnCmd ¶
func MALearnConfigOut ¶
func MALearnConfigOut()
func MDConfigOut ¶
func MDConfigOut(outModelFile string, b search.Interface, t transition.TransitionSystem)
func MakeDepEvalStopCondition ¶
func MakeDepEvalStopCondition(instances []interface{}, goldInstances []interface{}, testInstances []interface{}, parser Parser, goldDecoder perceptron.InstanceDecoder, beamSize int) perceptron.StopCondition
func MakeJointEvalStopCondition ¶
func MakeJointEvalStopCondition(instances []interface{}, goldInstances []interface{}, testInstances []interface{}, testGoldInstances []interface{}, parser Parser, goldDecoder perceptron.InstanceDecoder, beamSize int) perceptron.StopCondition
func MakeMorphEvalStopCondition ¶
func MakeMorphEvalStopCondition(instances []interface{}, goldInstances []interface{}, testInstances []interface{}, testGoldInstances []interface{}, parser Parser, goldDecoder perceptron.InstanceDecoder, beamSize int) perceptron.StopCondition
func NewAppWrapCommand ¶
func SetupDepEnum ¶ added in v1.1.0
func SetupDepEnum(relations []string)
func SetupEvalEnum ¶
func SetupEvalEnum(relations []string)
func SetupExtractor ¶
func SetupExtractor(setup *transition.FeatureSetup, transTypes []byte) *transition.GenericExtractor
func SetupMDEnum ¶
func SetupMDEnum()
func SetupMorphTransEnum ¶
func SetupMorphTransEnum(relations []string)
func SetupRelationEnum ¶
func SetupRelationEnum(labels []string)
func SetupTransEnum ¶
func SetupTransEnum(relations []string)
func Train ¶
func Train(trainingSet []perceptron.DecodedInstance, Iterations int, filename string, paramModel perceptron.Model, decoder perceptron.EarlyUpdateInstanceDecoder, goldDecoder perceptron.InstanceDecoder, converge perceptron.StopCondition) *perceptron.LinearPerceptron
func TrainingSequences ¶
func TrainingSequences(trainingSet []interface{}, instFunc InstanceFunc, goldFunc GoldFunc) []perceptron.DecodedInstance
func ValidMAGoldConfigOut ¶
func ValidMAGoldConfigOut(t transition.TransitionSystem)
func ValidateCorpus ¶
func ValidateCorpus(goldSequences []perceptron.DecodedInstance) map[string]int
func ValidateInstance ¶
func ValidateInstance(decoded perceptron.DecodedInstance) string
func ValidateMAGoldCmd ¶
func VerifyExists ¶
func VerifyFlags ¶
func WriteModel ¶
func WriteModel(file string, data *Serialization)
func Xliter8Cmd ¶
func Xliter8ConfigOut ¶
func Xliter8ConfigOut()
Types ¶
type InstanceFunc ¶
type Parser ¶
type Parser interface {
Parse(search.Problem) (transition.Configuration, interface{})
}
Click to show internal directories.
Click to hide internal directories.