Documentation ¶
Index ¶
Constants ¶
const PStep = "recognition/post-correction"
const Version = "v0.0.40"
Version defines the version of apoco.
Variables ¶
This section is empty.
Functions ¶
func ConnectProfile ¶ added in v0.0.37
func ConnectProfile(c *Config, suffix string) apoco.StreamFunc
ConnectProfile generates the profile by running the profiler or reads the profile from the cache and connects the profile with the tokens.
func IDFromFilePath ¶
IDFromFilePath generates an id based on the file group and the file path.
Types ¶
type Config ¶ added in v0.0.29
type Config struct { Model string `json:"model,omitempty"` Ngrams string `json:"ngrams"` ProfilerBin string `json:"profilerBin"` ProfilerConfig string `json:"profilerConfig"` RR TrainingSettings `json:"rr"` DM DMSettings `json:"dm"` Nocr int `json:"nocr"` Cache bool `json:"cache"` GT bool `json:"gt"` }
Config defines the command's configuration.
func ReadConfig ¶ added in v0.0.29
ReadConfig reads the config from a json or toml file. If the name is empty, an empty configuration file is returned. If name has the prefix '{' and the suffix '}' the name is interpreted as a json string and parsed accordingly (OCR-D compability).
type DMSettings ¶ added in v0.0.37
type DMSettings struct { TrainingSettings Cautious bool }
DMSettings encloses settings for dm training.
type Stok ¶ added in v0.0.21
Stok represents a stats token. Stat tokens explain correction decisions of apoco.
func MakeStok ¶ added in v0.0.21
MakeStok creates a new stats token from a according formatted line.
func (Stok) Cause ¶ added in v0.0.27
Cause returns the cause of a correction error. There are 3 possibilities. Either the correction candidate was missing, the correct correction candidate was not selected by the reranker or the correct correction canidate would have been available but could not be selected because of the imposed limit of the number of correction candidates. If the limit smaller or equal to 0, no limit is imposed.
type StokType ¶ added in v0.0.27
type StokType int
StokType gives the type of stoks.
const ( SkippedShort StokType = iota // Skipped short token. SkippedShortErr // Error in short token. SkippedNoCand // Skipped no canidate token. SkippedNoCandErr // Error in skipped no candidate token. SkippedLex // Skipped lexical token. FalseFriend // Error in skipped lexical token (false friend). RedundantCorrection // Redundant correction. InfelicitousCorrection // Infelicitous correction. SuccessfulCorrection // Successful correction. DoNotCareCorrection // Do not care correction. SuspiciousNotReplacedCorrect // Accept OCR. DodgedBullet // Dogded bullet. MissedOpportunity // Missed opportunity. SuspiciousNotReplacedNotCorrectErr // Skipped do not care. )
type TrainingSettings ¶ added in v0.0.37
type TrainingSettings struct { Features []string `json:"features"` LearningRate float64 `json:"learningRate"` Ntrain int `json:"ntrain"` }
TrainingSettings encloses different training settings.