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
Martin Lebourdais
s4d
Commits
3588e1e0
Commit
3588e1e0
authored
Mar 13, 2019
by
Sulfyderz
Browse files
[Error Update]:Improving the method automatonSegmentation from diar_tools.
parent
5745a8fa
Changes
1
Show whitespace changes
Inline
Side-by-side
s4d/diar_tools.py
View file @
3588e1e0
...
@@ -621,7 +621,7 @@ def automatonSegmentation(diarHyp,diarRef,diarUem=None,tolerance=0,modeNoGap=Fal
...
@@ -621,7 +621,7 @@ def automatonSegmentation(diarHyp,diarRef,diarUem=None,tolerance=0,modeNoGap=Fal
listTmp
.
append
(
y
)
listTmp
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
listTmp
.
append
(
y
)
listTmp
.
append
(
y
)
if
not
(
not
deleteBoundarySameConsecutiveSpk
and
listTmp
[
0
][
'cluster'
]
==
listTmp
[
1
][
'cluster'
]):
if
not
(
not
deleteBoundarySameConsecutiveSpk
and
listTmp
[
0
][
'cluster'
]
==
listTmp
[
1
][
'cluster'
]
and
listTmp
[
1
][
'cluster'
]
==
valueRef
[
'cluster'
]
):
actionsSegmentationBoundaryMerge
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
actionsSegmentationBoundaryMerge
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
actionsIncrementalSegmentationBoundaryMergeTurn
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
actionsIncrementalSegmentationBoundaryMergeTurn
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
if
modeNoGap
==
True
and
listTmp
[
0
][
'cluster'
]
!=
listTmp
[
1
][
'cluster'
]:
if
modeNoGap
==
True
and
listTmp
[
0
][
'cluster'
]
!=
listTmp
[
1
][
'cluster'
]:
...
@@ -634,7 +634,7 @@ def automatonSegmentation(diarHyp,diarRef,diarUem=None,tolerance=0,modeNoGap=Fal
...
@@ -634,7 +634,7 @@ def automatonSegmentation(diarHyp,diarRef,diarUem=None,tolerance=0,modeNoGap=Fal
if
not
(
Segment
.
intersection
(
newSegment
,
listTmp
[
y
])
is
not
None
or
newSegment
[
"stop"
]
==
listTmp
[
y
][
"start"
]
or
newSegment
[
"start"
]
==
listTmp
[
y
][
"stop"
]):
if
not
(
Segment
.
intersection
(
newSegment
,
listTmp
[
y
])
is
not
None
or
newSegment
[
"stop"
]
==
listTmp
[
y
][
"start"
]
or
newSegment
[
"start"
]
==
listTmp
[
y
][
"stop"
]):
logging
.
error
(
"Cannot have absence of a segment in Transcriber mode."
)
logging
.
error
(
"Cannot have absence of a segment in Transcriber mode."
)
raise
Exception
(
"Absence of a segment."
)
raise
Exception
(
"Absence of a segment."
)
if
not
(
not
deleteBoundarySameConsecutiveSpk
and
newSegment
[
'cluster'
]
==
listTmp
[
y
][
'cluster'
]):
if
not
(
not
deleteBoundarySameConsecutiveSpk
and
newSegment
[
'cluster'
]
==
listTmp
[
y
][
'cluster'
]
and
listTmp
[
y
][
'cluster'
]
==
valueRef
[
'cluster'
]
):
actionsSegmentationBoundaryMerge
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
actionsSegmentationBoundaryMerge
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
actionsIncrementalSegmentationBoundaryMergeTurn
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
actionsIncrementalSegmentationBoundaryMergeTurn
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
if
modeNoGap
==
True
and
newSegment
[
'cluster'
]
!=
listTmp
[
y
][
'cluster'
]:
if
modeNoGap
==
True
and
newSegment
[
'cluster'
]
!=
listTmp
[
y
][
'cluster'
]:
...
...
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