Commit Graph

36 Commits

Author SHA1 Message Date
Reuben Morais
89f63dcd69 Make Scorer init fallible and check it in callers 2019-08-26 13:59:15 +02:00
Reuben Morais
1b18494e63 Address review comments 2019-08-23 12:19:32 +02:00
Reuben Morais
b2ef9cca83 Make Alphabet init fallible and check it in model creation 2019-08-23 12:19:32 +02:00
Reuben Morais
4dabd248bc Make Alphabet copyable and default-constructable and avoid pointers 2019-08-23 12:19:32 +02:00
Reuben Morais
4d882a8aec Simplify decoder impl by making it object oriented, avoid pointers where possible 2019-08-23 12:19:32 +02:00
Reuben Morais
e3bf5d3cc6 Only update time step of leaf prefixes
The intention of this check is to improve the accuracy of the timings by recording the time step where the character saw its highest probability rather than the first time step where it was seen. The problem happens when updating the time step of a prefix that already has children. In that case, if any of the children have a time step that is earlier than `new_timestep`, it'll break the linearity of the timings. My fix is to simply check that the prefix we're updating is a leaf.

For example, say during decoding we have the following beams (format is `(char | time)`, tree node id below, nodes with same id are the same object):

```
1. (-1 | 0 ) -> ('s' | 10) -> ('h' | 13) -> ('e' | 14)
        A                B                  C                D

2. (-1 | 0 ) -> ('s' | 10) -> ('h' | 14)
        A                B                  E
```

And the prefix list is [B, C, D, E]. Currently, if we process character 'h' in time step 15 with a probability higher than both C and E, we update both nodes to have time step 15, which breaks linearity in beam 1. With my fix, we only update node E, which is a leaf. In my tests this does fix the problem, but since we don't have any known good quality data to verify against, it's hard to know if it has other side effects.
2019-08-20 12:03:59 +02:00
Alexandre Lissy
c3a2b6ea48 Ensure proper removal of prefix
Fixes #2230
2019-07-10 13:27:18 +02:00
Francis Tyers
6e53fd8fe0
typo
X-DeepSpeech: NOBUILD
2019-06-22 22:18:25 +01:00
Reuben Morais
31afc6811f Switch to ConstFst from VectorFst and mmap trie file when reading 2019-06-21 22:21:19 -03:00
Reuben Morais
95a54bfdb8 Modify copies rather than live prefix scores in decoder_decode 2019-06-19 19:39:57 -03:00
Reuben Morais
d5d55958da Clean up formatting in ctc_beam_saerch_decoder.cpp 2019-06-19 19:39:57 -03:00
Reuben Morais
3ceb05e8b9 Keep absolute per-stream time step in DecoderState 2019-06-11 07:58:16 -03:00
Reuben Morais
494b573c80 Address review comments 2019-06-04 11:58:38 -03:00
Reuben Morais
1c87bf781a Avoid sorting prefix array twice 2019-06-01 15:06:56 -03:00
Reuben Morais
a46288e1c8 Only create Output structure for beams that are returned in the API 2019-06-01 15:02:41 -03:00
dabinat
d9a269412e CTC beam search streaming decoder (+6 squashed commits)
Squashed commits:
[2941b47] Fixed nits
[700572e] Restored old CTC decoder API
[5aaf75d] Fixed nits
[969d71a] Added a destructor for DecoderState
[af0be6e] Removed accumulated_logits
[9dcb7b4] CTC beam search streaming decoder
2019-05-21 20:54:19 -07:00
Michele Di Giorgio
aa27c61d01 Use std::map to fix compilation issue with clang
When building with clang the following compilation error is thrown:

symbol-table.h:199:3: error: no template named 'map'
    map<int64, int64> key_map_;
    ^

This patch solves that issue by explicitly specifying the std namespace.
2019-04-09 11:37:59 +01:00
Reuben Morais
1c52008572
Fix typo in warning name 2019-04-08 22:29:30 +00:00
Reuben Morais
a7cda8e761 Add version info to exported graphs 2019-04-02 21:06:03 -03:00
Reuben Morais
5bf6e63f1b Record character timing offset at peak probability of character
Uplifted from 173dddbe32
2019-02-17 22:41:18 -03:00
Reuben Morais
9e8c208be2 Don't save/load trie for character based LMs 2019-01-07 08:49:37 -02:00
Carlos Fonseca M
1dc6cc490c Add file access defines Windows 2018-12-14 14:43:59 -06:00
Carlos Fonseca M
bca54d3f03 Add OpenFST 1.6.9 Windows + README.mozilla 2018-12-14 14:33:27 -06:00
Reuben Morais
cfed8ccd4f Cache common objects in decoder build 2018-11-12 14:17:30 -02:00
Reuben Morais
a5bcecbe40 Address more review comments 2018-11-11 15:24:31 -02:00
Reuben Morais
4d05c9af46 Address review comments 2018-11-09 08:49:08 -02:00
Reuben Morais
3255f23426 ctcdecode binding fixes 2018-11-08 18:14:32 -02:00
Reuben Morais
a7144e1d38 Address review comments 2018-11-07 23:16:13 -02:00
Reuben Morais
f5e7dfc4b7 Add Python/NumPy bindings to ctcdecode 2018-11-03 07:48:02 -03:00
Reuben Morais
440893c58d Simplify ctcdecode API signatures to avoid nested STL structures
Flatten structure to avoid nested STL structures which are awkward to
wrap with SWIG and slower at runtime.
2018-11-03 07:48:02 -03:00
Reuben Morais
23497fde41 Use unique_ptr for Scorer members 2018-10-30 09:21:30 -03:00
Reuben Morais
68258e356c Address review comments 2018-10-29 23:57:14 -03:00
Reuben Morais
db3a36c36b Remove leftover hack making Scorer members public 2018-10-25 22:29:23 -03:00
Reuben Morais
cf57453beb Fix signature of ctc_beam_search_decoder_batch 2018-10-25 22:28:48 -03:00
Reuben Morais
770d742cd5 Adjust ctcdecode to use our Alphabet code, support using trie files 2018-10-25 17:01:05 -03:00
Reuben Morais
c34fc5b7ac Import parlance/ctcdecode into repository 2018-10-25 17:00:48 -03:00