* Adding temperature scaling on Joiner logits:
- T hard-coded to 2.0
- so far best result NCE 0.122 (still not so high)
- the BPE scores were rescaled with 0.2 (but then also incorrect words
get high confidence, visually reasonable histograms are for 0.5 scale)
- BPE->WORD score merging done by min(.) function
(tried also prob-product, and also arithmetic, geometric, harmonic mean)
- without temperature scaling (i.e. scale 1.0), the best NCE was 0.032 (here product merging was best)
Results seem consistent with: https://arxiv.org/abs/2110.15222
Everything tuned on a very-small set of 100 sentences with 813 words and 10.2% WER, a Czech model.
I also experimented with blank posteriors mixed into the BPE confidences,
but no NCE improvement found, so not pushing that.
Temperature scling added also to the Greedy search confidences.
* making `temperature_scale` configurable from outside
* add export of per-token scores (ys, lm, context)
- for best path of the modified-beam-search decoding of transducer
* refactoring JSON export of OnlineRecognitionResult, extending pybind11 API of OnlineRecognitionResult
* export per-token scores also for greedy-search (online-transducer)
- export un-scaled lm_probs (modified-beam search, online-transducer)
- polishing
* fill lm_probs/context_scores only if LM/ContextGraph is present (make Result smaller)
* Refactor online recognizer.
Make it easier to support other streaming models.
Note that it is a breaking change for the Python API.
`sherpa_onnx.OnlineRecognizer()` used before should be
replaced by `sherpa_onnx.OnlineRecognizer.from_transducer()`.
* rnnlm model inference supports num_threads setting
* rnnlm params decouple num_thread and provider with Transducer.
* fix python csrc bug which offline-lm-config.cc and online-lm-config.cc arguments problem
* lm_num_threads and lm_provider set default values
---------
Co-authored-by: cuidongcai1035 <cuidongcai1035@wezhuiyi.com>
* added csrc/stack.cc
* stack: added checks
* added copyright info
* passed cpp style checks
* formatted code
* added some support for streaming conformer model support (not verified)
* code lint
* made more progress with streaming conformer support (not working yet)
* passed style check
* changes as suggested by @csukuangfj
* added some debug info
* fixed style check
* Use Cat to replace Stack
* remove debug statements
---------
Co-authored-by: Jingzhao Ou (jou2019) <jou2019@cisco.com>
Co-authored-by: Fangjun Kuang <csukuangfj@gmail.com>
* Don't reset model state and feature extractor on endpointing
* support passing decoding_method from commandline
* Add modified_beam_search to Python API
* fix C API example
* Fix style issues