batchalign 0.7.21__tar.gz → 0.7.21.post1__tar.gz
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.
- {batchalign-0.7.21/batchalign.egg-info → batchalign-0.7.21.post1}/PKG-INFO +9 -3
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/cli/dispatch.py +2 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/__init__.py +3 -1
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/asr/rev.py +2 -2
- batchalign-0.7.21.post1/batchalign/pipelines/diarization/__init__.py +1 -0
- batchalign-0.7.21.post1/batchalign/pipelines/diarization/pyannote.py +103 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/dispatch.py +7 -2
- batchalign-0.7.21.post1/batchalign/version +3 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1/batchalign.egg-info}/PKG-INFO +9 -3
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign.egg-info/SOURCES.txt +2 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign.egg-info/requires.txt +6 -1
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/setup.py +8 -3
- batchalign-0.7.21/batchalign/version +0 -3
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/LICENSE +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/MANIFEST.in +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/README.md +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/__main__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/cli/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/cli/cli.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/constants.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/document.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/errors.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/base.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/chat/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/chat/file.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/chat/generator.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/chat/lexer.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/chat/parser.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/chat/utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/textgrid/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/textgrid/file.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/textgrid/generator.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/formats/textgrid/parser.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/resolve.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/speaker/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/speaker/config.yaml +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/speaker/infer.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/speaker/utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/training/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/training/run.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/training/utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utterance/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utterance/cantonese_infer.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utterance/dataset.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utterance/execute.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utterance/infer.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utterance/prep.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utterance/train.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/wave2vec/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/wave2vec/infer_fa.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/whisper/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/whisper/infer_asr.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/whisper/infer_fa.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/analysis/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/analysis/eval.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/asr/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/asr/num2chinese.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/asr/oai_whisper.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/asr/utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/asr/whisper.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/asr/whisperx.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/avqi/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/avqi/engine.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/base.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/cleanup.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/disfluencies.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/parse_support.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/retrace.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/support/filled_pauses.eng +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/support/replacements.eng +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/support/test.test +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/fa/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/fa/wave2vec_fa.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/fa/whisper_fa.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/coref.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/en/irr.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/fr/apm.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/fr/apmn.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/fr/case.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/ja/verbforms.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/ud.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/pipeline.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/speaker/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/speaker/nemo_speaker.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/translate/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/translate/gtrans.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/translate/seamless.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/translate/utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/utr/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/utr/rev_utr.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/utr/utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/utr/whisper_utr.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/utterance/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/utterance/ud_utterance.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/conftest.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_file.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_generator.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_lexer.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_parser.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/textgrid/test_textgrid.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/analysis/test_eval.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/asr/test_asr_pipeline.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/asr/test_asr_utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/cleanup/test_disfluency.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/cleanup/test_parse_support.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/fa/test_fa_pipeline.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/fixures.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/test_pipeline.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/test_pipeline_models.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/test_document.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/utils/__init__.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/utils/abbrev.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/utils/compounds.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/utils/config.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/utils/dp.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/utils/names.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/utils/utils.py +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign.egg-info/dependency_links.txt +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign.egg-info/entry_points.txt +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign.egg-info/top_level.txt +0 -0
- {batchalign-0.7.21 → batchalign-0.7.21.post1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: batchalign
|
|
3
|
-
Version: 0.7.21
|
|
3
|
+
Version: 0.7.21.post1
|
|
4
4
|
Summary: Python Speech Language Sample Analysis
|
|
5
5
|
Author: Brian MacWhinney, Houjun Liu
|
|
6
6
|
Author-email: macw@cmu.edu, houjun@cmu.edu
|
|
@@ -17,6 +17,8 @@ Requires-Dist: pydub
|
|
|
17
17
|
Requires-Dist: plotly>=5.3.0
|
|
18
18
|
Requires-Dist: transformers>=4.38.2
|
|
19
19
|
Requires-Dist: tokenizers>=0.14.1
|
|
20
|
+
Requires-Dist: numba>=0.61.0
|
|
21
|
+
Requires-Dist: numpy<=2.2
|
|
20
22
|
Requires-Dist: pycountry>=22.3
|
|
21
23
|
Requires-Dist: stanza[transformers]>=1.10.1
|
|
22
24
|
Requires-Dist: scipy~=1.11
|
|
@@ -35,8 +37,11 @@ Requires-Dist: tiktoken
|
|
|
35
37
|
Requires-Dist: blobfile
|
|
36
38
|
Requires-Dist: sentencepiece
|
|
37
39
|
Requires-Dist: googletrans
|
|
38
|
-
Requires-Dist: openai-whisper
|
|
40
|
+
Requires-Dist: openai-whisper
|
|
41
|
+
Requires-Dist: llvmlite>=0.44.0
|
|
39
42
|
Requires-Dist: praat-parselmouth==0.4.6
|
|
43
|
+
Requires-Dist: pyannote.audio
|
|
44
|
+
Requires-Dist: onnxruntime
|
|
40
45
|
Provides-Extra: dev
|
|
41
46
|
Requires-Dist: pytest; extra == "dev"
|
|
42
47
|
Provides-Extra: train
|
|
@@ -49,6 +54,7 @@ Dynamic: author-email
|
|
|
49
54
|
Dynamic: classifier
|
|
50
55
|
Dynamic: description
|
|
51
56
|
Dynamic: description-content-type
|
|
57
|
+
Dynamic: license-file
|
|
52
58
|
Dynamic: provides-extra
|
|
53
59
|
Dynamic: requires-dist
|
|
54
60
|
Dynamic: summary
|
|
@@ -163,9 +163,11 @@ def _dispatch(command, lang, num_speakers,
|
|
|
163
163
|
callback=lambda *args:progress_callback(file, *args),
|
|
164
164
|
**kw)
|
|
165
165
|
msgs = [escape(str(i.message)).strip() for i in w]
|
|
166
|
+
msgs = [i for i in msgs if "torchaudio" not in i.lower()]
|
|
166
167
|
# write the format, as needed
|
|
167
168
|
writer(doc, output)
|
|
168
169
|
# print any warnings
|
|
170
|
+
|
|
169
171
|
if len(msgs) > 0:
|
|
170
172
|
if ctx.obj["verbose"] > 1:
|
|
171
173
|
Console().print(f"\n[bold yellow]WARN[/bold yellow] on {file}:\n","\n".join(msgs)+"\n")
|
|
@@ -13,4 +13,6 @@ from .analysis import EvaluationEngine
|
|
|
13
13
|
from .utterance import StanzaUtteranceEngine
|
|
14
14
|
|
|
15
15
|
from .translate import SeamlessTranslationModel, GoogleTranslateEngine
|
|
16
|
-
from .avqi import AVQIEngine
|
|
16
|
+
from .avqi import AVQIEngine
|
|
17
|
+
|
|
18
|
+
from .diarization import PyannoteEngine
|
|
@@ -28,9 +28,9 @@ class RevEngine(BatchalignEngine):
|
|
|
28
28
|
# if there is no utterance segmentation scheme, we only
|
|
29
29
|
# run ASR
|
|
30
30
|
if self.__engine:
|
|
31
|
-
return [ Task.ASR, Task.
|
|
31
|
+
return [ Task.ASR, Task.UTTERANCE_SEGMENTATION ]
|
|
32
32
|
else:
|
|
33
|
-
return [ Task.ASR
|
|
33
|
+
return [ Task.ASR ]
|
|
34
34
|
|
|
35
35
|
def __init__(self, key:str=None, lang="eng", num_speakers=2):
|
|
36
36
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .pyannote import PyannoteEngine
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# system utils
|
|
2
|
+
import glob, os, re
|
|
3
|
+
from itertools import groupby
|
|
4
|
+
|
|
5
|
+
# pathing tools
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
# UD tools
|
|
9
|
+
import stanza
|
|
10
|
+
|
|
11
|
+
import copy
|
|
12
|
+
|
|
13
|
+
from stanza.utils.conll import CoNLL
|
|
14
|
+
from stanza import Document, DownloadMethod
|
|
15
|
+
from stanza.models.common.doc import Token
|
|
16
|
+
from stanza.pipeline.core import CONSTITUENCY
|
|
17
|
+
from stanza import DownloadMethod
|
|
18
|
+
from torch import heaviside
|
|
19
|
+
|
|
20
|
+
from stanza.pipeline.processor import ProcessorVariant, register_processor_variant
|
|
21
|
+
from stanza.resources.common import download_resources_json, load_resources_json, get_language_resources
|
|
22
|
+
|
|
23
|
+
# the loading bar
|
|
24
|
+
from tqdm import tqdm
|
|
25
|
+
|
|
26
|
+
from bdb import BdbQuit
|
|
27
|
+
|
|
28
|
+
from nltk import word_tokenize
|
|
29
|
+
from collections import defaultdict
|
|
30
|
+
|
|
31
|
+
import warnings
|
|
32
|
+
|
|
33
|
+
from stanza.utils.conll import CoNLL
|
|
34
|
+
|
|
35
|
+
# Oneliner of directory-based glob and replace
|
|
36
|
+
globase = lambda path, statement: glob.glob(os.path.join(path, statement))
|
|
37
|
+
repath_file = lambda file_path, new_dir: os.path.join(new_dir, pathlib.Path(file_path).name)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
from batchalign.document import *
|
|
41
|
+
from batchalign.constants import *
|
|
42
|
+
from batchalign.pipelines.base import *
|
|
43
|
+
from batchalign.formats.chat.parser import chat_parse_utterance
|
|
44
|
+
|
|
45
|
+
from batchalign.utils.dp import *
|
|
46
|
+
|
|
47
|
+
from pyannote.audio import Pipeline
|
|
48
|
+
|
|
49
|
+
import logging
|
|
50
|
+
L = logging.getLogger("batchalign")
|
|
51
|
+
|
|
52
|
+
import pycountry
|
|
53
|
+
|
|
54
|
+
class PyannoteEngine(BatchalignEngine):
|
|
55
|
+
tasks = [ Task.SPEAKER_RECOGNITION ]
|
|
56
|
+
status_hook = None
|
|
57
|
+
|
|
58
|
+
def __init__(self, num_speakers=2):
|
|
59
|
+
self.pipe = Pipeline.from_pretrained("talkbank/dia-fork")
|
|
60
|
+
self.num_speakers = num_speakers
|
|
61
|
+
|
|
62
|
+
def process(self, doc):
|
|
63
|
+
assert doc.media != None and doc.media.url != None, f"We cannot diarize something that doesn't have a media path! Provided media tier='{doc.media}'"
|
|
64
|
+
res = self.pipe(doc.media.url, num_speakers=self.num_speakers)
|
|
65
|
+
|
|
66
|
+
speakers = list(set([int(i[-1].split("_")[-1])
|
|
67
|
+
for i in res.itertracks(yield_label=True)]))
|
|
68
|
+
corpus = doc.tiers[0].corpus
|
|
69
|
+
lang = doc.tiers[0].lang
|
|
70
|
+
tiers = {
|
|
71
|
+
i:
|
|
72
|
+
Tier(
|
|
73
|
+
lang=lang, corpus=corpus,
|
|
74
|
+
id="PAR"+str(i), name="Participant",
|
|
75
|
+
birthday="",
|
|
76
|
+
)
|
|
77
|
+
for i in speakers
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
for i in doc.content:
|
|
81
|
+
if not isinstance(i, Utterance):
|
|
82
|
+
continue
|
|
83
|
+
if i.alignment is None:
|
|
84
|
+
continue
|
|
85
|
+
start,end = i.alignment
|
|
86
|
+
if start is None or end is None:
|
|
87
|
+
continue
|
|
88
|
+
|
|
89
|
+
for (a,b),_,speaker in res.itertracks(yield_label=True):
|
|
90
|
+
speaker_id = int(speaker.split("_")[-1])
|
|
91
|
+
tier = tiers.get(speaker_id)
|
|
92
|
+
# we set the end time of the utterance as the
|
|
93
|
+
# *LAST* segment it ends before
|
|
94
|
+
# i.e. [seg_end, ....., ut_end]
|
|
95
|
+
# like that
|
|
96
|
+
if b <= end/1000 and tier:
|
|
97
|
+
i.tier = tier
|
|
98
|
+
|
|
99
|
+
# doc.tiers = list(tiers.values())
|
|
100
|
+
|
|
101
|
+
return doc
|
|
102
|
+
|
|
103
|
+
|
|
@@ -7,7 +7,7 @@ from batchalign import (WhisperEngine, WhisperFAEngine, StanzaEngine, RevEngine,
|
|
|
7
7
|
NgramRetraceEngine, DisfluencyReplacementEngine, WhisperUTREngine,
|
|
8
8
|
RevUTREngine, EvaluationEngine, WhisperXEngine, NemoSpeakerEngine,
|
|
9
9
|
StanzaUtteranceEngine, CorefEngine, Wave2VecFAEngine, SeamlessTranslationModel,
|
|
10
|
-
GoogleTranslateEngine, OAIWhisperEngine)
|
|
10
|
+
GoogleTranslateEngine, OAIWhisperEngine, PyannoteEngine)
|
|
11
11
|
from batchalign import BatchalignPipeline
|
|
12
12
|
from batchalign.models import resolve
|
|
13
13
|
|
|
@@ -22,7 +22,7 @@ DEFAULT_PACKAGES = {
|
|
|
22
22
|
"asr": "whisper_oai",
|
|
23
23
|
"utr": "whisper_utr",
|
|
24
24
|
"fa": "whisper_fa",
|
|
25
|
-
"speaker": "
|
|
25
|
+
"speaker": "pyannote",
|
|
26
26
|
"morphosyntax": "stanza",
|
|
27
27
|
"disfluency": "replacement",
|
|
28
28
|
"retracing": "ngram",
|
|
@@ -72,6 +72,8 @@ def dispatch_pipeline(pkg_str, lang, num_speakers=None, **arg_overrides):
|
|
|
72
72
|
# if asr is in engines but disfluency or retracing is not
|
|
73
73
|
# add them
|
|
74
74
|
if "asr" in packages:
|
|
75
|
+
if "speaker" not in packages:
|
|
76
|
+
packages.append("speaker")
|
|
75
77
|
if "disfluency" not in packages:
|
|
76
78
|
packages.append("disfluency")
|
|
77
79
|
if "retracing" not in packages:
|
|
@@ -137,6 +139,9 @@ def dispatch_pipeline(pkg_str, lang, num_speakers=None, **arg_overrides):
|
|
|
137
139
|
engines.append(GoogleTranslateEngine())
|
|
138
140
|
elif engine == "whisper_oai":
|
|
139
141
|
engines.append(OAIWhisperEngine())
|
|
142
|
+
elif engine == "pyannote":
|
|
143
|
+
engines.append(PyannoteEngine())
|
|
144
|
+
|
|
140
145
|
|
|
141
146
|
L.debug(f"Done initalizing packages.")
|
|
142
147
|
return BatchalignPipeline(*engines)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: batchalign
|
|
3
|
-
Version: 0.7.21
|
|
3
|
+
Version: 0.7.21.post1
|
|
4
4
|
Summary: Python Speech Language Sample Analysis
|
|
5
5
|
Author: Brian MacWhinney, Houjun Liu
|
|
6
6
|
Author-email: macw@cmu.edu, houjun@cmu.edu
|
|
@@ -17,6 +17,8 @@ Requires-Dist: pydub
|
|
|
17
17
|
Requires-Dist: plotly>=5.3.0
|
|
18
18
|
Requires-Dist: transformers>=4.38.2
|
|
19
19
|
Requires-Dist: tokenizers>=0.14.1
|
|
20
|
+
Requires-Dist: numba>=0.61.0
|
|
21
|
+
Requires-Dist: numpy<=2.2
|
|
20
22
|
Requires-Dist: pycountry>=22.3
|
|
21
23
|
Requires-Dist: stanza[transformers]>=1.10.1
|
|
22
24
|
Requires-Dist: scipy~=1.11
|
|
@@ -35,8 +37,11 @@ Requires-Dist: tiktoken
|
|
|
35
37
|
Requires-Dist: blobfile
|
|
36
38
|
Requires-Dist: sentencepiece
|
|
37
39
|
Requires-Dist: googletrans
|
|
38
|
-
Requires-Dist: openai-whisper
|
|
40
|
+
Requires-Dist: openai-whisper
|
|
41
|
+
Requires-Dist: llvmlite>=0.44.0
|
|
39
42
|
Requires-Dist: praat-parselmouth==0.4.6
|
|
43
|
+
Requires-Dist: pyannote.audio
|
|
44
|
+
Requires-Dist: onnxruntime
|
|
40
45
|
Provides-Extra: dev
|
|
41
46
|
Requires-Dist: pytest; extra == "dev"
|
|
42
47
|
Provides-Extra: train
|
|
@@ -49,6 +54,7 @@ Dynamic: author-email
|
|
|
49
54
|
Dynamic: classifier
|
|
50
55
|
Dynamic: description
|
|
51
56
|
Dynamic: description-content-type
|
|
57
|
+
Dynamic: license-file
|
|
52
58
|
Dynamic: provides-extra
|
|
53
59
|
Dynamic: requires-dist
|
|
54
60
|
Dynamic: summary
|
|
@@ -74,6 +74,8 @@ batchalign/pipelines/cleanup/retrace.py
|
|
|
74
74
|
batchalign/pipelines/cleanup/support/filled_pauses.eng
|
|
75
75
|
batchalign/pipelines/cleanup/support/replacements.eng
|
|
76
76
|
batchalign/pipelines/cleanup/support/test.test
|
|
77
|
+
batchalign/pipelines/diarization/__init__.py
|
|
78
|
+
batchalign/pipelines/diarization/pyannote.py
|
|
77
79
|
batchalign/pipelines/fa/__init__.py
|
|
78
80
|
batchalign/pipelines/fa/wave2vec_fa.py
|
|
79
81
|
batchalign/pipelines/fa/whisper_fa.py
|
|
@@ -7,6 +7,8 @@ pydub
|
|
|
7
7
|
plotly>=5.3.0
|
|
8
8
|
transformers>=4.38.2
|
|
9
9
|
tokenizers>=0.14.1
|
|
10
|
+
numba>=0.61.0
|
|
11
|
+
numpy<=2.2
|
|
10
12
|
pycountry>=22.3
|
|
11
13
|
stanza[transformers]>=1.10.1
|
|
12
14
|
scipy~=1.11
|
|
@@ -25,8 +27,11 @@ tiktoken
|
|
|
25
27
|
blobfile
|
|
26
28
|
sentencepiece
|
|
27
29
|
googletrans
|
|
28
|
-
openai-whisper
|
|
30
|
+
openai-whisper
|
|
31
|
+
llvmlite>=0.44.0
|
|
29
32
|
praat-parselmouth==0.4.6
|
|
33
|
+
pyannote.audio
|
|
34
|
+
onnxruntime
|
|
30
35
|
|
|
31
36
|
[dev]
|
|
32
37
|
pytest
|
|
@@ -39,6 +39,8 @@ setup(
|
|
|
39
39
|
"plotly>=5.3.0",
|
|
40
40
|
"transformers>=4.38.2",
|
|
41
41
|
"tokenizers>=0.14.1",
|
|
42
|
+
"numba>=0.61.0",
|
|
43
|
+
"numpy<=2.2",
|
|
42
44
|
"pycountry>=22.3",
|
|
43
45
|
"stanza[transformers]>=1.10.1",
|
|
44
46
|
"scipy~=1.11",
|
|
@@ -57,8 +59,11 @@ setup(
|
|
|
57
59
|
"blobfile",
|
|
58
60
|
"sentencepiece",
|
|
59
61
|
"googletrans",
|
|
60
|
-
"openai-whisper
|
|
61
|
-
"
|
|
62
|
+
"openai-whisper",
|
|
63
|
+
"llvmlite>=0.44.0",
|
|
64
|
+
"praat-parselmouth==0.4.6", # Added parselmouth for AVQI
|
|
65
|
+
"pyannote.audio",
|
|
66
|
+
"onnxruntime"
|
|
62
67
|
],
|
|
63
68
|
extras_require={
|
|
64
69
|
'dev': [
|
|
@@ -113,4 +118,4 @@ setup(
|
|
|
113
118
|
"Development Status :: 3 - Alpha",
|
|
114
119
|
"Topic :: Utilities"
|
|
115
120
|
]
|
|
116
|
-
)
|
|
121
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/models/utterance/cantonese_infer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/support/filled_pauses.eng
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/support/replacements.eng
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/cleanup/support/test.test
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/morphosyntax/ja/verbforms.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/pipelines/utterance/ud_utterance.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_file.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_generator.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_lexer.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_parser.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/chat/test_chat_utils.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/formats/textgrid/test_textgrid.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/analysis/test_eval.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/asr/test_asr_pipeline.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/asr/test_asr_utils.py
RENAMED
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/cleanup/test_disfluency.py
RENAMED
|
File without changes
|
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/fa/test_fa_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{batchalign-0.7.21 → batchalign-0.7.21.post1}/batchalign/tests/pipelines/test_pipeline_models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|