Wordcab Python SDK
Project description
Wordcab Python
What is Wordcab?
- Summarize any business communications at scale with Wordcab's API.
- Wordcab is a summarization service that provides a simple API to summarize any
audio
,text
, orJSON
file. - It also includes compatibility with famous transcripts platforms like
Getting started
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.
Requirements
- OS:
- Python:
Installation
You can install Wordcab Python via pip from PyPI:
$ pip install wordcab
Start using the API with any python script right away!
Usage
Start Summary full pipeline
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 all information from the retrieved summary
for k, v in summary.__dict__.items():
print(f"{k}: {v}")
# Get the summary as one block of text
for k, v in summary.summary.items():
print(f"Summary Length: {k}")
print(f"Summary: {v['structured_summary'][0].summary}")
Documentation
Please see the Documentation for more details.
Contributing
Contributions are very welcome. 🚀 To learn more, see the Contributor Guide.
License
Issues
If you encounter any problems, please file an issue along with a detailed description.
Credits
This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wordcab-0.6.2.tar.gz
(22.7 kB
view hashes)
Built Distribution
wordcab-0.6.2-py3-none-any.whl
(29.8 kB
view hashes)