LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
train_segmentation.cpp File Reference
#include "deeplima/segmentation/impl/utf8_reader.h"
#include "deeplima/segmentation/impl/segmentation_decoder.h"
#include "deeplima/torch_wrp/torch_matrix.h"
#include "static_graph/dict_holder_adapter.h"
#include "tasks/segmentation/model/birnn_classifier_for_segmentation.h"
#include "char_dict_builder.h"
#include "char_seq_vectorizer.h"
#include "train_segmentation.h"
#include <c10/util/Exception.h>
#include <fstream>
#include <iostream>
#include <memory>
#include <vector>

Go to the source code of this file.

Typedefs

typedef DictionaryBuilderImpl< CharNgramEncoder< Utf8Reader<> > > DictionaryBuilder
typedef CharSeqVectorizerImpl< CharNgramEncoder< Utf8Reader<> >, TorchMatrix< int64_t >, DictHolderAdapter< UInt64Dict, TorchMatrix< int64_t > > > Utf8CharSeqToTorchMatrix

Functions

template<class M>
std::shared_ptr< M > vectorize_gold (const CoNLLU::Annotation &annot, int64_t len, bool eos, bool mwt)
int train_segmentation_model (const CoNLLU::Treebank &tb, deeplima::segmentation::train::train_params_segmentation_t &params, int gpuid)

Typedef Documentation

◆ DictionaryBuilder

◆ Utf8CharSeqToTorchMatrix

Function Documentation

◆ train_segmentation_model()

int train_segmentation_model ( const CoNLLU::Treebank & tb,
deeplima::segmentation::train::train_params_segmentation_t & params,
int gpuid )

Definition at line 101 of file train_segmentation.cpp.

◆ vectorize_gold()

template<class M>
std::shared_ptr< M > vectorize_gold ( const CoNLLU::Annotation & annot,
int64_t len,
bool eos,
bool mwt )

Definition at line 36 of file train_segmentation.cpp.