Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
606e2c23
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
“999d0fdbef0c18024c89c9a5eee309177dc4e160”上不存在“paddle/fluid/lite/kernels/arm/elementwise_compute.h”
提交
606e2c23
编写于
10月 24, 2022
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix as comment
上级
850096a3
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
19 addition
and
28 deletion
+19
-28
speechx/speechx/decoder/ctc_beam_search_opt.h
speechx/speechx/decoder/ctc_beam_search_opt.h
+2
-2
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.cc
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.cc
+2
-17
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.h
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.h
+3
-3
speechx/speechx/decoder/ctc_prefix_beam_search_decoder_main.cc
...hx/speechx/decoder/ctc_prefix_beam_search_decoder_main.cc
+3
-4
speechx/speechx/decoder/ctc_prefix_beam_search_score.h
speechx/speechx/decoder/ctc_prefix_beam_search_score.h
+7
-0
speechx/speechx/decoder/ctc_tlg_decoder.h
speechx/speechx/decoder/ctc_tlg_decoder.h
+2
-2
未找到文件。
speechx/speechx/decoder/ctc_beam_search_opt.h
浏览文件 @
606e2c23
...
...
@@ -37,13 +37,13 @@ struct CTCBeamSearchOptions {
// u2
int
first_beam_size
;
int
second_beam_size
;
CTCBeamSearchOptions
()
explicit
CTCBeamSearchOptions
()
:
blank
(
0
),
dict_file
(
"vocab.txt"
),
lm_path
(
""
),
beam_size
(
300
),
alpha
(
1.9
f
),
beta
(
5.0
),
beam_size
(
300
),
cutoff_prob
(
0.99
f
),
cutoff_top_n
(
40
),
num_proc_bsearch
(
10
),
...
...
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.cc
浏览文件 @
606e2c23
...
...
@@ -31,7 +31,7 @@ using paddle::platform::TracerEventType;
namespace
ppspeech
{
CTCPrefixBeamSearch
::
CTCPrefixBeamSearch
(
const
std
::
string
vocab_path
,
CTCPrefixBeamSearch
::
CTCPrefixBeamSearch
(
const
std
::
string
&
vocab_path
,
const
CTCBeamSearchOptions
&
opts
)
:
opts_
(
opts
)
{
unit_table_
=
std
::
shared_ptr
<
fst
::
SymbolTable
>
(
...
...
@@ -55,10 +55,7 @@ void CTCPrefixBeamSearch::Reset() {
// empty hyp with Score
std
::
vector
<
int
>
empty
;
PrefixScore
prefix_score
;
prefix_score
.
b
=
0.0
f
;
// log(1)
prefix_score
.
nb
=
-
kBaseFloatMax
;
// log(0)
prefix_score
.
v_b
=
0.0
f
;
// log(1)
prefix_score
.
v_nb
=
0.0
f
;
// log(1)
prefix_score
.
InitEmpty
();
cur_hyps_
[
empty
]
=
prefix_score
;
outputs_
.
emplace_back
(
empty
);
...
...
@@ -287,19 +284,7 @@ void CTCPrefixBeamSearch::UpdateOutputs(
int
s
=
0
;
int
e
=
0
;
for
(
int
i
=
0
;
i
<
input
.
size
();
++
i
)
{
// if (s < start_boundaries.size() && i == start_boundaries[s]){
// // <context>
// output.emplace_back(context_graph_->start_tag_id());
// ++s;
// }
output
.
emplace_back
(
input
[
i
]);
// if (e < end_boundaries.size() && i == end_boundaries[e]){
// // </context>
// output.emplace_back(context_graph_->end_tag_id());
// ++e;
// }
}
outputs_
.
emplace_back
(
output
);
...
...
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.h
浏览文件 @
606e2c23
...
...
@@ -27,7 +27,7 @@ namespace ppspeech {
class
ContextGraph
;
class
CTCPrefixBeamSearch
:
public
DecoderBase
{
public:
explicit
CTCPrefixBeamSearch
(
const
std
::
string
vocab_path
,
explicit
CTCPrefixBeamSearch
(
const
std
::
string
&
vocab_path
,
const
CTCBeamSearchOptions
&
opts
);
~
CTCPrefixBeamSearch
()
{}
...
...
@@ -77,7 +77,7 @@ class CTCPrefixBeamSearch : public DecoderBase {
private:
CTCBeamSearchOptions
opts_
;
std
::
shared_ptr
<
fst
::
SymbolTable
>
unit_table_
;
std
::
shared_ptr
<
fst
::
SymbolTable
>
unit_table_
{
nullptr
}
;
std
::
unordered_map
<
std
::
vector
<
int
>
,
PrefixScore
,
PrefixScoreHash
>
cur_hyps_
;
...
...
@@ -92,7 +92,7 @@ class CTCPrefixBeamSearch : public DecoderBase {
// Outputs contain the hypotheses_ and tags lik: <context> and </context>
std
::
vector
<
std
::
vector
<
int
>>
outputs_
;
std
::
shared_ptr
<
ContextGraph
>
context_graph_
=
nullptr
;
std
::
shared_ptr
<
ContextGraph
>
context_graph_
{
nullptr
}
;
DISALLOW_COPY_AND_ASSIGN
(
CTCPrefixBeamSearch
);
};
...
...
speechx/speechx/decoder/ctc_prefix_beam_search_decoder_main.cc
浏览文件 @
606e2c23
...
...
@@ -64,12 +64,11 @@ int main(int argc, char* argv[]) {
// nnet
ppspeech
::
ModelOptions
model_opts
;
model_opts
.
model_path
=
FLAGS_model_path
;
std
::
shared_ptr
<
ppspeech
::
U2Nnet
>
nnet
(
new
ppspeech
::
U2Nnet
(
model_opts
)
);
std
::
shared_ptr
<
ppspeech
::
U2Nnet
>
nnet
=
std
::
make_shared
<
ppspeech
::
U2Nnet
>
(
model_opts
);
// decodeable
std
::
shared_ptr
<
ppspeech
::
DataCache
>
raw_data
(
new
ppspeech
::
DataCache
());
std
::
shared_ptr
<
ppspeech
::
Decodable
>
decodable
(
new
ppspeech
::
Decodable
(
nnet
,
raw_data
));
std
::
shared_ptr
<
ppspeech
::
DataCache
>
raw_data
=
std
::
make_shared
<
ppspeech
::
DataCache
>
();
std
::
shared_ptr
<
ppspeech
::
Decodable
>
decodable
=
std
::
make_shared
<
ppspeech
::
Decodable
>
(
nnet
,
raw_data
);
// decoder
ppspeech
::
CTCBeamSearchOptions
opts
;
...
...
speechx/speechx/decoder/ctc_prefix_beam_search_score.h
浏览文件 @
606e2c23
...
...
@@ -73,6 +73,13 @@ struct PrefixScore {
int
prefix_len
)
{
CHECK
(
false
);
}
void
InitEmpty
()
{
b
=
0.0
f
;
// log(1)
nb
=
-
kBaseFloatMax
;
// log(0)
v_b
=
0.0
f
;
// log(1)
v_nb
=
0.0
f
;
// log(1)
}
};
struct
PrefixScoreHash
{
...
...
speechx/speechx/decoder/ctc_tlg_decoder.h
浏览文件 @
606e2c23
...
...
@@ -31,8 +31,8 @@ namespace ppspeech {
struct
TLGDecoderOptions
{
kaldi
::
LatticeFasterDecoderConfig
opts
{};
// todo remove later, add into decode resource
std
::
string
word_symbol_table
{}
;
std
::
string
fst_path
{}
;
std
::
string
word_symbol_table
;
std
::
string
fst_path
;
static
TLGDecoderOptions
InitFromFlags
()
{
TLGDecoderOptions
decoder_opts
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录