forked from parlance/ctcdecode
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
int ctc_beam_decode(THFloatTensor *probs, THIntTensor *seq_len, THIntTensor *output, | ||
THFloatTensor *scores, THIntTensor *th_out_len, int top_paths, | ||
int beam_width, int blank_index, int merge_repeated, | ||
void *scorer); | ||
typedef enum { | ||
CTC, | ||
CTC_KENLM | ||
} DecodeType ; | ||
|
||
|
||
/* scorers */ | ||
void* get_kenlm_scorer(const wchar_t* label_str, int labels_size, int space_index, int blank_index, | ||
const char* lm_path, const char* trie_path); | ||
void* get_base_scorer(); | ||
|
||
|
||
/* decoders */ | ||
void* get_ctc_beam_decoder(int num_classes, int batch_size, int top_paths, int beam_width, int blank_index, | ||
int merge_repeated, void *scorer, DecodeType type); | ||
|
||
|
||
/* run decoding */ | ||
int ctc_beam_decode(THFloatTensor *probs, THIntTensor *seq_len, THIntTensor *output, | ||
THFloatTensor *scores, THIntTensor *th_out_len, | ||
void *decoder, DecodeType type); | ||
|
||
|
||
/* utilities */ | ||
int generate_lm_trie(const wchar_t* labels, int size, int blank_index, int space_index, | ||
const char* lm_path, const char* dictionary_path, const char* output_path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.