Class FactoredVocab¶
Defined in File factored_vocab.h
Nested Relationships¶
Nested Types¶
Inheritance Relationships¶
Base Type¶
public marian::IVocab
(Class IVocab)
Class Documentation¶
-
class
FactoredVocab
: public marian::IVocab¶ Public Functions
-
virtual void
create
(const std::string &vocabPath, const std::vector<std::string> &trainPaths, size_t maxSize)¶
-
virtual size_t
size
() const¶
-
virtual void
createFake
()¶
-
size_t
factorVocabSize
() const¶
-
size_t
virtualVocabSize
() const¶
-
size_t
lemmaSize
() const¶
-
FactoredVocab::CSRData
csr_rows
(const Words &words) const¶
-
void
lemmaAndFactorsIndexes
(const Words &words, std::vector<IndexType> &lemmaIndices, std::vector<float> &factorIndices) const¶ Decodes the indexes of lemma and factor for each word and outputs that information separately.
It will return two data structures that contain separate information regarding lemmas and factors indexes by receiving a list with the word indexes of a batch.
- Parameters
[in] words
: vector of words[out] lemmaIndices
: lemma index for each word[out] factorIndices
: factor usage information for each word (1 if the factor is used 0 if not)
-
size_t
getNumGroups
() const¶
-
size_t
getTotalFactorCount
() const¶ Auxiliary function that return the total number of factors (no lemmas) in a factored vocabulary.
- Return
number of factors
-
bool
lemmaHasFactorGroup
(size_t factor0Index, size_t g) const¶
Public Static Functions
-
static bool
isFactorValid
(size_t factorIndex)¶
-
Ptr<FactoredVocab>
tryCreateAndLoad
(const std::string &path)¶
Public Static Attributes
-
constexpr size_t
FACTOR_NOT_APPLICABLE
= (SIZE_MAX - 1)¶
-
constexpr size_t
FACTOR_NOT_SPECIFIED
= (SIZE_MAX - 2)¶
-
struct
CSRData
¶
-
virtual void