Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.6.0 #33

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- run:
name: install requirements
command: |
python3 -m venv venv
python -m venv venv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be python3 but you have to invalidate the cache.
I see that the CI configuration is not very reliable. I suggest you check this configuration file to see how to setup a test matrix: https://github.com/allo-media/eventail/blob/master/.circleci/config.yml

. venv/bin/activate
pip install tox
pip install -e .[examples]
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- run:
name: init .pypirc and build env
command: |
python3 -m venv venv
python -m venv venv
. venv/bin/activate
pip install -U pip
pip install wheel twine build
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ Also known as the human to bot (H2B) stream API.

## Changelog

### v1.6.0

* Support for phones.

### v1.5.1

* API fix: `RecogResult.alternatives` now returns an empty list instead of `None`.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="uhlive",
version="1.5.1",
version="1.6.0",
url="https://github.com/uhlive/python-sdk",
author="Allo-Media",
author_email="support@allo-media.fr",
Expand Down
8 changes: 7 additions & 1 deletion src/uhlive/stream/recognition/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Transcript:

def __init__(self, data: Dict[str, Any]) -> None:
self._transcript: str = data["transcript"]
self._phones: str = data.get("phones", "")
self._confidence: float = float(data["confidence"])
self._start = datetime.utcfromtimestamp(data["start"] / 1000.0)
self._end = datetime.utcfromtimestamp(data["end"] / 1000.0)
Expand All @@ -44,6 +45,11 @@ def transcript(self) -> str:
"""The raw ASR output."""
return self._transcript

@property
def phones(self) -> str:
"""May contain the phone transcription, or empty if phones not activated."""
return self._phones

@property
def confidence(self) -> float:
"""The ASR transcription confidence."""
Expand All @@ -60,7 +66,7 @@ def end(self) -> datetime:
return self._end

def __str__(self) -> str:
return f'"{self._transcript}" ({self._confidence})'
return f'"{self._transcript}" [{self.phones}] ({self._confidence})'


class Interpretation:
Expand Down
Loading