Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayDiff(left []featurevector.Feature, right []featurevector.Feature) ([]string, []string)
- func CompareConf(confA, confB *ScoredConfiguration, reverse bool) bool
- func SearchEarlyUpdate(b Interface, problem Problem, B int, goldSequence Candidates) (Candidate, Candidate)
- type Agenda
- type Aligned
- type AssignmentScore
- type BaseAgenda
- func (a *BaseAgenda) AddCandidate(c, best Candidate) Candidate
- func (a *BaseAgenda) AddCandidates(cs []Candidate, curBest Candidate, minAlignment int) (Candidate, int)
- func (a *BaseAgenda) CandidateStr(c *ScoredConfiguration) string
- func (a *BaseAgenda) Clear()
- func (a *BaseAgenda) ConfStr() string
- func (a *BaseAgenda) Contains(goldCandidate Candidate) bool
- func (a *BaseAgenda) Copy(i, j int)
- func (a *BaseAgenda) Get(i int) interface{}
- func (a *BaseAgenda) Len() int
- func (a *BaseAgenda) Less(i, j int) bool
- func (a *BaseAgenda) LessValue(i int, x interface{}) bool
- func (a *BaseAgenda) Peek() *ScoredConfiguration
- func (a *BaseAgenda) Pop() interface{}
- func (a *BaseAgenda) Push(x interface{})
- func (a *BaseAgenda) ReEnumerate()
- func (a *BaseAgenda) Reverse()
- func (a *BaseAgenda) Set(i int, x interface{})
- func (a *BaseAgenda) String() string
- func (a *BaseAgenda) Swap(i, j int)
- type Beam
- func (b *Beam) Aligned() bool
- func (b *Beam) Best(a Agenda) Candidate
- func (b *Beam) Clear(agenda Agenda) Agenda
- func (b *Beam) Concurrent() bool
- func (b *Beam) DecodeEarlyUpdate(goldInstance perceptron.DecodedInstance, m perceptron.Model) (perceptron.DecodedInstance, interface{}, interface{}, int, int, float64)
- func (b *Beam) Expand(c Candidate, p Problem, candidateNum int) chan Candidate
- func (b *Beam) GoalTest(p Problem, c Candidate, rounds int) bool
- func (b *Beam) Idle(c Candidate, candidateNum int) Candidate
- func (b *Beam) Insert(cs chan Candidate, a Agenda) []Candidate
- func (b *Beam) Name() string
- func (b *Beam) Parse(problem Problem) (transition.Configuration, interface{})
- func (b *Beam) SetEarlyUpdate(i int)
- func (b *Beam) StartItem(p Problem) []Candidate
- func (b *Beam) Top(a Agenda) Candidate
- func (b *Beam) TopB(a Agenda, B int) ([]Candidate, bool)
- type Candidate
- type Candidates
- type Deterministic
- func (d *Deterministic) Decode(instance perceptron.Instance, m perceptron.Model) (perceptron.DecodedInstance, interface{})
- func (d *Deterministic) DecodeEarlyUpdate(goldInstance perceptron.DecodedInstance, m perceptron.Model) (perceptron.DecodedInstance, interface{}, interface{}, int, int, int64)
- func (d *Deterministic) DecodeGold(goldInstance perceptron.DecodedInstance, m perceptron.Model) (perceptron.DecodedInstance, interface{})
- func (d *Deterministic) Parse(problem Problem) (transition.Configuration, interface{})
- func (d *Deterministic) ParseOracle(gold perceptron.DecodedInstance) (configuration transition.Configuration, result interface{})
- func (d *Deterministic) ParseOracleEarlyUpdate(sent nlp.Sentence, gold transition.ConfigurationSequence, ...) (transition.Configuration, transition.Configuration, interface{}, interface{}, ...)
- type Idle
- type IdleFunc
- type Interface
- type ParseResultParameters
- type PerceptronModel
- type PerceptronModelValue
- type Problem
- type ScoreState
- type ScoredConfiguration
- func (s *ScoredConfiguration) AddScore(newScore int64, assignment uint16)
- func (s *ScoredConfiguration) Alignment() int
- func (s *ScoredConfiguration) Clear()
- func (s *ScoredConfiguration) Copy() Candidate
- func (s *ScoredConfiguration) Equal(otherEq Candidate) bool
- func (s *ScoredConfiguration) Expand(t transition.TransitionSystem)
- func (s *ScoredConfiguration) Len() int
- func (s *ScoredConfiguration) Score() float64
- func (s *ScoredConfiguration) String() string
- func (s *ScoredConfiguration) Terminal() bool
- type ScoredConfigurations
- type TransitionClassifier
- func (tc *TransitionClassifier) Init()
- func (tc *TransitionClassifier) ScoreWithConf(c transition.Configuration) int64
- func (tc *TransitionClassifier) Transition(c transition.Configuration) transition.Transition
- func (tc *TransitionClassifier) TransitionWithConf(c transition.Configuration) (transition.Configuration, transition.Transition)
Constants ¶
View Source
const (
MAX_TRANSITIONS = 800
)
Variables ¶
View Source
var ( AgendaOut bool = false ShowFeats bool = false )
View Source
var AllOut bool = true
View Source
var SHOW_ORACLE = false
Functions ¶
func ArrayDiff ¶
func ArrayDiff(left []featurevector.Feature, right []featurevector.Feature) ([]string, []string)
func CompareConf ¶
func CompareConf(confA, confB *ScoredConfiguration, reverse bool) bool
func SearchEarlyUpdate ¶
Types ¶
type AssignmentScore ¶
func (*AssignmentScore) Add ¶
func (a *AssignmentScore) Add(value int64)
func (*AssignmentScore) Average ¶
func (a *AssignmentScore) Average() float64
type BaseAgenda ¶
type BaseAgenda struct { sync.Mutex HeapReverse bool BeamSize int Confs []*ScoredConfiguration ShowSwap bool }
func NewAgenda ¶
func NewAgenda(size int) *BaseAgenda
func (*BaseAgenda) AddCandidate ¶
func (a *BaseAgenda) AddCandidate(c, best Candidate) Candidate
func (*BaseAgenda) AddCandidates ¶
func (*BaseAgenda) CandidateStr ¶
func (a *BaseAgenda) CandidateStr(c *ScoredConfiguration) string
func (*BaseAgenda) Clear ¶
func (a *BaseAgenda) Clear()
func (*BaseAgenda) ConfStr ¶
func (a *BaseAgenda) ConfStr() string
func (*BaseAgenda) Contains ¶
func (a *BaseAgenda) Contains(goldCandidate Candidate) bool
func (*BaseAgenda) Copy ¶
func (a *BaseAgenda) Copy(i, j int)
func (*BaseAgenda) Get ¶
func (a *BaseAgenda) Get(i int) interface{}
func (*BaseAgenda) Len ¶
func (a *BaseAgenda) Len() int
func (*BaseAgenda) Less ¶
func (a *BaseAgenda) Less(i, j int) bool
func (*BaseAgenda) LessValue ¶
func (a *BaseAgenda) LessValue(i int, x interface{}) bool
func (*BaseAgenda) Peek ¶
func (a *BaseAgenda) Peek() *ScoredConfiguration
func (*BaseAgenda) Pop ¶
func (a *BaseAgenda) Pop() interface{}
func (*BaseAgenda) Push ¶
func (a *BaseAgenda) Push(x interface{})
func (*BaseAgenda) ReEnumerate ¶
func (a *BaseAgenda) ReEnumerate()
func (*BaseAgenda) Reverse ¶
func (a *BaseAgenda) Reverse()
func (*BaseAgenda) Set ¶
func (a *BaseAgenda) Set(i int, x interface{})
func (*BaseAgenda) String ¶
func (a *BaseAgenda) String() string
func (*BaseAgenda) Swap ¶
func (a *BaseAgenda) Swap(i, j int)
type Beam ¶
type Beam struct { // main beam functions and parameters Base transition.Configuration TransFunc transition.TransitionSystem FeatExtractor perceptron.FeatureExtractor Model TransitionModel.Interface Size int EstimatedTransitions int EarlyUpdateAt int // flags Averaged bool DecodeTest bool // set to true when decoding is 'testing' during learning process ReturnModelValue bool ReturnSequence bool ShowConsiderations bool ConcurrentExec bool Log bool ShortTempAgenda bool NoRecover bool Align bool DurTotal time.Duration // used for debug output Transitions *util.EnumSet IntegrationGeneration int ScoredStoreDense bool // contains filtered or unexported fields }
func (*Beam) Concurrent ¶
func (*Beam) DecodeEarlyUpdate ¶
func (b *Beam) DecodeEarlyUpdate(goldInstance perceptron.DecodedInstance, m perceptron.Model) (perceptron.DecodedInstance, interface{}, interface{}, int, int, float64)
func (*Beam) Parse ¶
func (b *Beam) Parse(problem Problem) (transition.Configuration, interface{})
func (*Beam) SetEarlyUpdate ¶
type Candidate ¶
type Candidates ¶
type Deterministic ¶
type Deterministic struct { Model TransitionModel.Interface TransFunc transition.TransitionSystem FeatExtractor perceptron.FeatureExtractor ReturnModelValue bool ReturnSequence bool ShowConsiderations bool Base transition.Configuration NoRecover bool TransEnum *util.EnumSet DefaultTransType byte }
func (*Deterministic) Decode ¶
func (d *Deterministic) Decode(instance perceptron.Instance, m perceptron.Model) (perceptron.DecodedInstance, interface{})
Perceptron functions
func (*Deterministic) DecodeEarlyUpdate ¶
func (d *Deterministic) DecodeEarlyUpdate(goldInstance perceptron.DecodedInstance, m perceptron.Model) (perceptron.DecodedInstance, interface{}, interface{}, int, int, int64)
func (*Deterministic) DecodeGold ¶
func (d *Deterministic) DecodeGold(goldInstance perceptron.DecodedInstance, m perceptron.Model) (perceptron.DecodedInstance, interface{})
func (*Deterministic) Parse ¶
func (d *Deterministic) Parse(problem Problem) (transition.Configuration, interface{})
Parser functions
func (*Deterministic) ParseOracle ¶
func (d *Deterministic) ParseOracle(gold perceptron.DecodedInstance) (configuration transition.Configuration, result interface{})
func (*Deterministic) ParseOracleEarlyUpdate ¶
func (d *Deterministic) ParseOracleEarlyUpdate(sent nlp.Sentence, gold transition.ConfigurationSequence, constraints interface{}, model dependency.ParameterModel) (transition.Configuration, transition.Configuration, interface{}, interface{}, int)
type Interface ¶
type Interface interface { StartItem(p Problem) []Candidate Clear(Agenda) Agenda Insert(cs chan Candidate, a Agenda) []Candidate //Agenda Expand(c Candidate, p Problem, candidateNum int) chan Candidate Top(a Agenda) Candidate Best(a Agenda) Candidate GoalTest(p Problem, c Candidate, rounds int) bool TopB(a Agenda, B int) ([]Candidate, bool) Concurrent() bool SetEarlyUpdate(int) Name() string Aligned() bool }
type ParseResultParameters ¶
type ParseResultParameters struct { ModelValue interface{} Sequence transition.ConfigurationSequence }
type PerceptronModel ¶
type PerceptronModel struct {
PerceptronModel TransitionModel.Interface
}
func (*PerceptronModel) Model ¶
func (p *PerceptronModel) Model() interface{}
func (*PerceptronModel) TransitionModel ¶
func (p *PerceptronModel) TransitionModel() TransitionModel.Interface
type PerceptronModelValue ¶
type PerceptronModelValue struct {
// contains filtered or unexported fields
}
func (*PerceptronModelValue) Clear ¶
func (pmv *PerceptronModelValue) Clear()
type ScoreState ¶
type ScoreState []AssignmentScore
func NewScoreState ¶
func NewScoreState() ScoreState
func (*ScoreState) Add ¶
func (s *ScoreState) Add(score int64, assignment uint16)
func (ScoreState) Average ¶
func (s ScoreState) Average() float64
func (ScoreState) Copy ¶
func (s ScoreState) Copy() ScoreState
func (ScoreState) Total ¶
func (s ScoreState) Total() float64
type ScoredConfiguration ¶
type ScoredConfiguration struct { C transition.Configuration Transition transition.Transition InternalScores ScoreState Features *transition.FeaturesList CandidateNum, TransNum int Expanded bool Averaged bool }
func (*ScoredConfiguration) AddScore ¶
func (s *ScoredConfiguration) AddScore(newScore int64, assignment uint16)
func (*ScoredConfiguration) Alignment ¶
func (s *ScoredConfiguration) Alignment() int
func (*ScoredConfiguration) Clear ¶
func (s *ScoredConfiguration) Clear()
func (*ScoredConfiguration) Copy ¶
func (s *ScoredConfiguration) Copy() Candidate
func (*ScoredConfiguration) Equal ¶
func (s *ScoredConfiguration) Equal(otherEq Candidate) bool
func (*ScoredConfiguration) Expand ¶
func (s *ScoredConfiguration) Expand(t transition.TransitionSystem)
func (*ScoredConfiguration) Len ¶
func (s *ScoredConfiguration) Len() int
func (*ScoredConfiguration) Score ¶
func (s *ScoredConfiguration) Score() float64
func (*ScoredConfiguration) String ¶
func (s *ScoredConfiguration) String() string
func (*ScoredConfiguration) Terminal ¶
func (s *ScoredConfiguration) Terminal() bool
type ScoredConfigurations ¶
type ScoredConfigurations []*ScoredConfiguration
func (ScoredConfigurations) Equal ¶
func (scs ScoredConfigurations) Equal(otherEq util.Equaler) bool
func (ScoredConfigurations) Get ¶
func (scs ScoredConfigurations) Get(i int) Candidate
func (ScoredConfigurations) Len ¶
func (scs ScoredConfigurations) Len() int
type TransitionClassifier ¶
type TransitionClassifier struct { Model dependency.TransitionParameterModel TransFunc transition.TransitionSystem FeatExtractor perceptron.FeatureExtractor Score int64 FeaturesList *transition.FeaturesList ShowConsiderations bool }
func (*TransitionClassifier) Init ¶
func (tc *TransitionClassifier) Init()
func (*TransitionClassifier) ScoreWithConf ¶
func (tc *TransitionClassifier) ScoreWithConf(c transition.Configuration) int64
func (tc *TransitionClassifier) Increment(c transition.Configuration) *TransitionClassifier { features := tc.FeatExtractor.Features(perceptron.Instance(c), false, nil) tc.FeaturesList = &transition.FeaturesList{features, c.GetLastTransition(), tc.FeaturesList} tc.Score += tc.Model.TransitionScore(c.GetLastTransition(), features) return tc }
func (*TransitionClassifier) Transition ¶
func (tc *TransitionClassifier) Transition(c transition.Configuration) transition.Transition
func (*TransitionClassifier) TransitionWithConf ¶
func (tc *TransitionClassifier) TransitionWithConf(c transition.Configuration) (transition.Configuration, transition.Transition)
Click to show internal directories.
Click to hide internal directories.