提交 193c7e2d 编写于 作者: Y Yibing Liu

Format license and comments

上级 18e03956
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -69,7 +69,8 @@ Decoder::~Decoder() { ...@@ -69,7 +69,8 @@ Decoder::~Decoder() {
} }
std::string Decoder::decode( std::string Decoder::decode(
std::string key, std::vector<std::vector<kaldi::BaseFloat>>& log_probs) { std::string key,
const std::vector<std::vector<kaldi::BaseFloat>>& log_probs) {
size_t num_frames = log_probs.size(); size_t num_frames = log_probs.size();
size_t dim_label = log_probs[0].size(); size_t dim_label = log_probs[0].size();
......
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -37,8 +37,9 @@ public: ...@@ -37,8 +37,9 @@ public:
std::vector<std::string> decode(std::string posterior_rspecifier); std::vector<std::string> decode(std::string posterior_rspecifier);
// Accept the scores of one utterance and return the decoding result // Accept the scores of one utterance and return the decoding result
std::string decode(std::string key, std::string decode(
std::vector<std::vector<kaldi::BaseFloat>> &log_probs); std::string key,
const std::vector<std::vector<kaldi::BaseFloat>> &log_probs);
private: private:
// For decoding one utterance // For decoding one utterance
......
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -27,12 +27,13 @@ PYBIND11_MODULE(post_decode_faster, m) { ...@@ -27,12 +27,13 @@ PYBIND11_MODULE(post_decode_faster, m) {
.def("decode", .def("decode",
(std::vector<std::string> (Decoder::*)(std::string)) & (std::vector<std::string> (Decoder::*)(std::string)) &
Decoder::decode, Decoder::decode,
"Decode one input probability matrix " "Decode for the probability matrices in specifier "
"and return the transcription") "and return the transcriptions.")
.def("decode", .def(
"decode",
(std::string (Decoder::*)( (std::string (Decoder::*)(
std::string, std::vector<std::vector<kaldi::BaseFloat>>&)) & std::string, const std::vector<std::vector<kaldi::BaseFloat>>&)) &
Decoder::decode, Decoder::decode,
"Decode one input probability matrix " "Decode one input probability matrix "
"and return the transcription"); "and return the transcription.");
} }
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册