Support Agglomerative clustering. (#1384)
We use the open-source implementation from https://github.com/cdalitz/hclust-cpp
This commit is contained in:
28
sherpa-onnx/csrc/fast-clustering-config.h
Normal file
28
sherpa-onnx/csrc/fast-clustering-config.h
Normal file
@@ -0,0 +1,28 @@
|
||||
// sherpa-onnx/csrc/fast-clustering-config.h
|
||||
//
|
||||
// Copyright (c) 2024 Xiaomi Corporation
|
||||
|
||||
#ifndef SHERPA_ONNX_CSRC_FAST_CLUSTERING_CONFIG_H_
|
||||
#define SHERPA_ONNX_CSRC_FAST_CLUSTERING_CONFIG_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "sherpa-onnx/csrc/parse-options.h"
|
||||
|
||||
namespace sherpa_onnx {
|
||||
|
||||
struct FastClusteringConfig {
|
||||
// If greater than 0, then threshold is ignored
|
||||
int32_t num_clusters = -1;
|
||||
|
||||
// distance threshold
|
||||
float threshold = 0.5;
|
||||
|
||||
std::string ToString() const;
|
||||
|
||||
void Register(ParseOptions *po);
|
||||
bool Validate() const;
|
||||
};
|
||||
|
||||
} // namespace sherpa_onnx
|
||||
#endif // SHERPA_ONNX_CSRC_FAST_CLUSTERING_CONFIG_H_
|
||||
Reference in New Issue
Block a user