Skip to content

Commit 89e56f6

Browse files
Add support for 'remove_atmospherics' and 'speakers_count' (#101)
1 parent 80466d2 commit 89e56f6

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

src/rev_ai/apiclient.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def submit_job_url(
6464
speaker_names=None,
6565
source_config=None,
6666
notification_config=None,
67-
skip_postprocessing=False):
67+
skip_postprocessing=False,
68+
remove_atmospherics=False,
69+
speakers_count=None):
6870
"""Submit media given a URL for transcription.
6971
The audio data is downloaded from the URL
7072
:param media_url: web location of the media file
@@ -111,6 +113,9 @@ def submit_job_url(
111113
invoke on job completion as a webhook and optional authentication headers to use when
112114
calling the callback url
113115
:param skip_postprocessing: skip all text postprocessing (punctuation, capitalization, ITN)
116+
:param remove_atmospherics: Atmospherics such as <laugh>, <affirmative>, etc. will not appear
117+
in the transcript.
118+
:param speakers_count: Use to specify the total number of unique speakers in the audio.
114119
:returns: raw response data
115120
:raises: HTTPError
116121
"""
@@ -154,7 +159,9 @@ def submit_job_local_file(
154159
segments_to_transcribe=None,
155160
speaker_names=None,
156161
notification_config=None,
157-
skip_postprocessing=False):
162+
skip_postprocessing=False,
163+
remove_atmospherics=False,
164+
speakers_count=None):
158165
"""Submit a local file for transcription.
159166
Note that the content type is inferred if not provided.
160167
@@ -198,6 +205,9 @@ def submit_job_local_file(
198205
invoke on job completion as a webhook and optional authentication headers to use when
199206
calling the callback url
200207
:param skip_postprocessing: skip all text postprocessing (punctuation, capitalization, ITN)
208+
:param remove_atmospherics: Atmospherics such as <laugh>, <affirmative>, etc. will not appear
209+
in the transcript.
210+
:param speakers_count: Use to specify the total number of unique speakers in the audio.
201211
:returns: raw response data
202212
:raises: HTTPError, ValueError
203213
"""
@@ -463,7 +473,9 @@ def _create_job_options_payload(
463473
speaker_names=None,
464474
source_config=None,
465475
notification_config=None,
466-
skip_postprocessing=False):
476+
skip_postprocessing=False,
477+
remove_atmospherics=None,
478+
speakers_count=None):
467479
payload = {}
468480
if media_url:
469481
payload['media_url'] = media_url
@@ -508,6 +520,10 @@ def _create_job_options_payload(
508520
payload['notification_config'] = notification_config.to_dict()
509521
if skip_postprocessing:
510522
payload['skip_postprocessing'] = skip_postprocessing
523+
if remove_atmospherics:
524+
payload['remove_atmospherics'] = remove_atmospherics
525+
if speakers_count:
526+
payload['speakers_count'] = speakers_count
511527
return payload
512528

513529
def _create_captions_query(self, speaker_channel):

src/rev_ai/models/asynchronous/job.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def __init__(
2626
transcriber=None,
2727
verbatim=None,
2828
rush=None,
29-
segments_to_transcribe=None):
29+
segments_to_transcribe=None,
30+
remove_atmospherics=None,
31+
speakers_count=None):
3032
"""
3133
:param id_: unique id of job
3234
:param created_on: date and time at which this job was started
@@ -54,6 +56,9 @@ def __init__(
5456
:param verbatim: whether to transcribe verbatim if provided for human transcription
5557
:param rush: whether to transcribe with rush if provided for human transcription
5658
:param segments_to_transcribe: segments to transcribe if provided for human transcription
59+
:param remove_atmospherics: Atmospherics such as <laugh>, <affirmative>, etc. will not appear
60+
in the transcript.
61+
:param speakers_count: Use to specify the total number of unique speakers in the audio.
5762
"""
5863
self.id = id_
5964
self.created_on = created_on
@@ -78,6 +83,8 @@ def __init__(
7883
self.verbatim = verbatim
7984
self.rush = rush
8085
self.segments_to_transcribe = segments_to_transcribe
86+
self.remove_atmospherics = remove_atmospherics
87+
self.speakers_count = speakers_count
8188

8289
def __eq__(self, other):
8390
"""Override default equality operator"""
@@ -111,5 +118,7 @@ def from_json(cls, json):
111118
transcriber=json.get('transcriber'),
112119
verbatim=json.get('verbatim'),
113120
rush=json.get('rush'),
114-
segments_to_transcribe=json.get('segments_to_transcribe')
121+
segments_to_transcribe=json.get('segments_to_transcribe'),
122+
remove_atmospherics=json.get('remove_atmospherics'),
123+
speakers_count=json.get('speakers_count')
115124
)

0 commit comments

Comments
 (0)