π Transcribe and Summarize any business communication at scale with Wordcab's API
Wordcab is a transcription and summarization service that provides a simple API to summarize any audio
, text
, or JSON
file.
It also includes compatibility with other transcripts platforms like:
You can learn more about Wordcab services and pricing on our website.
If you want to try out the API, you can signup for a free account and start using the API right away.
You can install Wordcab Python via pip from PyPI:
$ pip install wordcab
Start using the API with any python script right away!
import time
from wordcab import retrieve_job, retrieve_summary, start_summary
from wordcab.core_objects import AudioSource, GenericSource, InMemorySource
# Prepare your input source
## For a transcript stored as a .txt or .json file
source = GenericSource(filepath="path/to/file.txt") # Or file.json
## For a transcript stored as an audio file
source = AudioSource(filepath="path/to/file.mp3")
## For a transcript already in memory
transcript = {"transcript": ["SPEAKER A: Hello.", "SPEAKER B: Hi."]}
source = InMemorySource(obj=transcript)
# Launch the Summarization job
job = start_summary(
source_object=source,
display_name="sample_txt",
summary_type="narrative",
summary_lens=[1, 3],
tags=["sample", "text"],
)
# Wait for the job completion
while True:
job = retrieve_job(job_name=job.job_name)
if job.job_status == "SummaryComplete":
break
else:
time.sleep(3)
# Get the summary id
summary_id = job.summary_details["summary_id"]
# Retrieve the summary
summary = retrieve_summary(summary_id=summary_id)
# Get the summary as a human-readable string
print(summary.get_formatted_summaries())
# Save the json object to a file
with open("wordcab_summary.json", "w") as f:
f.write(summary)
Please see the Documentation for more details.
Contributions are very welcome. π To learn more, see the Contributor Guide.
If you encounter any problems, please file an issue along with a detailed description.