paddlespeech.vector.cluster.plda module

A popular speaker recognition/diarization model (LDA and PLDA).

Relevant Papers
  • This implementation of PLDA is based on the following papers.

  • PLDA model Training
    • Ye Jiang et. al, "PLDA Modeling in I-Vector and Supervector Space for Speaker Verification," in Interspeech, 2012.

    • Patrick Kenny et. al, "PLDA for speaker verification with utterances of arbitrary duration," in ICASSP, 2013.

  • PLDA scoring (fast scoring)
    • Daniel Garcia-Romero et. al, “Analysis of i-vector length normalization in speaker recognition systems,” in Interspeech, 2011.

    • Weiwei-LIN et. al, "Fast Scoring for PLDA with Uncertainty Propagation," in Odyssey, 2016.

    • Kong Aik Lee et. al, "Multi-session PLDA Scoring of I-vector for Partially Open-Set Speaker Detection," in Interspeech 2013.

Credits

This code is adapted from: https://git-lium.univ-lemans.fr/Larcher/sidekit

class paddlespeech.vector.cluster.plda.Ndx(ndx_file_name='', models=array([], dtype=float64), testsegs=array([], dtype=float64))[source]

Bases: object

A class that encodes trial index information. It has a list of model names and a list of test segment names and a matrix indicating which combinations of model and test segment are trials of interest.

Methods

filter(modlist, seglist, keep)

Removes some of the information in an Ndx.

validate()

Checks that an object of type Ndx obeys certain rules that must always be true.

save_ndx_object

filter(modlist, seglist, keep)[source]

Removes some of the information in an Ndx. Useful for creating a gender specific Ndx from a pooled gender Ndx. Depending on the value of 'keep', the two input lists indicate the strings to retain or the strings to discard.

save_ndx_object(output_file_name)[source]
validate()[source]

Checks that an object of type Ndx obeys certain rules that must always be true. Returns a boolean value indicating whether the object is valid

class paddlespeech.vector.cluster.plda.PLDA(mean=None, F=None, Sigma=None, rank_f=100, nb_iter=10, scaling_factor=1.0)[source]

Bases: object

A class to train PLDA model from embeddings.

The input is in paddlespeech.vector.cluster.diarization.EmbeddingMeta format. Trains a simplified PLDA model no within-class covariance matrix but full residual covariance matrix.

Methods

plda([emb_meta, output_file_name])

Trains PLDA model with no within class covariance matrix but full residual covariance matrix.

scoring(enroll, test, ndx[, ...])

Compute the PLDA scores between to sets of vectors.

plda(emb_meta=None, output_file_name=None)[source]

Trains PLDA model with no within class covariance matrix but full residual covariance matrix.

scoring(enroll, test, ndx, test_uncertainty=None, Vtrans=None, p_known=0.0, scaling_factor=1.0, check_missing=True)[source]

Compute the PLDA scores between to sets of vectors. The list of trials to perform is given in an Ndx object. PLDA matrices have to be pre-computed. i-vectors/x-vectors are supposed to be whitened before.

class paddlespeech.vector.cluster.plda.Scores(scores_file_name='')[source]

Bases: object

A class for storing scores for trials. The modelset and segset fields are lists of model and test segment names respectively. The element i,j of scoremat and scoremask corresponds to the trial involving model i and test segment j.

paddlespeech.vector.cluster.plda.fa_model_loop(batch_start, mini_batch_indices, factor_analyser, stat0, stats, e_h, e_hh)[source]

A function for PLDA estimation.

paddlespeech.vector.cluster.plda.ismember(list1, list2)[source]