Coder Social home page Coder Social logo

Comments (9)

wq2012 avatar wq2012 commented on May 29, 2024 1

Ah I see.

Spectral clustering (or to be more specific, the eigen-gap criterion) doesn't work well at distinguishing single speaker vs multi speakers. We usually always set min_clusters=2 for spectral clustering.

To handle single speaker utterances, what we do is:

  • We use an RNN-T speaker turn detection model to detect speaker turns.
  • If there is at least one highly-confident speaker turn, then we trigger spectral clustering, with `min_clusters=2.
  • Otherwise, we assume there is only one single speaker.

However since the RNN-T speaker turn model is not open sourced, I guess we will have to do something else to handle single speaker cases.

A few ideas I can think of:

  • Use some other implementations of speaker turn/change detection.
  • Pre-processing: always run another faster clustering (e.g. hierarchical) first to decide whether there are at least two speakers.
  • Pre-processing: compute max-distance between any pair of embeddings (or perhaps only neighboring pairs?) and threshold that max-distance to decide whether there are at least two speakers.
  • Post-processing (the one you mentioned): if n_clusters=2, compare centroids with simple threshold.

from spectralcluster.

wq2012 avatar wq2012 commented on May 29, 2024 1

I can update this library to implement some of these ideas. Stay tuned!

from spectralcluster.

hbredin avatar hbredin commented on May 29, 2024

I see from the GitHub logs that you have been working on this. Thanks!

What about fitting the values of the affinity matrix with

  • 1-gaussian GMM
  • 2-gaussians GMM
    and use the BIC criterion to decide which is best.

If 2-gaussians GMM is best, it would mean that there are actually two modes in the distribution of affinity value (one for intra cluster affinity, one for inter cluster affinity)... and therefore strictly more than one cluster. Otherwise there is probably just one cluster.

This approach (if succesfull) would have the extra benefit of not relying on any additional threshold.

from spectralcluster.

wq2012 avatar wq2012 commented on May 29, 2024

That's a good idea! I will give it a try.

from spectralcluster.

wq2012 avatar wq2012 commented on May 29, 2024

I've changed the default value of single_cluster_condition to AffinityGmmBic.

from spectralcluster.

wq2012 avatar wq2012 commented on May 29, 2024

Just realized one thing.

The diagonals of the affinity matrix will be 1. So if we use GMM BIC, it's very likely it's always going to be GMM-2 wins, as the diagonals would be significantly larger than anything else.

We should remove/crop diagonal before we fit GMM to the affinity values.

from spectralcluster.

hbredin avatar hbredin commented on May 29, 2024

Good point. Same goes for values close to the diagonal in case embeddings are extracted using an overlapping sliding window.

from spectralcluster.

wq2012 avatar wq2012 commented on May 29, 2024

OK, I added a parameter single_cluster_affinity_diagonal_offset, which defaults to 1

from spectralcluster.

wq2012 avatar wq2012 commented on May 29, 2024

Please use version 0.2.11.

from spectralcluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.