321 lines
22 KiB
HTML
321 lines
22 KiB
HTML
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
|
|
|
|
<title>autotranscript.app package — AutoTranscript documentation</title>
|
|
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
|
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
|
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
|
<script src="_static/jquery.js"></script>
|
|
<script src="_static/underscore.js"></script>
|
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
|
<script src="_static/doctools.js"></script>
|
|
<link rel="index" title="Index" href="genindex.html" />
|
|
<link rel="search" title="Search" href="search.html" />
|
|
<link rel="next" title="setup module" href="setup.html" />
|
|
<link rel="prev" title="autotranscript package" href="autotranscript.html" />
|
|
|
|
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
|
|
|
</head><body>
|
|
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
|
|
|
|
<div class="body" role="main">
|
|
|
|
<section id="autotranscript-app-package">
|
|
<h1>autotranscript.app package<a class="headerlink" href="#autotranscript-app-package" title="Permalink to this heading">¶</a></h1>
|
|
<section id="submodules">
|
|
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this heading">¶</a></h2>
|
|
</section>
|
|
<section id="module-autotranscript.app.gradio_app">
|
|
<span id="autotranscript-app-gradio-app-module"></span><h2>autotranscript.app.gradio_app module<a class="headerlink" href="#module-autotranscript.app.gradio_app" title="Permalink to this heading">¶</a></h2>
|
|
<section id="gradio-audio-transcription-app">
|
|
<h3>Gradio Audio Transcription App.<a class="headerlink" href="#gradio-audio-transcription-app" title="Permalink to this heading">¶</a></h3>
|
|
<p>This module provides an interface to transcribe audio files using the
|
|
AutoTranscribe model. Users can either upload an audio file or record their speech
|
|
live for transcription. The application supports multiple languages and provides
|
|
options to specify the number of speakers and the language of the audio.</p>
|
|
<dl class="simple">
|
|
<dt>Attributes:</dt><dd><p>LANGUAGES (list): A list of supported languages for transcription.</p>
|
|
</dd>
|
|
<dt>Usage:</dt><dd><p>Run this script to start the Gradio web interface for audio transcription.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="autotranscript.app.gradio_app.GradioTranscriptionInterface">
|
|
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">GradioTranscriptionInterface</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="autotranscript.html#autotranscript.autotranscript.AutoTranscribe" title="autotranscript.autotranscript.AutoTranscribe"><span class="pre">AutoTranscribe</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.gradio_app.GradioTranscriptionInterface" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
|
<p>Interface handling the interaction between Gradio UI and the Audio Transcription system.</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="autotranscript.app.gradio_app.GradioTranscriptionInterface.__init__">
|
|
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="autotranscript.html#autotranscript.autotranscript.AutoTranscribe" title="autotranscript.autotranscript.AutoTranscribe"><span class="pre">AutoTranscribe</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.gradio_app.GradioTranscriptionInterface.__init__" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Initializes the GradioTranscriptionInterface with a transcription model.</p>
|
|
<dl class="simple">
|
|
<dt>Args:</dt><dd><p>model (AutoTranscribe): Model responsible for audio transcription tasks.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="autotranscript.app.gradio_app.GradioTranscriptionInterface.auto_transcribe">
|
|
<span class="sig-name descname"><span class="pre">auto_transcribe</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">source</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_speakers</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">translation</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">language</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.gradio_app.GradioTranscriptionInterface.auto_transcribe" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Shortcut method for the AutoTranscribe task.</p>
|
|
<dl class="simple">
|
|
<dt>Returns:</dt><dd><p>tuple: Transcribed text (str), JSON output (dict)</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="autotranscript.app.gradio_app.GradioTranscriptionInterface.perform_diarisation">
|
|
<span class="sig-name descname"><span class="pre">perform_diarisation</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">source</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_speakers</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.gradio_app.GradioTranscriptionInterface.perform_diarisation" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Shortcut method for the Diarisation task.</p>
|
|
<dl class="simple">
|
|
<dt>Returns:</dt><dd><p>str: JSON output of diarisation result.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="autotranscript.app.gradio_app.GradioTranscriptionInterface.transcribe">
|
|
<span class="sig-name descname"><span class="pre">transcribe</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">source</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">translation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">language</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.gradio_app.GradioTranscriptionInterface.transcribe" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Shortcut method for the Transcribe task.</p>
|
|
<dl class="simple">
|
|
<dt>Returns:</dt><dd><p>str: Transcribed text.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="autotranscript.app.gradio_app.gradio_Interface">
|
|
<span class="sig-name descname"><span class="pre">gradio_Interface</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="autotranscript.html#autotranscript.autotranscript.AutoTranscribe" title="autotranscript.autotranscript.AutoTranscribe"><span class="pre">AutoTranscribe</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.gradio_app.gradio_Interface" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</section>
|
|
</section>
|
|
<section id="module-autotranscript.app.qtfaststart">
|
|
<span id="autotranscript-app-qtfaststart-module"></span><h2>autotranscript.app.qtfaststart module<a class="headerlink" href="#module-autotranscript.app.qtfaststart" title="Permalink to this heading">¶</a></h2>
|
|
<p>This file contains a modified version of qtfaststart by qtfaststart
|
|
<a class="reference external" href="https://github.com/danielgtaylor/qtfaststart/tree/master">https://github.com/danielgtaylor/qtfaststart/tree/master</a></p>
|
|
<p>All credit goes to the original author.
|
|
Copyright (C) 2008 - 2013 Daniel G. Taylor <<a class="reference external" href="mailto:dan%40programmer-art.org">dan<span>@</span>programmer-art<span>.</span>org</a>>
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
|
software and associated documentation files (the “Software”),
|
|
to deal in the Software without restriction, including without limitation the rights to
|
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
Software, and to permit persons to whom the Software is furnished to do so,
|
|
subject to the following conditions:</p>
|
|
<p>The above copyright notice and this permission notice shall be included in all copies
|
|
or substantial portions of the Software.</p>
|
|
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
IN THE SOFTWARE.</p>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.Atom">
|
|
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">Atom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">position</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.qtfaststart.Atom" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">tuple</span></code></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.Atom.__repr__">
|
|
<span class="sig-name descname"><span class="pre">__repr__</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.qtfaststart.Atom.__repr__" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return a nicely formatted representation string</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.Atom.name">
|
|
<span class="sig-name descname"><span class="pre">name</span></span><a class="headerlink" href="#autotranscript.app.qtfaststart.Atom.name" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Alias for field number 0</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.Atom.position">
|
|
<span class="sig-name descname"><span class="pre">position</span></span><a class="headerlink" href="#autotranscript.app.qtfaststart.Atom.position" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Alias for field number 1</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.Atom.size">
|
|
<span class="sig-name descname"><span class="pre">size</span></span><a class="headerlink" href="#autotranscript.app.qtfaststart.Atom.size" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Alias for field number 2</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py exception">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.FastStartException">
|
|
<em class="property"><span class="pre">exception</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">FastStartException</span></span><a class="headerlink" href="#autotranscript.app.qtfaststart.FastStartException" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p>
|
|
<p>Raised when something bad happens during processing.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py exception">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.FastStartSetupError">
|
|
<em class="property"><span class="pre">exception</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">FastStartSetupError</span></span><a class="headerlink" href="#autotranscript.app.qtfaststart.FastStartSetupError" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#autotranscript.app.qtfaststart.FastStartException" title="autotranscript.app.qtfaststart.FastStartException"><code class="xref py py-class docutils literal notranslate"><span class="pre">FastStartException</span></code></a></p>
|
|
<p>Rasised when asked to process a file that does not need processing</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py exception">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.MalformedFileError">
|
|
<em class="property"><span class="pre">exception</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">MalformedFileError</span></span><a class="headerlink" href="#autotranscript.app.qtfaststart.MalformedFileError" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#autotranscript.app.qtfaststart.FastStartException" title="autotranscript.app.qtfaststart.FastStartException"><code class="xref py py-class docutils literal notranslate"><span class="pre">FastStartException</span></code></a></p>
|
|
<p>Raised when the input file is setup in an unexpected way</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py exception">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.UnsupportedFormatError">
|
|
<em class="property"><span class="pre">exception</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">UnsupportedFormatError</span></span><a class="headerlink" href="#autotranscript.app.qtfaststart.UnsupportedFormatError" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#autotranscript.app.qtfaststart.FastStartException" title="autotranscript.app.qtfaststart.FastStartException"><code class="xref py py-class docutils literal notranslate"><span class="pre">FastStartException</span></code></a></p>
|
|
<p>Raised when a movie file is recognized as a format not supported.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.find_atoms">
|
|
<span class="sig-name descname"><span class="pre">find_atoms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">datastream</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.qtfaststart.find_atoms" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Compatibilty interface for _find_atoms_ex</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.get_chunks">
|
|
<span class="sig-name descname"><span class="pre">get_chunks</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">stream</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">chunk_size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">limit</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.qtfaststart.get_chunks" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.get_index">
|
|
<span class="sig-name descname"><span class="pre">get_index</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">datastream</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.qtfaststart.get_index" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return an index of top level atoms, their absolute byte-position in the
|
|
file and their size in a list:</p>
|
|
<dl class="simple">
|
|
<dt>index = [</dt><dd><p>(“ftyp”, 0, 24),
|
|
(“moov”, 25, 2658),
|
|
(“free”, 2683, 8),
|
|
…</p>
|
|
</dd>
|
|
</dl>
|
|
<p>]</p>
|
|
<p>The tuple elements will be in the order that they appear in the file.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.process">
|
|
<span class="sig-name descname"><span class="pre">process</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">infilename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">limit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">inf</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.qtfaststart.process" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Convert a Quicktime/MP4 file for streaming by moving the metadata to
|
|
the front of the file. This method writes a new file.</p>
|
|
<p>If limit is set to something other than zero it will be used as the
|
|
number of bytes to write of the atoms following the moov atom. This
|
|
is very useful to create a small sample of a file with full headers,
|
|
which can then be used in bug reports and such.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="autotranscript.app.qtfaststart.read_atom">
|
|
<span class="sig-name descname"><span class="pre">read_atom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">datastream</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#autotranscript.app.qtfaststart.read_atom" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Read an atom and return a tuple of (size, type) where size is the size
|
|
in bytes (including the 8 bytes already read) and type is a “fourcc”
|
|
like “ftyp” or “moov”.</p>
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-autotranscript.app">
|
|
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-autotranscript.app" title="Permalink to this heading">¶</a></h2>
|
|
</section>
|
|
</section>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h1 class="logo"><a href="index.html">AutoTranscript</a></h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Navigation</h3>
|
|
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
|
<ul class="current">
|
|
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">autotranscript</a><ul class="current">
|
|
<li class="toctree-l2"><a class="reference internal" href="app.html">app module</a></li>
|
|
<li class="toctree-l2 current"><a class="reference internal" href="autotranscript.html">autotranscript package</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="setup.html">setup module</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="test_autotranscript.html">test_autotranscript module</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="transcribe.html">transcribe module</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="relations">
|
|
<h3>Related Topics</h3>
|
|
<ul>
|
|
<li><a href="index.html">Documentation overview</a><ul>
|
|
<li><a href="modules.html">autotranscript</a><ul>
|
|
<li><a href="autotranscript.html">autotranscript package</a><ul>
|
|
<li>Previous: <a href="autotranscript.html" title="previous chapter">autotranscript package</a></li>
|
|
<li>Next: <a href="setup.html" title="next chapter">setup module</a></li>
|
|
</ul></li>
|
|
</ul></li>
|
|
</ul></li>
|
|
</ul>
|
|
</div>
|
|
<div id="searchbox" style="display: none" role="search">
|
|
<h3 id="searchlabel">Quick search</h3>
|
|
<div class="searchformwrapper">
|
|
<form class="search" action="search.html" method="get">
|
|
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
|
<input type="submit" value="Go" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script>document.getElementById('searchbox').style.display = "block"</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="footer">
|
|
©2023, Jacob Schmieder.
|
|
|
|
|
|
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.0.2</a>
|
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
|
|
|
|
|
|
<a href="_sources/autotranscript.app.rst.txt"
|
|
rel="nofollow">Page source</a>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html> |