LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
birnn_seq2seq.h
Go to the documentation of this file.
1
// Copyright 2002-2021 CEA LIST
2
// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3
//
4
// SPDX-License-Identifier: MIT
5
6
#ifndef DEEPLIMA_SRC_INFERENCE_RNN_SEQ2SEQ_H
7
#define DEEPLIMA_SRC_INFERENCE_RNN_SEQ2SEQ_H
8
9
#include <vector>
10
#include <chrono>
11
#include <cstdlib>
12
13
#include "
deeplima/utils/std_matrix.h
"
14
#include "
deeplima/eigen_wrp/eigen_matrix.h
"
15
#include "
deeplima/eigen_wrp/lemmatization_eigen_inference_impl.h
"
16
// #include "deeplima/lemmatization/impl/lemmatization_wrapper.h"
17
18
namespace
deeplima
19
{
20
21
class
RnnSeq2Seq
:
public
eigen_wrp::EigenMatrixXf
,
22
public
lemmatization::eigen_impl::BiRnnSeq2SeqEigenInferenceForLemmatization
23
{
24
using
Model
=
lemmatization::eigen_impl::BiRnnSeq2SeqEigenInferenceForLemmatization
;
25
std::shared_ptr< StdMatrix<uint8_t> > m_output;
// external - classifier id, internal - time position
26
27
public
:
28
29
std::shared_ptr< StdMatrix<uint8_t> >
get_output
()
30
{
31
return
m_output;
32
}
33
34
RnnSeq2Seq
()
35
{
36
}
37
38
void
init
(uint32_t
/*max_feat*/
,
39
uint32_t
/*overlap*/
,
40
uint32_t
/*num_slots*/
,
41
uint32_t
/*slot_len*/
,
42
uint32_t
/*num_threads*/
)
43
{
44
std::cerr <<
"RnnSeq2Seq::init NOT IMPLEMENTED"
<< std::endl;
45
}
46
47
void
load
(
const
std::string& fn)
48
{
49
try
50
{
51
Model::load
(fn);
52
}
53
catch
(
const
std::runtime_error& e)
54
{
55
throw
;
56
}
57
}
58
59
virtual
~RnnSeq2Seq
()
60
{
61
// std::cerr << "-> ~RnnSeq2Seq" << std::endl;
62
// std::cerr << "<- ~RnnSeq2Seq" << std::endl;
63
}
64
};
65
66
}
// namespace deeplima
67
68
#endif
deeplima::RnnSeq2Seq
Definition
birnn_seq2seq.h:23
deeplima::RnnSeq2Seq::RnnSeq2Seq
RnnSeq2Seq()
Definition
birnn_seq2seq.h:34
deeplima::RnnSeq2Seq::load
void load(const std::string &fn)
Definition
birnn_seq2seq.h:47
deeplima::RnnSeq2Seq::~RnnSeq2Seq
virtual ~RnnSeq2Seq()
Definition
birnn_seq2seq.h:59
deeplima::RnnSeq2Seq::init
void init(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)
Definition
birnn_seq2seq.h:38
deeplima::RnnSeq2Seq::get_output
std::shared_ptr< StdMatrix< uint8_t > > get_output()
Definition
birnn_seq2seq.h:29
deeplima::eigen_wrp::EigenMatrix
Definition
eigen_matrix.h:18
deeplima::lemmatization::eigen_impl::BiRnnSeq2SeqEigenInferenceForLemmatization
Definition
lemmatization_eigen_inference_impl.h:46
deeplima::lemmatization::eigen_impl::BiRnnSeq2SeqEigenInferenceForLemmatization::load
virtual void load(const std::string &fn) override
Definition
lemmatization_eigen_inference_impl.h:52
eigen_matrix.h
lemmatization_eigen_inference_impl.h
deeplima
Definition
dependency_parser.h:28
std_matrix.h
deeplima
include
deeplima
nets
birnn_seq2seq.h
Generated by
1.9.8