Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Feature/6 kwargs #13

Merged
merged 6 commits into from
Feb 3, 2021
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
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/miscs/asr.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/miscs/caption.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/miscs/collocation.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/miscs/inflection.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/miscs/lemma.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/miscs/ocr.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/miscs/tokenization.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/miscs/wt.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/seq2seq/const.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/seq2seq/g2p.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/seq2seq/gec.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/seq2seq/mt.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/seq2seq/p2g.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/seq2seq/para_gen.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/seq2seq/summary.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tagging/contextualized.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tagging/dp.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tagging/fill.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tagging/mrc.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tagging/ner.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tagging/pos.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tagging/srl.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/aes.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/age_suitability.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/nli.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/para_id.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/review_score.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/sent2vec.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/sentiment.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/sts.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/text_cls/zero.doctree
Binary file not shown.
8 changes: 2 additions & 6 deletions docs/_build/html/_modules/pororo/tasks/age_suitability.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1>Source code for pororo.tasks.age_suitability</h1><div class="highlight"><pre

<span class="k">return</span> <span class="n">result</span>

<div class="viewcode-block" id="PororoBertMovie.predict"><a class="viewcode-back" href="../../../text_cls/age_suitability.html#pororo.tasks.age_suitability.PororoBertMovie.predict">[docs]</a> <span class="k">def</span> <span class="nf">predict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">script</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">dict</span><span class="p">:</span>
<div class="viewcode-block" id="PororoBertMovie.predict"><a class="viewcode-back" href="../../../text_cls/age_suitability.html#pororo.tasks.age_suitability.PororoBertMovie.predict">[docs]</a> <span class="k">def</span> <span class="nf">predict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">script</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">dict</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Conduct (movie) script analysis</span>

Expand Down Expand Up @@ -399,11 +399,7 @@ <h1>Source code for pororo.tasks.age_suitability</h1><div class="highlight"><pre
<span class="s2">&quot;emotion&quot;</span><span class="p">:</span> <span class="n">emotion</span><span class="p">,</span>
<span class="p">}</span>

<span class="k">return</span> <span class="n">result</span></div>

<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">text</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">show_probs</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">text</span><span class="p">,</span> <span class="nb">str</span><span class="p">),</span> <span class="s2">&quot;Input text should be string type&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">text</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">result</span></div></div>


<div class="viewcode-block" id="RobertaEncoder"><a class="viewcode-back" href="../../../text_cls/age_suitability.html#pororo.tasks.age_suitability.RobertaEncoder">[docs]</a><span class="k">class</span> <span class="nc">RobertaEncoder</span><span class="p">(</span><span class="n">nn</span><span class="o">.</span><span class="n">Module</span><span class="p">):</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ <h1>Source code for pororo.tasks.automated_essay_scoring</h1><div class="highlig
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">config</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_model</span> <span class="o">=</span> <span class="n">model</span>

<div class="viewcode-block" id="PororoBertAes.predict"><a class="viewcode-back" href="../../../text_cls/aes.html#pororo.tasks.automated_essay_scoring.PororoBertAes.predict">[docs]</a> <span class="k">def</span> <span class="nf">predict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sent</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<div class="viewcode-block" id="PororoBertAes.predict"><a class="viewcode-back" href="../../../text_cls/aes.html#pororo.tasks.automated_essay_scoring.PororoBertAes.predict">[docs]</a> <span class="k">def</span> <span class="nf">predict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sent</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Conduct Automated Essay Scoring</span>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,7 @@ <h1>Source code for pororo.tasks.automatic_speech_recognition</h1><div class="hi
<div class="viewcode-block" id="PororoASR.predict"><a class="viewcode-back" href="../../../miscs/asr.html#pororo.tasks.automatic_speech_recognition.PororoASR.predict">[docs]</a> <span class="k">def</span> <span class="nf">predict</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">audio_path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">top_db</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">48</span><span class="p">,</span>
<span class="n">batch_size</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
<span class="n">vad</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">dict</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Conduct speech recognition for audio in a given path</span>
Expand All @@ -409,6 +407,9 @@ <h1>Source code for pororo.tasks.automatic_speech_recognition</h1><div class="hi
<span class="sd"> dict: result of speech recognition</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">top_db</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;top_db&quot;</span><span class="p">,</span> <span class="mi">48</span><span class="p">)</span>
<span class="n">batch_size</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;batch_size&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">vad</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;batch_size&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>

<span class="n">signal</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_preprocess_audio</span><span class="p">(</span><span class="n">audio_path</span><span class="p">)</span>

Expand All @@ -418,21 +419,7 @@ <h1>Source code for pororo.tasks.automatic_speech_recognition</h1><div class="hi
<span class="n">top_db</span><span class="o">=</span><span class="n">top_db</span><span class="p">,</span>
<span class="n">vad</span><span class="o">=</span><span class="n">vad</span><span class="p">,</span>
<span class="n">batch_size</span><span class="o">=</span><span class="n">batch_size</span><span class="p">,</span>
<span class="p">)</span></div>

<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">audio_path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">top_db</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">48</span><span class="p">,</span>
<span class="n">batch_size</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">16</span><span class="p">,</span>
<span class="n">vad</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">dict</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span>
<span class="n">audio_path</span><span class="o">=</span><span class="n">audio_path</span><span class="p">,</span>
<span class="n">top_db</span><span class="o">=</span><span class="n">top_db</span><span class="p">,</span>
<span class="n">batch_size</span><span class="o">=</span><span class="n">batch_size</span><span class="p">,</span>
<span class="n">vad</span><span class="o">=</span><span class="n">vad</span><span class="p">,</span>
<span class="p">)</span></div>
<span class="p">)</span></div></div>
</pre></div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_modules/pororo/tasks/collocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ <h1>Source code for pororo.tasks.collocation</h1><div class="highlight"><pre>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">config</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_model</span> <span class="o">=</span> <span class="n">model</span>

<div class="viewcode-block" id="PororoCollocate.predict"><a class="viewcode-back" href="../../../miscs/collocation.html#pororo.tasks.collocation.PororoCollocate.predict">[docs]</a> <span class="k">def</span> <span class="nf">predict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">text</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<div class="viewcode-block" id="PororoCollocate.predict"><a class="viewcode-back" href="../../../miscs/collocation.html#pororo.tasks.collocation.PororoCollocate.predict">[docs]</a> <span class="k">def</span> <span class="nf">predict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">text</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Conduct collocation search using index file</span>

Expand Down
Loading