Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
bdfef747
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 1 年 前同步成功
通知
207
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bdfef747
编写于
9月 18, 2017
作者:
Y
Yibing Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adjust to pass ci
上级
acf2072e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
9 deletion
+11
-9
decoders/swig/ctc_beam_search_decoder.cpp
decoders/swig/ctc_beam_search_decoder.cpp
+1
-2
decoders/swig/ctc_greedy_decoder.cpp
decoders/swig/ctc_greedy_decoder.cpp
+1
-1
decoders/swig/ctc_greedy_decoder.h
decoders/swig/ctc_greedy_decoder.h
+2
-2
decoders/swig/decoder_utils.cpp
decoders/swig/decoder_utils.cpp
+1
-2
decoders/swig/decoder_utils.h
decoders/swig/decoder_utils.h
+1
-1
decoders/swig/path_trie.cpp
decoders/swig/path_trie.cpp
+2
-0
decoders/swig/scorer.cpp
decoders/swig/scorer.cpp
+3
-1
未找到文件。
decoders/swig/ctc_beam_search_decoder.cpp
浏览文件 @
bdfef747
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
#include "ThreadPool.h"
#include "ThreadPool.h"
#include "fst/fstlib.h"
#include "fst/fstlib.h"
#include "fst/log.h"
#include "decoder_utils.h"
#include "decoder_utils.h"
#include "path_trie.h"
#include "path_trie.h"
...
@@ -130,7 +129,7 @@ std::vector<std::pair<double, std::string>> ctc_beam_search_decoder(
...
@@ -130,7 +129,7 @@ std::vector<std::pair<double, std::string>> ctc_beam_search_decoder(
log_sum_exp
(
prefix_new
->
log_prob_nb_cur
,
log_p
);
log_sum_exp
(
prefix_new
->
log_prob_nb_cur
,
log_p
);
}
}
}
// end of loop over prefix
}
// end of loop over prefix
}
// end of loop over
chars
}
// end of loop over
vocabulary
prefixes
.
clear
();
prefixes
.
clear
();
// update log probs
// update log probs
...
...
decoders/swig/ctc_greedy_decoder.cpp
浏览文件 @
bdfef747
...
@@ -27,7 +27,7 @@ std::string ctc_greedy_decoder(
...
@@ -27,7 +27,7 @@ std::string ctc_greedy_decoder(
max_prob
=
probs_step
[
j
];
max_prob
=
probs_step
[
j
];
}
}
}
}
// id with maximum probability in current step
// id with maximum probability in current
time
step
max_idx_vec
[
i
]
=
max_idx
;
max_idx_vec
[
i
]
=
max_idx
;
// deduplicate
// deduplicate
if
((
i
==
0
)
||
((
i
>
0
)
&&
max_idx_vec
[
i
]
!=
max_idx_vec
[
i
-
1
]))
{
if
((
i
==
0
)
||
((
i
>
0
)
&&
max_idx_vec
[
i
]
!=
max_idx_vec
[
i
-
1
]))
{
...
...
decoders/swig/ctc_greedy_decoder.h
浏览文件 @
bdfef747
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* The decoding result in string
* The decoding result in string
*/
*/
std
::
string
ctc_greedy_decoder
(
std
::
string
ctc_greedy_decoder
(
const
std
::
vector
<
std
::
vector
<
double
>>
&
probs_seq
,
const
std
::
vector
<
std
::
vector
<
double
>>
&
probs_seq
,
const
std
::
vector
<
std
::
string
>
&
vocabulary
);
const
std
::
vector
<
std
::
string
>
&
vocabulary
);
#endif // CTC_GREEDY_DECODER_H
#endif // CTC_GREEDY_DECODER_H
decoders/swig/decoder_utils.cpp
浏览文件 @
bdfef747
...
@@ -23,10 +23,9 @@ std::vector<std::pair<size_t, float>> get_pruned_log_probs(
...
@@ -23,10 +23,9 @@ std::vector<std::pair<size_t, float>> get_pruned_log_probs(
for
(
size_t
i
=
0
;
i
<
prob_idx
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
prob_idx
.
size
();
++
i
)
{
cum_prob
+=
prob_idx
[
i
].
second
;
cum_prob
+=
prob_idx
[
i
].
second
;
cutoff_len
+=
1
;
cutoff_len
+=
1
;
if
(
cum_prob
>=
cutoff_prob
)
break
;
if
(
cum_prob
>=
cutoff_prob
||
cutoff_len
>=
cutoff_top_n
)
break
;
}
}
}
}
cutoff_len
=
std
::
min
(
cutoff_len
,
cutoff_top_n
);
prob_idx
=
std
::
vector
<
std
::
pair
<
int
,
double
>>
(
prob_idx
=
std
::
vector
<
std
::
pair
<
int
,
double
>>
(
prob_idx
.
begin
(),
prob_idx
.
begin
()
+
cutoff_len
);
prob_idx
.
begin
(),
prob_idx
.
begin
()
+
cutoff_len
);
}
}
...
...
decoders/swig/decoder_utils.h
浏览文件 @
bdfef747
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
#define DECODER_UTILS_H_
#define DECODER_UTILS_H_
#include <utility>
#include <utility>
#include "path_trie.h"
#include "fst/log.h"
#include "fst/log.h"
#include "path_trie.h"
const
float
NUM_FLT_INF
=
std
::
numeric_limits
<
float
>::
max
();
const
float
NUM_FLT_INF
=
std
::
numeric_limits
<
float
>::
max
();
const
float
NUM_FLT_MIN
=
std
::
numeric_limits
<
float
>::
min
();
const
float
NUM_FLT_MIN
=
std
::
numeric_limits
<
float
>::
min
();
...
...
decoders/swig/path_trie.cpp
浏览文件 @
bdfef747
...
@@ -19,9 +19,11 @@ PathTrie::PathTrie() {
...
@@ -19,9 +19,11 @@ PathTrie::PathTrie() {
character
=
ROOT_
;
character
=
ROOT_
;
exists_
=
true
;
exists_
=
true
;
parent
=
nullptr
;
parent
=
nullptr
;
dictionary_
=
nullptr
;
dictionary_
=
nullptr
;
dictionary_state_
=
0
;
dictionary_state_
=
0
;
has_dictionary_
=
false
;
has_dictionary_
=
false
;
matcher_
=
nullptr
;
matcher_
=
nullptr
;
}
}
...
...
decoders/swig/scorer.cpp
浏览文件 @
bdfef747
...
@@ -19,9 +19,11 @@ Scorer::Scorer(double alpha,
...
@@ -19,9 +19,11 @@ Scorer::Scorer(double alpha,
const
std
::
vector
<
std
::
string
>&
vocab_list
)
{
const
std
::
vector
<
std
::
string
>&
vocab_list
)
{
this
->
alpha
=
alpha
;
this
->
alpha
=
alpha
;
this
->
beta
=
beta
;
this
->
beta
=
beta
;
dictionary
=
nullptr
;
is_character_based_
=
true
;
is_character_based_
=
true
;
language_model_
=
nullptr
;
language_model_
=
nullptr
;
dictionary
=
nullptr
;
max_order_
=
0
;
max_order_
=
0
;
dict_size_
=
0
;
dict_size_
=
0
;
SPACE_ID_
=
-
1
;
SPACE_ID_
=
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录