enderturing


Nameenderturing JSON
Version 0.10.1 PyPI version JSON
download
home_pagehttps://enderturing.com/
SummaryPython SDK for EnderTuring speech toolkit
upload_time2024-08-11 17:34:03
maintainerNone
docs_urlNone
authorEnderTuring
requires_python>=3.9
licenseMIT
keywords asr speech enderturing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Ender Turing

Ender Turing is a solution for voice content understanding, analytics and business insights.
Check [enderturing.com](https://enderturing.com/) for details.

## Installation

```shell
$ pip install enderturing
```

For using streaming speech recognition functions, you'll also need FFmpeg installed.

Ubuntu:
```shell
$ sudo apt install ffmpeg
```

MacOS homebrew:
```shell
$ brew install ffmpeg
```

For other OS, please follow FFmpeg installation guides.

## Quick Start

```python
import asyncio
from enderturing import Config, EnderTuring, RecognitionResultFormat

# create configuration
config = Config.from_url("https://admin%40local.enderturing.com:your_password@enterturing.yourcompany.com")
et = EnderTuring(config)

# access sessions list
sessions = et.sessions.list()
print(sessions)

# get recognizer for one of configured languages
recognizer = et.get_speech_recognizer(language='en')

async def run_stream_recog(f, r, result_format):
    async with r.stream_recognize(f, result_format=result_format) as rec:
        text = await rec.read()
    return text

# recognize specified file
loop = asyncio.get_event_loop()
task = loop.create_task(run_stream_recog("my_audio.mp3", recognizer, result_format=RecognitionResultFormat.text))
loop.run_until_complete(task)
print(task.result())
```

## Usage

SDK contains two major parts:

- Using Ender Turing REST API
- Speech recognition

## Using Ender Turing API

All API calls are accessible via an instance or `EnderTuring`. API methods are grouped, and each
group is a property of `EnderTuring`. Examples:
```python
from enderturing import Config, EnderTuring, RecognitionResultFormat

et = EnderTuring(Config.from_env())

# access sessions list
sessions = et.sessions.list()

# working with ASR
et.asr.get_instances(active_only=True)

# accessing raw json
et.raw.create_event(caller_id='1234', event_data={"type": "hold"})
```

## Access Configuration

To access API, you need to know an authentication key (login), authentication secret (password), and
installation URL (e.g. https://enderturing.yourcompany.com/)

There are multiple ways to pass config options:

- from environmental variables (`Config.from_env()`).
- creating `Config` with parameters (e.g. `Config(auth_key="my_login", auth_secret="my_secret"")`)
- using Enter Turing configuration URL (`Config.from_url()`)

## Creating Speech Recognizer

There two options to create a speech recognizer:

### If you have access to API configured:
```python
recognizer = et.get_speech_recognizer(language='en')
```

### If you know URL and sample rate of desired ASR instance:
```python
from enderturing import AsrConfig, SpeechRecognizer

config = AsrConfig(url="wss://enderturing", sample_rate=8000)
recognizer = SpeechRecognizer(config)
```

## Recognizing a File

`SpeechRecognizer.recognize_file` method returns an async text stream. Depending on parameters,
each line contains either a text of utterance or serialized JSON.

If you are only interested in results after recognition is complete, you can use the `read()` method. E.g.

```python
async with recognizer.recognize_file("my_audio.wav", result_format=RecognitionResultFormat.text) as rec:
    text = await rec.read()
```

If you prefer getting words and phrases as soon as they are recognized - you can
use the `readline()` method instead. E.g.

```python
async with recognizer.recognize_file(src, result_format=RecognitionResultFormat.jsonl) as rec:
    line = await rec.readline()
    while line:
        # Now line contains a json string, you can save it or do something else with it
        line = await rec.readline()

```

## Working With Multichannel Audio

If an audio file has more than one channel - by default system will recognize each channel and
return a transcript for each channel. To change the default behavior - you can use `channels`
parameter of `SpeechRecognizer.recognize_file`. Please check method documentation for details.

Sometimes an audio is stored as a file per channel, e.g., contact center call generates two files:
one for a client and one for a support agent. But for analysis, it's preferable to see transcripts
of the files merged as a dialog. In this scenario, you can use
`recognizer.recognize_joined_file([audio1, audio2])`.

## License

Released under the MIT license.

            

Raw data

            {
    "_id": null,
    "home_page": "https://enderturing.com/",
    "name": "enderturing",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "ASR, speech, enderturing",
    "author": "EnderTuring",
    "author_email": "info@enderturing.com",
    "download_url": "https://files.pythonhosted.org/packages/08/91/43d472407ed3d499a1d7f6573d83137ec5e075cc0da3c0e6bb3762fe2307/enderturing-0.10.1.tar.gz",
    "platform": null,
    "description": "# Ender Turing\n\nEnder Turing is a solution for voice content understanding, analytics and business insights.\nCheck [enderturing.com](https://enderturing.com/) for details.\n\n## Installation\n\n```shell\n$ pip install enderturing\n```\n\nFor using streaming speech recognition functions, you'll also need FFmpeg installed.\n\nUbuntu:\n```shell\n$ sudo apt install ffmpeg\n```\n\nMacOS homebrew:\n```shell\n$ brew install ffmpeg\n```\n\nFor other OS, please follow FFmpeg installation guides.\n\n## Quick Start\n\n```python\nimport asyncio\nfrom enderturing import Config, EnderTuring, RecognitionResultFormat\n\n# create configuration\nconfig = Config.from_url(\"https://admin%40local.enderturing.com:your_password@enterturing.yourcompany.com\")\net = EnderTuring(config)\n\n# access sessions list\nsessions = et.sessions.list()\nprint(sessions)\n\n# get recognizer for one of configured languages\nrecognizer = et.get_speech_recognizer(language='en')\n\nasync def run_stream_recog(f, r, result_format):\n    async with r.stream_recognize(f, result_format=result_format) as rec:\n        text = await rec.read()\n    return text\n\n# recognize specified file\nloop = asyncio.get_event_loop()\ntask = loop.create_task(run_stream_recog(\"my_audio.mp3\", recognizer, result_format=RecognitionResultFormat.text))\nloop.run_until_complete(task)\nprint(task.result())\n```\n\n## Usage\n\nSDK contains two major parts:\n\n- Using Ender Turing REST API\n- Speech recognition\n\n## Using Ender Turing API\n\nAll API calls are accessible via an instance or `EnderTuring`. API methods are grouped, and each\ngroup is a property of `EnderTuring`. Examples:\n```python\nfrom enderturing import Config, EnderTuring, RecognitionResultFormat\n\net = EnderTuring(Config.from_env())\n\n# access sessions list\nsessions = et.sessions.list()\n\n# working with ASR\net.asr.get_instances(active_only=True)\n\n# accessing raw json\net.raw.create_event(caller_id='1234', event_data={\"type\": \"hold\"})\n```\n\n## Access Configuration\n\nTo access API, you need to know an authentication key (login), authentication secret (password), and\ninstallation URL (e.g. https://enderturing.yourcompany.com/)\n\nThere are multiple ways to pass config options:\n\n- from environmental variables (`Config.from_env()`).\n- creating `Config` with parameters (e.g. `Config(auth_key=\"my_login\", auth_secret=\"my_secret\"\")`)\n- using Enter Turing configuration URL (`Config.from_url()`)\n\n## Creating Speech Recognizer\n\nThere two options to create a speech recognizer:\n\n### If you have access to API configured:\n```python\nrecognizer = et.get_speech_recognizer(language='en')\n```\n\n### If you know URL and sample rate of desired ASR instance:\n```python\nfrom enderturing import AsrConfig, SpeechRecognizer\n\nconfig = AsrConfig(url=\"wss://enderturing\", sample_rate=8000)\nrecognizer = SpeechRecognizer(config)\n```\n\n## Recognizing a File\n\n`SpeechRecognizer.recognize_file` method returns an async text stream. Depending on parameters,\neach line contains either a text of utterance or serialized JSON.\n\nIf you are only interested in results after recognition is complete, you can use the `read()` method. E.g.\n\n```python\nasync with recognizer.recognize_file(\"my_audio.wav\", result_format=RecognitionResultFormat.text) as rec:\n    text = await rec.read()\n```\n\nIf you prefer getting words and phrases as soon as they are recognized - you can\nuse the `readline()` method instead. E.g.\n\n```python\nasync with recognizer.recognize_file(src, result_format=RecognitionResultFormat.jsonl) as rec:\n    line = await rec.readline()\n    while line:\n        # Now line contains a json string, you can save it or do something else with it\n        line = await rec.readline()\n\n```\n\n## Working With Multichannel Audio\n\nIf an audio file has more than one channel - by default system will recognize each channel and\nreturn a transcript for each channel. To change the default behavior - you can use `channels`\nparameter of `SpeechRecognizer.recognize_file`. Please check method documentation for details.\n\nSometimes an audio is stored as a file per channel, e.g., contact center call generates two files:\none for a client and one for a support agent. But for analysis, it's preferable to see transcripts\nof the files merged as a dialog. In this scenario, you can use\n`recognizer.recognize_joined_file([audio1, audio2])`.\n\n## License\n\nReleased under the MIT license.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for EnderTuring speech toolkit",
    "version": "0.10.1",
    "project_urls": {
        "Homepage": "https://enderturing.com/",
        "Repository": "https://github.com/EnderTuringHQ/enderturing-sdk-python"
    },
    "split_keywords": [
        "asr",
        " speech",
        " enderturing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7847ded8275c499a23c778993280023acf37773deee190148f34f362568bd9df",
                "md5": "b50468c1c1a202f4cc5d70e9c588cb4b",
                "sha256": "70350476b79e86e777f3d2d035fde4a67984d12035aac6f3417350521cede172"
            },
            "downloads": -1,
            "filename": "enderturing-0.10.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b50468c1c1a202f4cc5d70e9c588cb4b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 30753,
            "upload_time": "2024-08-11T17:34:02",
            "upload_time_iso_8601": "2024-08-11T17:34:02.138876Z",
            "url": "https://files.pythonhosted.org/packages/78/47/ded8275c499a23c778993280023acf37773deee190148f34f362568bd9df/enderturing-0.10.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "089143d472407ed3d499a1d7f6573d83137ec5e075cc0da3c0e6bb3762fe2307",
                "md5": "1a32bea90b79fa93f9fd2cf49a0c4729",
                "sha256": "74306ac257f9db2e5bc2a1b35dc9cac22a63c29b137002cf8bc43412ef5f78c3"
            },
            "downloads": -1,
            "filename": "enderturing-0.10.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1a32bea90b79fa93f9fd2cf49a0c4729",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 22468,
            "upload_time": "2024-08-11T17:34:03",
            "upload_time_iso_8601": "2024-08-11T17:34:03.343545Z",
            "url": "https://files.pythonhosted.org/packages/08/91/43d472407ed3d499a1d7f6573d83137ec5e075cc0da3c0e6bb3762fe2307/enderturing-0.10.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-11 17:34:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "EnderTuringHQ",
    "github_project": "enderturing-sdk-python",
    "github_not_found": true,
    "lcname": "enderturing"
}
        
Elapsed time: 3.53992s