FINALFRONTIER-DEPS(1)
π¦ finalfrontier-deps β the manual, but make it make sense π¦
okay so this is FINALFRONTIER-DEPS(1) β the dep-model girlies' manual page. grab a strawberry drink π and let's go.
β¨ NAME β¨
finalfrontier deps β trains dependency-based word embeddings with subword representations. yes bestie, that's the whole vibe. π
π SYNOPSIS π
finalfrontier deps [options] corpus output
π DESCRIPTION π
so what this subcommand does: it trains dependency based word embeddings (that's Levy and Goldberg, 2014 β iconic paper, iykyk π₯) using data from a corpus that's in CONLL-U format.
your corpus has sentences separated by empty lines. and lowkey the important part: every single sentence needs to be annotated with a dependency graph. no graph, no training, that's the deal π.
after training finishes, the embeddings get written to output in the finalfusion format. periodt.
πΈ OPTIONS πΈ
okay this is the long part, but honestly every one of these slaps in its own way. read them all, don't skip π
--bucketsEXP β the bucket exponent. finalfrontier uses2^EXPbuckets to store subword representations. each subword representation (n-gram) gets hashed, and that hash decides which bucket it lands in. more buckets = fewer bucket collisions between subword representations, but at the cost of memory use. default bucket exponent is21(that's approximately 2 million buckets, bestie π).--context-discardTHRESHOLD β the context discard threshold. it influences how often frequent contexts get discarded during training. default is1e-4.--context-mincountFREQ β the minimum count, which controls discarding of infrequent contexts. contexts occurring fewer than FREQ times are simply not considered during training. default minimum count is5.--context-target-sizeSIZE β the target size for the context vocabulary. at most SIZE contexts are included for training. only contexts appearing more frequently than the context at SIZE are included. π«--dependency-depthDEPTH β dependency contexts up to DEPTH distance from the focus word in the dependency graph will be used to learn the representation of the focus word. default depth is1.--dimsDIMS β the dimensionality of the trained word embeddings. default dimensionality is300.--discardTHRESHOLD β the discard threshold, which influences how often frequent focus words get discarded from training. default is1e-4.--epochsN β the number of training epochs. the number of necessary training epochs typically decreases as the corpus size goes up (big corpus energy π). default number of epochs is15.--hash-indexerINDEXER β the indexer to use when bucket-based subwords are used (peep--subwords). possible values arefinalfusionorfasttext. default:finalfusion.finalfusionuses the FNV-1a hasher, whereasfasttextemulates the (broken) implementation of FNV-1a in fastText. use offinalfusionis recommended, unless the resulting embeddings should be compatible with fastText.
-f,--formatFORMAT β the output format. must be one offasttext,finalfusion,word2vec,text, andtextdims.- literally all formats except
finalfusionresult in a loss of information:word2vec,text, andtextdimsdo not store subword embeddings, nor hyperparameters. thefastTextformat does not store all hyperparameters. π - the
fasttextformat can only be used in conjunction with--subwords bucketsand--hash-indexer fasttext.
- literally all formats except
--lrLEARNING_RATE β the learning rate determines what fraction of a gradient is used for parameter updates. default initial learning rate is0.05, and the learning rate decreases monotonically during training. it's giving "steady decline, but make it math" π--maxnLEN β the maximum n-gram length for subword representations. default:6--mincountFREQ β the minimum count controls discarding of infrequent focus words. focus words occurring fewer than FREQ times are not considered during training. default minimum count is5.--minnLEN β the minimum n-gram length for subword representations. default:3--ngram-mincountFREQ β the minimum n-gram frequency. n-grams occurring fewer than FREQ times are excluded from training. this option is only applicable with thengramsargument of thesubwordsoption. just a lil heads up π«Ά--ngram-target-sizeSIZE β the target size for the n-gram vocabulary. at most SIZE n-grams are included for training. only n-grams appearing more frequently than the n-gram at SIZE are included. this option is only applicable with thengramsargument of thesubwordsoption.--normalize-contextsβ normalize the attached form in the dependency contexts. β¨--nsFREQ β the number of negatives to sample per positive example. default:5--projectivizeβ projectivize dependency graphs before training embeddings. do it before, not after, bestie.--threadsN β the number of threads to use during training for parallelization. the default is to use half of the logical CPUs of the machine, capped at 20 threads. increasing the number of threads increases the probability of update collisions, which means you'll need more epochs to reach the same loss π (parallelism has a price, tragic).--subwordsSUBWORDS β the type of subword embeddings to train. possible types arebuckets,ngrams, andnone. subword embeddings are used to compute embeddings for unknown words by summing embeddings of n-grams within unknown words. π§- the
nonetype does not use subwords. the resulting model will not be able to assign an embedding to unknown words. (she simply doesn't know them, and that's that.) - the
ngramstype stores subword n-grams explicitly. the included n-gram lengths are specified using theminnandmaxnoptions. the frequency threshold for n-grams is configured with thengram-mincountoption. - the
bucketstype maps n-grams to buckets using the FNV1 hash. the considered n-gram lengths are specified using theminnandmaxnoptions. the number of buckets is controlled with thebucketsoption.
- the
--target-sizeSIZE β the target size for the token vocabulary. at most SIZE tokens are included for training. only tokens appearing more frequently than the token at SIZE are included.--untyped-depsβ only use the word of the attached token in the dependency relation as contexts to train the representation of the focus word. lowkey minimal, highkey useful π--use-rootβ include the abstract root node in the dependency graph as contexts during training. root node gets to sit with us now π³--zipfEXP β exponent s used in the Zipf distributionp(k) = 1 / (k^s H_N)for negative sampling. default:0.5
π EXAMPLES π
train embeddings on dewiki.txt using the dependency model with default parameters β chef's kiss, no notes:
finalfrontier deps dewiki.conll dewiki-deps.bin
now train embeddings with dimensionality 200 on dewiki.conll using the dependency model from contexts with depth up to 2:
finalfrontier deps --depth 2 --normalize --dims 200 \
dewiki.conll dewiki-deps.bin
ngl those examples are written exactly like the original says β copy them character for character, don't go "fixing" the flag names, bestie π«Ά
π SEE ALSO π
finalfrontier(1), finalfrontier-skipgram(1) β go read those too, they're the other main characters.
and that's the whole page! this iconic piece of documentation is version 3, written by Daniel de Kok and Sebastian PΓΌtz, dated Apr 6, 2019. absolute legends, we stan ππβ¨
π¦ where this page comes from
- nixos 26.05: finalfrontier-unstable 2022-01-06
- nixpkgs unstable: finalfrontier 0.9.4-unstable-2022-01-06
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms