Anchor-annotator 0.1.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {Anchor_annotator-0.1.0.dist-info → Anchor_annotator-0.2.1.dist-info}/METADATA +1 -1
- Anchor_annotator-0.2.1.dist-info/RECORD +21 -0
- anchor/_version.py +2 -2
- anchor/main.py +44 -22
- anchor/models.py +826 -481
- anchor/plot.py +428 -399
- anchor/undo.py +103 -134
- anchor/widgets.py +36 -45
- anchor/workers.py +43 -17
- Anchor_annotator-0.1.0.dist-info/RECORD +0 -21
- {Anchor_annotator-0.1.0.dist-info → Anchor_annotator-0.2.1.dist-info}/LICENSE +0 -0
- {Anchor_annotator-0.1.0.dist-info → Anchor_annotator-0.2.1.dist-info}/WHEEL +0 -0
- {Anchor_annotator-0.1.0.dist-info → Anchor_annotator-0.2.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: Anchor_annotator
|
3
|
-
Version: 0.1
|
3
|
+
Version: 0.2.1
|
4
4
|
Summary: Anchor annotator is a program for inspecting corpora for the Montreal Forced Aligner and correcting transcriptions and pronunciations.
|
5
5
|
Home-page: https://github.com/MontrealCorpusTools/Anchor-annotator
|
6
6
|
Author: Montreal Corpus Tools
|
@@ -0,0 +1,21 @@
|
|
1
|
+
anchor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
anchor/__main__.py,sha256=5ufG8lcx2x1am-04xI991AG7saJd24dxPw5JzjmB878,45
|
3
|
+
anchor/_version.py,sha256=MxUhzLJIZQfEpDTTcKSxciTGrMLd5v2VmMlHa2HGeo0,411
|
4
|
+
anchor/command_line.py,sha256=xvuCWaPWNVZTg5Ic28qbOYsOLaFbodhBsoZHKJSBazs,482
|
5
|
+
anchor/db.py,sha256=ef4lO6HtCKoxC9CorIc0ZbPxKpjHa576a0ZIBOWNU9E,4956
|
6
|
+
anchor/main.py,sha256=ySas07cnXXBkANqIMHai7tjNwqa5mNd4UaIjh358GgE,114287
|
7
|
+
anchor/models.py,sha256=lfQvb0hxXS53xtJLpJcRiDCi7ONMzhDbpZGpTOzEwbs,88737
|
8
|
+
anchor/plot.py,sha256=-7fT5TMguHLs96Sn3OqD3J2S2x3Q63eHrJhjl0J3LG4,107015
|
9
|
+
anchor/resources_rc.py,sha256=sQ6GvAK3NTVR5bvgR9jCWDeepSYOhEph2mg1ECxnMOs,3560262
|
10
|
+
anchor/settings.py,sha256=SJ9-5xjThJp3-zl99OBLWLSXZmsyUU1JNsgGWHlkJS8,46649
|
11
|
+
anchor/ui_error_dialog.py,sha256=c_QS0s1VaJEV9AhcrQZQyWHHpUPudWjJY1NI7Ytipio,3832
|
12
|
+
anchor/ui_main_window.py,sha256=aEABdKi1Eb1c2MKUsbCbufEp1lKSLFNsC9TPX244UPI,64618
|
13
|
+
anchor/ui_preferences.py,sha256=uer2Xzyq26j-5wwbIKKcK8YEe2w7OFJPXfWSkKcPWhI,40146
|
14
|
+
anchor/undo.py,sha256=PLtiAxC7U27vbega_p21vDRy4m9QBiHatDELlcNx08Y,32523
|
15
|
+
anchor/widgets.py,sha256=fUiF8fuVMTl2k46Z3xjLH930FPuOjwZGOLSAT6pV8Q8,135416
|
16
|
+
anchor/workers.py,sha256=-YPdxgZwZIGq8DPNFGD3oXZqFpruD6alEMMzHdvvVIE,170880
|
17
|
+
Anchor_annotator-0.2.1.dist-info/LICENSE,sha256=C0oIsblENEgWQ7XMNdYoXyXsIA5wa3YF0I9lK3H7A1s,1076
|
18
|
+
Anchor_annotator-0.2.1.dist-info/METADATA,sha256=XzwfT9KePIG6nnpsil3I1JvQyEZLdor5TJq03oevV6U,1500
|
19
|
+
Anchor_annotator-0.2.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
20
|
+
Anchor_annotator-0.2.1.dist-info/top_level.txt,sha256=wX6ZKxImGRZKFQjs3f6XYw_TfbAp6Xs3SmbLfLbFAJ0,7
|
21
|
+
Anchor_annotator-0.2.1.dist-info/RECORD,,
|
anchor/_version.py
CHANGED
anchor/main.py
CHANGED
@@ -33,6 +33,8 @@ from anchor.models import (
|
|
33
33
|
CorpusSelectionModel,
|
34
34
|
DiarizationModel,
|
35
35
|
DictionaryTableModel,
|
36
|
+
FileSelectionModel,
|
37
|
+
FileUtterancesModel,
|
36
38
|
OovModel,
|
37
39
|
SpeakerModel,
|
38
40
|
)
|
@@ -489,9 +491,12 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
489
491
|
self.dictionary_model = DictionaryTableModel(self)
|
490
492
|
self.oov_model = OovModel(self)
|
491
493
|
self.corpus_model = CorpusModel(self)
|
494
|
+
self.file_utterances_model = FileUtterancesModel(self)
|
492
495
|
self.speaker_model = SpeakerModel(self)
|
493
496
|
self.diarization_model = DiarizationModel(self)
|
494
497
|
|
498
|
+
self.file_utterances_model.set_corpus_model(self.corpus_model)
|
499
|
+
|
495
500
|
self.corpus_model.databaseSynced.connect(self.handle_changes_synced)
|
496
501
|
self.corpus_model.runFunction.connect(self.execute_runnable)
|
497
502
|
self.diarization_model.runFunction.connect(self.execute_runnable)
|
@@ -510,11 +515,15 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
510
515
|
self.diarization_model.set_corpus_model(self.corpus_model)
|
511
516
|
self.oov_model.set_corpus_model(self.corpus_model)
|
512
517
|
self.selection_model = CorpusSelectionModel(self.corpus_model)
|
518
|
+
self.file_selection_model = FileSelectionModel(self.file_utterances_model)
|
513
519
|
self.ui.utteranceListWidget.set_models(
|
514
520
|
self.corpus_model, self.selection_model, self.speaker_model
|
515
521
|
)
|
516
522
|
self.ui.utteranceDetailWidget.set_models(
|
517
|
-
self.corpus_model,
|
523
|
+
self.corpus_model,
|
524
|
+
self.file_utterances_model,
|
525
|
+
self.file_selection_model,
|
526
|
+
self.dictionary_model,
|
518
527
|
)
|
519
528
|
self.ui.speakerWidget.set_models(
|
520
529
|
self.corpus_model, self.selection_model, self.speaker_model
|
@@ -526,17 +535,25 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
526
535
|
self.ui.dictionaryWidget.set_models(self.dictionary_model)
|
527
536
|
self.ui.diarizationWidget.set_models(self.diarization_model, self.selection_model)
|
528
537
|
self.ui.oovWidget.set_models(self.oov_model)
|
529
|
-
self.
|
530
|
-
self.selection_model.
|
538
|
+
self.file_selection_model.currentUtteranceChanged.connect(self.change_utterance)
|
539
|
+
self.selection_model.fileViewRequested.connect(self.file_selection_model.set_current_file)
|
540
|
+
self.file_selection_model.fileChanged.connect(self.change_file)
|
531
541
|
self.selection_model.fileAboutToChange.connect(self.check_media_stop)
|
532
|
-
self.media_player.
|
542
|
+
self.media_player.set_models(self.file_selection_model)
|
533
543
|
self.corpus_model.addCommand.connect(self.update_corpus_stack)
|
544
|
+
self.file_utterances_model.addCommand.connect(self.update_corpus_stack)
|
545
|
+
self.file_selection_model.selectionChanged.connect(self.sync_selected_utterances)
|
534
546
|
|
535
547
|
self.g2p_model = None
|
536
548
|
self.acoustic_model = None
|
537
549
|
self.language_model = None
|
538
550
|
self.ivector_extractor = None
|
539
551
|
|
552
|
+
def sync_selected_utterances(self):
|
553
|
+
self.selection_model.update_selected_utterances(
|
554
|
+
self.file_selection_model.selected_utterances()
|
555
|
+
)
|
556
|
+
|
540
557
|
def check_media_stop(self):
|
541
558
|
if self.ui.playAct.isChecked():
|
542
559
|
self.ui.playAct.setChecked(False)
|
@@ -562,16 +579,18 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
562
579
|
self.dictionary_undo_stack.push(command)
|
563
580
|
|
564
581
|
def delete_utterances(self):
|
565
|
-
utts = self.
|
566
|
-
self.
|
582
|
+
utts = self.file_selection_model.selected_utterances()
|
583
|
+
self.file_utterances_model.delete_utterances(utts)
|
567
584
|
|
568
585
|
def split_utterances(self):
|
569
|
-
utts = self.
|
570
|
-
|
586
|
+
utts = self.file_selection_model.selected_utterances()
|
587
|
+
if len(utts) != 1:
|
588
|
+
return
|
589
|
+
self.file_utterances_model.split_utterances(utts[0])
|
571
590
|
|
572
591
|
def merge_utterances(self):
|
573
|
-
utts = self.
|
574
|
-
self.
|
592
|
+
utts = self.file_selection_model.selected_utterances()
|
593
|
+
self.file_utterances_model.merge_utterances(utts)
|
575
594
|
|
576
595
|
def check_actions(self):
|
577
596
|
self.ui.lockEditAct.setEnabled(True)
|
@@ -635,7 +654,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
635
654
|
|
636
655
|
def change_file(self):
|
637
656
|
self.ui.playAct.setChecked(False)
|
638
|
-
if self.
|
657
|
+
if self.file_utterances_model.file is None:
|
639
658
|
self.ui.playAct.setEnabled(False)
|
640
659
|
self.ui.panLeftAct.setEnabled(False)
|
641
660
|
self.ui.panRightAct.setEnabled(False)
|
@@ -655,14 +674,14 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
655
674
|
self.channel_select.addItem("Channel 0", userData=0)
|
656
675
|
self.channel_select.setEnabled(False)
|
657
676
|
if (
|
658
|
-
self.
|
659
|
-
and self.
|
677
|
+
self.file_utterances_model.file is not None
|
678
|
+
and self.file_utterances_model.file.num_channels > 1
|
660
679
|
):
|
661
680
|
self.channel_select.addItem("Channel 1", userData=1)
|
662
681
|
self.channel_select.setEnabled(True)
|
663
682
|
|
664
683
|
def change_utterance(self):
|
665
|
-
selection = self.
|
684
|
+
selection = self.file_selection_model.selected_utterances()
|
666
685
|
self.ui.deleteUtterancesAct.setEnabled(False)
|
667
686
|
self.ui.splitUtterancesAct.setEnabled(False)
|
668
687
|
self.ui.alignUtteranceAct.setEnabled(False)
|
@@ -670,8 +689,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
670
689
|
if not selection and self.selection_model.current_utterance_id is None:
|
671
690
|
return
|
672
691
|
|
673
|
-
self.ui.splitUtterancesAct.setEnabled(True)
|
674
692
|
if len(selection) == 1 or self.selection_model.current_utterance_id is not None:
|
693
|
+
self.ui.splitUtterancesAct.setEnabled(True)
|
675
694
|
if self.corpus_model.acoustic_model is not None and self.corpus_model.has_dictionary:
|
676
695
|
self.ui.alignUtteranceAct.setEnabled(True)
|
677
696
|
self.ui.segmentUtteranceAct.setEnabled(True)
|
@@ -684,7 +703,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
684
703
|
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
685
704
|
for worker in self.workers:
|
686
705
|
worker.stopped.set()
|
687
|
-
self.
|
706
|
+
self.file_selection_model.clean_up_for_close()
|
707
|
+
self.file_utterances_model.clean_up_for_close()
|
688
708
|
self.settings.setValue(
|
689
709
|
AnchorSettings.UTTERANCES_VISIBLE, self.ui.utteranceDockWidget.isVisible()
|
690
710
|
)
|
@@ -773,9 +793,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
773
793
|
self.ui.cluster_utterances_action.triggered.connect(self.begin_cluster_utterances)
|
774
794
|
self.ui.classify_speakers_action.triggered.connect(self.begin_classify_speakers)
|
775
795
|
self.selection_model.selectionAudioChanged.connect(self.enable_zoom)
|
776
|
-
self.ui.zoomInAct.triggered.connect(self.
|
777
|
-
self.ui.zoomToSelectionAct.triggered.connect(self.
|
778
|
-
self.ui.zoomOutAct.triggered.connect(self.
|
796
|
+
self.ui.zoomInAct.triggered.connect(self.file_selection_model.zoom_in)
|
797
|
+
self.ui.zoomToSelectionAct.triggered.connect(self.file_selection_model.zoom_to_selection)
|
798
|
+
self.ui.zoomOutAct.triggered.connect(self.file_selection_model.zoom_out)
|
779
799
|
self.ui.panLeftAct.triggered.connect(self.ui.utteranceDetailWidget.pan_left)
|
780
800
|
self.ui.panRightAct.triggered.connect(self.ui.utteranceDetailWidget.pan_right)
|
781
801
|
self.ui.mergeUtterancesAct.triggered.connect(self.merge_utterances)
|
@@ -807,7 +827,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
807
827
|
self.ui.toolBar.addWidget(self.volume_slider)
|
808
828
|
self.ui.toolBar.addWidget(self.channel_select)
|
809
829
|
self.ui.toolBar.addWidget(w2)
|
810
|
-
self.channel_select.currentIndexChanged.connect(
|
830
|
+
self.channel_select.currentIndexChanged.connect(
|
831
|
+
self.file_selection_model.set_current_channel
|
832
|
+
)
|
811
833
|
self.ui.changeVolumeAct.triggered.connect(self.media_player.set_volume)
|
812
834
|
self.ui.addSpeakerAct.triggered.connect(self.add_new_speaker)
|
813
835
|
self.ui.speakerWidget.tool_bar.addAction(self.ui.addSpeakerAct)
|
@@ -1209,6 +1231,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1209
1231
|
def close_corpus(self):
|
1210
1232
|
self.set_application_state("unloaded")
|
1211
1233
|
self.selection_model.clearSelection()
|
1234
|
+
self.file_selection_model.clearSelection()
|
1212
1235
|
if self.corpus_model.corpus is not None:
|
1213
1236
|
self.corpus_model.session.close()
|
1214
1237
|
self.corpus_model.setCorpus(None)
|
@@ -1517,8 +1540,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1517
1540
|
|
1518
1541
|
def finalize_segmentation(self, data):
|
1519
1542
|
original_utterance_id, split_data = data
|
1520
|
-
self.
|
1521
|
-
self.corpus_model.update_data()
|
1543
|
+
self.file_utterances_model.split_vad_utterance(original_utterance_id, split_data)
|
1522
1544
|
self.ensure_utterance_panel_visible()
|
1523
1545
|
|
1524
1546
|
def finalize_saving(self):
|