:sparkles: support punctuation restoration
Browse files
examples/paraformer_test.go
CHANGED
|
@@ -8,10 +8,12 @@ import (
|
|
| 8 |
|
| 9 |
func TestParaformer(t *testing.T) {
|
| 10 |
config := paraformer.Config{
|
| 11 |
-
OnnxRuntimeLibPath:
|
| 12 |
-
ModelPath:
|
| 13 |
-
TokensPath:
|
| 14 |
-
CMVNPath:
|
|
|
|
|
|
|
| 15 |
}
|
| 16 |
|
| 17 |
asrEngine, err := paraformer.NewEngine(config)
|
|
@@ -20,7 +22,7 @@ func TestParaformer(t *testing.T) {
|
|
| 20 |
}
|
| 21 |
defer asrEngine.Destroy()
|
| 22 |
|
| 23 |
-
text, err := asrEngine.
|
| 24 |
if err != nil {
|
| 25 |
t.Fatalf("识别出错: %v", err)
|
| 26 |
return
|
|
|
|
| 8 |
|
| 9 |
func TestParaformer(t *testing.T) {
|
| 10 |
config := paraformer.Config{
|
| 11 |
+
OnnxRuntimeLibPath: "../lib/onnxruntime.dll",
|
| 12 |
+
ModelPath: "../paraformer_weights/model.int8.onnx",
|
| 13 |
+
TokensPath: "../paraformer_weights/tokens.txt",
|
| 14 |
+
CMVNPath: "../paraformer_weights/am.mvn",
|
| 15 |
+
PunctuationModelPath: "../paraformer_weights/punctuation_model.onnx",
|
| 16 |
+
PunctuationTokensPath: "../paraformer_weights/punctuation_tokens.json",
|
| 17 |
}
|
| 18 |
|
| 19 |
asrEngine, err := paraformer.NewEngine(config)
|
|
|
|
| 22 |
}
|
| 23 |
defer asrEngine.Destroy()
|
| 24 |
|
| 25 |
+
text, err := asrEngine.TranscribeFile("./zh-en.wav")
|
| 26 |
if err != nil {
|
| 27 |
t.Fatalf("识别出错: %v", err)
|
| 28 |
return
|
paraformer_weights/punctuation_model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e93593a6dbd69a07f8734ef269dbe861a379755f8d1c8354719432116f2c44bd
|
| 3 |
+
size 294372519
|
paraformer_weights/punctuation_tokens.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|