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
Pierre-Alexandre Broux
s4dl
Commits
46fbdb59
Commit
46fbdb59
authored
Mar 13, 2019
by
Sulfyderz
Browse files
[Error Update]:Improving the automaton methods from Show.
parent
32886abe
Pipeline
#559
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
s4dl/Show.py
View file @
46fbdb59
...
...
@@ -1511,7 +1511,7 @@ class Show(object):
listTmp
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
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'
]
):
actionsSegmentationBoundaryMergeThr
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
...
...
@@ -1525,7 +1525,7 @@ class Show(object):
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."
)
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'
]
):
actionsSegmentationBoundaryMergeThr
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
...
...
@@ -2416,7 +2416,7 @@ class Show(object):
listTmp
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
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'
]
):
actionsSegmentationBoundaryMergeThr
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
...
...
@@ -2430,7 +2430,7 @@ class Show(object):
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."
)
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'
]
):
actionsSegmentationBoundaryMergeThr
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
...
...
@@ -3090,7 +3090,7 @@ class Show(object):
listTmp
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
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
[
0
][
'cluster'
]
==
valueRef
[
'cluster'
]
):
actionsSegmentationBoundaryMergeThr
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
...
...
@@ -3104,7 +3104,7 @@ class Show(object):
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."
)
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'
]
):
actionsSegmentationBoundaryMergeThr
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
...
...
@@ -4077,7 +4077,7 @@ class Show(object):
listTmp
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
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
[
0
][
'cluster'
]
==
valueRef
[
'cluster'
]
):
actionsSegmentationBoundaryMergeThr
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
listTmp
[
0
],
listTmp
[
1
]]))
...
...
@@ -4091,7 +4091,7 @@ class Show(object):
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."
)
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'
]
):
actionsSegmentationBoundaryMergeThr
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
...
...
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