Add online punctuation and casing prediction model for English language (#1224)

This commit is contained in:
jianyou
2024-08-06 17:33:38 +08:00
committed by GitHub
parent 52830cc910
commit 1414e4dc61
14 changed files with 874 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
// sherpa-onnx/csrc/online-punctuation-impl.h
//
// Copyright (c) 2024 Jian You (jianyou@cisco.com, Cisco Systems)
#ifndef SHERPA_ONNX_CSRC_ONLINE_PUNCTUATION_IMPL_H_
#define SHERPA_ONNX_CSRC_ONLINE_PUNCTUATION_IMPL_H_
#include <memory>
#include <string>
#include <vector>
#if __ANDROID_API__ >= 9
#include "android/asset_manager.h"
#include "android/asset_manager_jni.h"
#endif
#include "sherpa-onnx/csrc/online-punctuation.h"
namespace sherpa_onnx {
class OnlinePunctuationImpl {
public:
virtual ~OnlinePunctuationImpl() = default;
static std::unique_ptr<OnlinePunctuationImpl> Create(
const OnlinePunctuationConfig &config);
#if __ANDROID_API__ >= 9
static std::unique_ptr<OnlinePunctuationImpl> Create(
AAssetManager *mgr, const OnlinePunctuationConfig &config);
#endif
virtual std::string AddPunctuationWithCase(const std::string &text) const = 0;
};
} // namespace sherpa_onnx
#endif // SHERPA_ONNX_CSRC_ONLINE_PUNCTUATION_IMPL_H_