-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds documentation for some of the classes and methods #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this very needed documentation!
In general I prefer docstrings to follow the same format as in AggregationStrategy.__call__
(see here) so before I merge I'd like to reformat these docstrings.
Apart from that I added some suggestions that in my opinion are a bit clearer.
src/diart/functional.py
Outdated
@@ -288,6 +288,19 @@ def __init__( | |||
metric: Optional[str] = "cosine", | |||
max_speakers: int = 20 | |||
): | |||
"""Initializes an object for constrained incremental online clustering of speakers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to put this docstring at the level of the class instead of the constructor.
Also I prefer this definition:
"""Initializes an object for constrained incremental online clustering of speakers | |
"""Constrained online speaker clustering for global speaker tracking. |
src/diart/functional.py
Outdated
"""Initializes an object for constrained incremental online clustering of speakers | ||
|
||
Args: | ||
tau_active (float): Threshold for detecting active speakers. This threshold is applied on the maximum value of each output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tau_active (float): Threshold for detecting active speakers. This threshold is applied on the maximum value of each output | |
tau_active (float): Threshold for detecting active speakers. This is applied on the maximum value of per-speaker segmentation |
src/diart/functional.py
Outdated
|
||
Args: | ||
tau_active (float): Threshold for detecting active speakers. This threshold is applied on the maximum value of each output | ||
activation of the local segmentation model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activation of the local segmentation model. | |
activations from the local segmentation model. |
src/diart/functional.py
Outdated
tau_active (float): Threshold for detecting active speakers. This threshold is applied on the maximum value of each output | ||
activation of the local segmentation model. | ||
rho_update (float): Threshold for considering the extracted embedding when updating the centroid of the local speaker. | ||
The centroid to which a local speaker is mapped is only updated if the duration of speech of a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The centroid to which a local speaker is mapped is only updated if the duration of speech of a | |
The centroid to which a local speaker is mapped is only updated if its ratio of speech |
src/diart/functional.py
Outdated
activation of the local segmentation model. | ||
rho_update (float): Threshold for considering the extracted embedding when updating the centroid of the local speaker. | ||
The centroid to which a local speaker is mapped is only updated if the duration of speech of a | ||
local speaker is greater than this threshold. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local speaker is greater than this threshold. | |
is greater than this threshold. |
src/diart/mapping.py
Outdated
assignments (Iterable[Tuple[int, int]]): An iterable of tuples for assigning each local speaker to one global speaker. | ||
|
||
Returns: | ||
SpeakerMap: A SpeakerMap object wrapping a mapping matrix between local speakers and global speakers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SpeakerMap: A SpeakerMap object wrapping a mapping matrix between local speakers and global speakers. | |
a `SpeakerMap` with the given assignments |
src/diart/mapping.py
Outdated
@@ -82,6 +92,16 @@ class SpeakerMapBuilder: | |||
def hard_map( | |||
shape: Tuple[int, int], assignments: Iterable[Tuple[int, int]], maximize: bool | |||
) -> SpeakerMap: | |||
"""Returns a SpeakerMap object based on the given assignments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Returns a SpeakerMap object based on the given assignments. | |
"""Builds a `SpeakerMap` that forces the given assignments. |
src/diart/mapping.py
Outdated
|
||
Args: | ||
shape (Tuple[int, int]): shape of the mapping matrix | ||
assignments (Iterable[Tuple[int, int]]): An iterable of tuples for assigning each local speaker to one global speaker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assignments (Iterable[Tuple[int, int]]): An iterable of tuples for assigning each local speaker to one global speaker. | |
assignments (Iterable[Tuple[int, int]]): Iterable of tuples (source_speaker, target_speaker) representing an assignment. |
src/diart/mapping.py
Outdated
Args: | ||
shape (Tuple[int, int]): shape of the mapping matrix | ||
assignments (Iterable[Tuple[int, int]]): An iterable of tuples for assigning each local speaker to one global speaker. | ||
maximize (bool): whether or not to use a MaximizationObjective |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maximize (bool): whether or not to use a MaximizationObjective | |
maximize (bool): Whether to use scores where higher is better (true) or where lower is better (false). |
src/diart/mapping.py
Outdated
maximize (bool): whether or not to use a MaximizationObjective | ||
|
||
Returns: | ||
SpeakerMap: A SpeakerMap object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SpeakerMap: A SpeakerMap object. | |
a `SpeakerMap` with the given assignments. |
…al.py and mapping.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, just some style changes that I'll commit before merging.
No description provided.