| Name | youscribe JSON |
| Version |
0.0.3
JSON |
| download |
| home_page | None |
| Summary | Library to transcribe YouTube videos using Whisper model |
| upload_time | 2024-03-27 05:57:29 |
| maintainer | None |
| docs_url | None |
| author | Digital Observatory |
| requires_python | >=3.10 |
| license | None |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Transcribe YouTube videos using Whisper models
Adopts [faster_whisperer](https://github.com/SYSTRAN/faster-whisper), a cTransformer's based model for faster transcription.
## Usage
```python
from youscribe import transcribe
transcript = transcribe(url="https://www.youtube.com/watch?v=9bZkp7q19f0")
transcript.text()
```
### Prompting
By default, the video title and description are used as prompts to the transcription model. But you can also specify your own prompt:
```python
transcript = transcribe(
url="https://www.youtube.com/watch?v=9bZkp7q19f0",
prompt="Enter prompt here"
)
```
You can also choose not to include prompt by setting `prompt=False`.
```python
transcript = transcribe(
url="https://www.youtube.com/watch?v=9bZkp7q19f0",
prompt=False
)
```
### Working with `WhisperTranscript` objects
The `transcribe()` function, if executed successfully, will return a `WhisperTranscript` object. You can view the transcript as plain text, SRT-formatted text, or a Python dictionary.
```python
transcript = transcribe(
url="https://www.youtube.com/watch?v=9bZkp7q19f0",
prompt=False
)
transcript.text()
transcript.srt()
transcript.json()
transcript.segment
```
### Customise Whisper model
In the transcribe function, you can pass your own custom Whisper model:
```python
from youtescribe import WhisperTranscriber
from youtescribe import models
custom_transcriber = WhisperTranscriber(model_size = models.TINY_EN, cpu_threads=6, device="auto")
transcript = transcribe(
url="https://www.youtube.com/watch?v=9bZkp7q19f0",
transcriber=custom_transcriber
)
transcript.text()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "youscribe",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Digital Observatory",
"author_email": "digitalobservatory@qut.edu.au",
"download_url": "https://files.pythonhosted.org/packages/49/7f/6b5cb1d2dc3606e8536a33a0da1a99ad4bdfd6bd425c6626e9f9276fc4ce/youscribe-0.0.3.tar.gz",
"platform": null,
"description": "# Transcribe YouTube videos using Whisper models\n\nAdopts [faster_whisperer](https://github.com/SYSTRAN/faster-whisper), a cTransformer's based model for faster transcription.\n\n## Usage\n\n```python\nfrom youscribe import transcribe\n\ntranscript = transcribe(url=\"https://www.youtube.com/watch?v=9bZkp7q19f0\")\n\ntranscript.text()\n```\n\n### Prompting\n\nBy default, the video title and description are used as prompts to the transcription model. But you can also specify your own prompt:\n\n```python\ntranscript = transcribe(\n url=\"https://www.youtube.com/watch?v=9bZkp7q19f0\",\n prompt=\"Enter prompt here\"\n)\n```\n\nYou can also choose not to include prompt by setting `prompt=False`.\n\n```python\ntranscript = transcribe(\n url=\"https://www.youtube.com/watch?v=9bZkp7q19f0\",\n prompt=False\n)\n```\n\n### Working with `WhisperTranscript` objects\n\nThe `transcribe()` function, if executed successfully, will return a `WhisperTranscript` object. You can view the transcript as plain text, SRT-formatted text, or a Python dictionary.\n\n```python\ntranscript = transcribe(\n url=\"https://www.youtube.com/watch?v=9bZkp7q19f0\",\n prompt=False\n)\n\ntranscript.text()\ntranscript.srt()\ntranscript.json()\ntranscript.segment\n```\n\n### Customise Whisper model\n\nIn the transcribe function, you can pass your own custom Whisper model:\n\n```python\nfrom youtescribe import WhisperTranscriber\nfrom youtescribe import models\n\ncustom_transcriber = WhisperTranscriber(model_size = models.TINY_EN, cpu_threads=6, device=\"auto\")\n\ntranscript = transcribe(\n url=\"https://www.youtube.com/watch?v=9bZkp7q19f0\",\n transcriber=custom_transcriber\n)\ntranscript.text()\n```\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Library to transcribe YouTube videos using Whisper model",
"version": "0.0.3",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a54c5d189f8ee6211b2a1d06df8604eeb231f34e813e5c57a72f1b58fce54b4d",
"md5": "3b16525e1b58b5e47b3e4cb685321a6d",
"sha256": "6b64f879a91c025091ae22e8e6885e09b3cf7c635bf0e4dde5052fcb9e3a5304"
},
"downloads": -1,
"filename": "youscribe-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3b16525e1b58b5e47b3e4cb685321a6d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7395,
"upload_time": "2024-03-27T05:57:27",
"upload_time_iso_8601": "2024-03-27T05:57:27.660238Z",
"url": "https://files.pythonhosted.org/packages/a5/4c/5d189f8ee6211b2a1d06df8604eeb231f34e813e5c57a72f1b58fce54b4d/youscribe-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "497f6b5cb1d2dc3606e8536a33a0da1a99ad4bdfd6bd425c6626e9f9276fc4ce",
"md5": "cd5897f7d1788284b069dc042abfba04",
"sha256": "909d53c1876838d298e68868585570d90fae5a310ddb772ca0c8ac045b8d6d20"
},
"downloads": -1,
"filename": "youscribe-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "cd5897f7d1788284b069dc042abfba04",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 7059,
"upload_time": "2024-03-27T05:57:29",
"upload_time_iso_8601": "2024-03-27T05:57:29.427040Z",
"url": "https://files.pythonhosted.org/packages/49/7f/6b5cb1d2dc3606e8536a33a0da1a99ad4bdfd6bd425c6626e9f9276fc4ce/youscribe-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-27 05:57:29",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "youscribe"
}