Skip to content

Commit

Permalink
Deployed 2353f4c with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenGr committed Jul 22, 2024
1 parent 2321d52 commit e10efe2
Show file tree
Hide file tree
Showing 49 changed files with 4,019 additions and 3,095 deletions.
2 changes: 1 addition & 1 deletion algorithm/algorithm.html
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,7 @@ <h2 id="code-overview"><strong>Code Overview</strong><a class="headerlink" href=
<span class="n">hdbscan_model</span><span class="o">=</span><span class="n">hdbscan_model</span><span class="p">,</span> <span class="c1"># Step 3 - Cluster reduced embeddings</span>
<span class="n">vectorizer_model</span><span class="o">=</span><span class="n">vectorizer_model</span><span class="p">,</span> <span class="c1"># Step 4 - Tokenize topics</span>
<span class="n">ctfidf_model</span><span class="o">=</span><span class="n">ctfidf_model</span><span class="p">,</span> <span class="c1"># Step 5 - Extract topic words</span>
<span class="n">representation_model</span><span class="o">=</span><span class="n">representation_model</span> <span class="c1"># Step 6 - (Optional) Fine-tune topic represenations</span>
<span class="n">representation_model</span><span class="o">=</span><span class="n">representation_model</span> <span class="c1"># Step 6 - (Optional) Fine-tune topic representations</span>
<span class="p">)</span>
</code></pre></div>
<h2 id="detailed-overview"><strong>Detailed Overview</strong><a class="headerlink" href="#detailed-overview" title="Permanent link">&para;</a></h2>
Expand Down
63 changes: 25 additions & 38 deletions api/backends/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,7 @@ <h1 id="baseembedder"><code>BaseEmbedder</code><a class="headerlink" href="#base
<a id="bertopic.backend._base.BaseEmbedder"></a>
<div class="doc doc-contents first">

<p>The Base Embedder used for creating embedding models</p>
<p>The Base Embedder used for creating embedding models.</p>

<p><strong>Parameters:</strong></p>
<table>
Expand Down Expand Up @@ -2694,7 +2694,7 @@ <h1 id="baseembedder"><code>BaseEmbedder</code><a class="headerlink" href="#base
<details class="quote">
<summary>Source code in <code>bertopic\backend\_base.py</code></summary>
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">BaseEmbedder</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; The Base Embedder used for creating embedding models</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;The Base Embedder used for creating embedding models.</span>

<span class="sd"> Arguments:</span>
<span class="sd"> embedding_model: The main embedding model to be used for extracting</span>
Expand All @@ -2704,17 +2704,14 @@ <h1 id="baseembedder"><code>BaseEmbedder</code><a class="headerlink" href="#base
<span class="sd"> then the `embedding_model` is purely used for</span>
<span class="sd"> creating document embeddings.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
<span class="n">embedding_model</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">word_embedding_model</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">embedding_model</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">word_embedding_model</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">embedding_model</span> <span class="o">=</span> <span class="n">embedding_model</span>
<span class="bp">self</span><span class="o">.</span><span class="n">word_embedding_model</span> <span class="o">=</span> <span class="n">word_embedding_model</span>

<span class="k">def</span> <span class="nf">embed</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
<span class="n">documents</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
<span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; Embed a list of n documents/words into an n-dimensional</span>
<span class="sd"> matrix of embeddings</span>
<span class="k">def</span> <span class="nf">embed</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">documents</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Embed a list of n documents/words into an n-dimensional</span>
<span class="sd"> matrix of embeddings.</span>

<span class="sd"> Arguments:</span>
<span class="sd"> documents: A list of documents or words to be embedded</span>
Expand All @@ -2726,11 +2723,9 @@ <h1 id="baseembedder"><code>BaseEmbedder</code><a class="headerlink" href="#base
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">pass</span>

<span class="k">def</span> <span class="nf">embed_words</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
<span class="n">words</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
<span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; Embed a list of n words into an n-dimensional</span>
<span class="sd"> matrix of embeddings</span>
<span class="k">def</span> <span class="nf">embed_words</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">words</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Embed a list of n words into an n-dimensional</span>
<span class="sd"> matrix of embeddings.</span>

<span class="sd"> Arguments:</span>
<span class="sd"> words: A list of words to be embedded</span>
Expand All @@ -2743,11 +2738,9 @@ <h1 id="baseembedder"><code>BaseEmbedder</code><a class="headerlink" href="#base
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">embed</span><span class="p">(</span><span class="n">words</span><span class="p">,</span> <span class="n">verbose</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">embed_documents</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
<span class="n">document</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
<span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; Embed a list of n words into an n-dimensional</span>
<span class="sd"> matrix of embeddings</span>
<span class="k">def</span> <span class="nf">embed_documents</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Embed a list of n words into an n-dimensional</span>
<span class="sd"> matrix of embeddings.</span>

<span class="sd"> Arguments:</span>
<span class="sd"> document: A list of documents to be embedded</span>
Expand Down Expand Up @@ -2787,7 +2780,7 @@ <h2 id="bertopic.backend._base.BaseEmbedder.embed" class="doc doc-heading">
<div class="doc doc-contents ">

<p>Embed a list of n documents/words into an n-dimensional
matrix of embeddings</p>
matrix of embeddings.</p>

<p><strong>Parameters:</strong></p>
<table>
Expand Down Expand Up @@ -2832,11 +2825,9 @@ <h2 id="bertopic.backend._base.BaseEmbedder.embed" class="doc doc-heading">
</table>
<details class="quote">
<summary>Source code in <code>bertopic\backend\_base.py</code></summary>
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">embed</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
<span class="n">documents</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
<span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; Embed a list of n documents/words into an n-dimensional</span>
<span class="sd"> matrix of embeddings</span>
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">embed</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">documents</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Embed a list of n documents/words into an n-dimensional</span>
<span class="sd"> matrix of embeddings.</span>

<span class="sd"> Arguments:</span>
<span class="sd"> documents: A list of documents or words to be embedded</span>
Expand Down Expand Up @@ -2868,7 +2859,7 @@ <h2 id="bertopic.backend._base.BaseEmbedder.embed_documents" class="doc doc-head
<div class="doc doc-contents ">

<p>Embed a list of n words into an n-dimensional
matrix of embeddings</p>
matrix of embeddings.</p>

<p><strong>Parameters:</strong></p>
<table>
Expand Down Expand Up @@ -2913,11 +2904,9 @@ <h2 id="bertopic.backend._base.BaseEmbedder.embed_documents" class="doc doc-head
</table>
<details class="quote">
<summary>Source code in <code>bertopic\backend\_base.py</code></summary>
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">embed_documents</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
<span class="n">document</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
<span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; Embed a list of n words into an n-dimensional</span>
<span class="sd"> matrix of embeddings</span>
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">embed_documents</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Embed a list of n words into an n-dimensional</span>
<span class="sd"> matrix of embeddings.</span>

<span class="sd"> Arguments:</span>
<span class="sd"> document: A list of documents to be embedded</span>
Expand Down Expand Up @@ -2949,7 +2938,7 @@ <h2 id="bertopic.backend._base.BaseEmbedder.embed_words" class="doc doc-heading"
<div class="doc doc-contents ">

<p>Embed a list of n words into an n-dimensional
matrix of embeddings</p>
matrix of embeddings.</p>

<p><strong>Parameters:</strong></p>
<table>
Expand Down Expand Up @@ -2994,11 +2983,9 @@ <h2 id="bertopic.backend._base.BaseEmbedder.embed_words" class="doc doc-heading"
</table>
<details class="quote">
<summary>Source code in <code>bertopic\backend\_base.py</code></summary>
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">embed_words</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
<span class="n">words</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
<span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; Embed a list of n words into an n-dimensional</span>
<span class="sd"> matrix of embeddings</span>
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">embed_words</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">words</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">verbose</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">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Embed a list of n words into an n-dimensional</span>
<span class="sd"> matrix of embeddings.</span>

<span class="sd"> Arguments:</span>
<span class="sd"> words: A list of words to be embedded</span>
Expand Down
Loading

0 comments on commit e10efe2

Please sign in to comment.