Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Meysam Shamsi
s4d
Commits
c447ff2b
Commit
c447ff2b
authored
Jul 07, 2020
by
Anthony Larcher
Browse files
write seg ALLIES
parent
ee1ca9b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
s4d/diar.py
View file @
c447ff2b
...
...
@@ -967,7 +967,7 @@ class Diar():
return
diarization
@
classmethod
def
to_string_seg
(
cls
,
diar
):
def
to_string_seg
(
cls
,
diar
,
time_float
=
False
):
"""
transform a diarization into a string
:param diar: a diarization
...
...
@@ -984,9 +984,15 @@ class Diar():
channel
=
'U'
if
diar
.
_attributes
.
exist
(
'channel'
):
channel
=
segment
[
'channel'
]
lst
.
append
(
'{:s} 1 {:d} {:d} {:s} {:s} {:s} {:s}
\n
'
.
format
(
segment
[
'show'
],
segment
[
'start'
],
segment
[
'stop'
]
-
segment
[
'start'
],
gender
,
channel
,
env
,
segment
[
'cluster'
]))
if
time_float
:
lst
.
append
(
'{:s} 1 {:d} {:d} {:s} {:s} {:s} {:s}
\n
'
.
format
(
segment
[
'show'
],
segment
[
'start'
],
segment
[
'stop'
]
-
segment
[
'start'
],
gender
,
channel
,
env
,
segment
[
'cluster'
]))
else
:
lst
.
append
(
'{:s} 1 {:.2f} {:.2f} {:s} {:s} {:s} {:s}
\n
'
.
format
(
segment
[
'show'
],
segment
[
'start'
],
segment
[
'stop'
]
-
segment
[
'start'
],
gender
,
channel
,
env
,
segment
[
'cluster'
]))
return
lst
@
classmethod
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment