Skip to content

Commit

Permalink
build based on 992af7e
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Feb 7, 2024
1 parent d29f3b2 commit 61572d1
Show file tree
Hide file tree
Showing 12 changed files with 121 additions and 110 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-02-07T18:27:15","documenter_version":"1.2.1"}}
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-02-07T22:32:52","documenter_version":"1.2.1"}}
151 changes: 81 additions & 70 deletions dev/APIReference/index.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dev/LM/index.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dev/classify/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
julia> predict(m, "is this a spam")
Dict{Symbol, Float64} with 2 entries:
:spam => 0.59883
:non_spam =&gt; 0.40117</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/3ec01c8dd3115fff191f34d81a6aa9c353f3e09b/src/bayes.jl#L43-L70">source</a></section></article><p>2- Fitting the model weights on input -</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="TextAnalysis.fit!" href="#TextAnalysis.fit!"><code>TextAnalysis.fit!</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">fit!(model::NaiveBayesClassifier, str, class)
:non_spam =&gt; 0.40117</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/992af7e7839fe025978db94663adb385ab9911d9/src/bayes.jl#L43-L70">source</a></section></article><p>2- Fitting the model weights on input -</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="TextAnalysis.fit!" href="#TextAnalysis.fit!"><code>TextAnalysis.fit!</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">fit!(model::NaiveBayesClassifier, str, class)
fit!(model::NaiveBayesClassifier, ::Features, class)
fit!(model::NaiveBayesClassifier, ::StringDocument, class)</code></pre><p>Fit the weights for the model on the input data.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/3ec01c8dd3115fff191f34d81a6aa9c353f3e09b/src/bayes.jl#L90-L96">source</a></section></article><p>3- Predicting for the input case -</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="TextAnalysis.predict" href="#TextAnalysis.predict"><code>TextAnalysis.predict</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">predict(::NaiveBayesClassifier, str)
fit!(model::NaiveBayesClassifier, ::StringDocument, class)</code></pre><p>Fit the weights for the model on the input data.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/992af7e7839fe025978db94663adb385ab9911d9/src/bayes.jl#L90-L96">source</a></section></article><p>3- Predicting for the input case -</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="TextAnalysis.predict" href="#TextAnalysis.predict"><code>TextAnalysis.predict</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">predict(::NaiveBayesClassifier, str)
predict(::NaiveBayesClassifier, ::Features)
predict(::NaiveBayesClassifier, ::StringDocument)</code></pre><p>Predict probabilities for each class on the input Features or String.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/3ec01c8dd3115fff191f34d81a6aa9c353f3e09b/src/bayes.jl#L113-L119">source</a></section></article><h2 id="Example"><a class="docs-heading-anchor" href="#Example">Example</a><a id="Example-1"></a><a class="docs-heading-anchor-permalink" href="#Example" title="Permalink"></a></h2><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using TextAnalysis</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; m = NaiveBayesClassifier([:legal, :financial])</code><code class="nohighlight hljs ansi" style="display:block;">NaiveBayesClassifier{Symbol}(String[], [:legal, :financial], Matrix{Int64}(undef, 0, 2))</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; fit!(m, &quot;this is financial doc&quot;, :financial)</code><code class="nohighlight hljs ansi" style="display:block;">NaiveBayesClassifier{Symbol}([&quot;financial&quot;, &quot;this&quot;, &quot;is&quot;, &quot;doc&quot;], [:legal, :financial], [1 2; 1 2; 1 2; 1 2])</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; fit!(m, &quot;this is legal doc&quot;, :legal)</code><code class="nohighlight hljs ansi" style="display:block;">NaiveBayesClassifier{Symbol}([&quot;financial&quot;, &quot;this&quot;, &quot;is&quot;, &quot;doc&quot;, &quot;legal&quot;], [:legal, :financial], [1 2; 2 2; … ; 2 2; 2 1])</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; predict(m, &quot;this should be predicted as a legal document&quot;)</code><code class="nohighlight hljs ansi" style="display:block;">Dict{Symbol, Float64} with 2 entries:
predict(::NaiveBayesClassifier, ::StringDocument)</code></pre><p>Predict probabilities for each class on the input Features or String.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/992af7e7839fe025978db94663adb385ab9911d9/src/bayes.jl#L116-L122">source</a></section></article><h2 id="Example"><a class="docs-heading-anchor" href="#Example">Example</a><a id="Example-1"></a><a class="docs-heading-anchor-permalink" href="#Example" title="Permalink"></a></h2><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using TextAnalysis</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; m = NaiveBayesClassifier([:legal, :financial])</code><code class="nohighlight hljs ansi" style="display:block;">NaiveBayesClassifier{Symbol}(String[], [:legal, :financial], Matrix{Int64}(undef, 0, 2))</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; fit!(m, &quot;this is financial doc&quot;, :financial)</code><code class="nohighlight hljs ansi" style="display:block;">NaiveBayesClassifier{Symbol}([&quot;financial&quot;, &quot;this&quot;, &quot;is&quot;, &quot;doc&quot;], [:legal, :financial], [1 2; 1 2; 1 2; 1 2])</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; fit!(m, &quot;this is legal doc&quot;, :legal)</code><code class="nohighlight hljs ansi" style="display:block;">NaiveBayesClassifier{Symbol}([&quot;financial&quot;, &quot;this&quot;, &quot;is&quot;, &quot;doc&quot;, &quot;legal&quot;], [:legal, :financial], [1 2; 2 2; … ; 2 2; 2 1])</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; predict(m, &quot;this should be predicted as a legal document&quot;)</code><code class="nohighlight hljs ansi" style="display:block;">Dict{Symbol, Float64} with 2 entries:
:legal =&gt; 0.666667
:financial =&gt; 0.333333</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../semantic/">« Semantic Analysis</a><a class="docs-footer-nextpage" href="../example/">Extended Example »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 7 February 2024 18:27">Wednesday 7 February 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
:financial =&gt; 0.333333</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../semantic/">« Semantic Analysis</a><a class="docs-footer-nextpage" href="../example/">Extended Example »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 7 February 2024 22:32">Wednesday 7 February 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
6 changes: 3 additions & 3 deletions dev/corpus/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 0 NGramDocument&#39;s

Corpus&#39;s lexicon contains 0 tokens
Corpus&#39;s index contains 0 tokens</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/3ec01c8dd3115fff191f34d81a6aa9c353f3e09b/src/corpus.jl#L9-L27">source</a></section></article><h2 id="Standardizing-a-Corpus"><a class="docs-heading-anchor" href="#Standardizing-a-Corpus">Standardizing a Corpus</a><a id="Standardizing-a-Corpus-1"></a><a class="docs-heading-anchor-permalink" href="#Standardizing-a-Corpus" title="Permalink"></a></h2><p>A <code>Corpus</code> may contain many different types of documents. It is generally more convenient to standardize all of the documents in a corpus using a single type. This can be done using the <code>standardize!</code> function:</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="TextAnalysis.standardize!" href="#TextAnalysis.standardize!"><code>TextAnalysis.standardize!</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">standardize!(crps::Corpus, ::Type{T}) where T &lt;: AbstractDocument</code></pre><p>Standardize the documents in a Corpus to a common type.</p><p><strong>Example</strong></p><pre><code class="language-julia-repl hljs">julia&gt; crps = Corpus([StringDocument(&quot;Document 1&quot;),
Corpus&#39;s index contains 0 tokens</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/992af7e7839fe025978db94663adb385ab9911d9/src/corpus.jl#L9-L27">source</a></section></article><h2 id="Standardizing-a-Corpus"><a class="docs-heading-anchor" href="#Standardizing-a-Corpus">Standardizing a Corpus</a><a id="Standardizing-a-Corpus-1"></a><a class="docs-heading-anchor-permalink" href="#Standardizing-a-Corpus" title="Permalink"></a></h2><p>A <code>Corpus</code> may contain many different types of documents. It is generally more convenient to standardize all of the documents in a corpus using a single type. This can be done using the <code>standardize!</code> function:</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="TextAnalysis.standardize!" href="#TextAnalysis.standardize!"><code>TextAnalysis.standardize!</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">standardize!(crps::Corpus, ::Type{T}) where T &lt;: AbstractDocument</code></pre><p>Standardize the documents in a Corpus to a common type.</p><p><strong>Example</strong></p><pre><code class="language-julia-repl hljs">julia&gt; crps = Corpus([StringDocument(&quot;Document 1&quot;),
TokenDocument(&quot;Document 2&quot;),
NGramDocument(&quot;Document 3&quot;)])
A Corpus with 3 documents:
Expand All @@ -33,7 +33,7 @@
* 3 NGramDocument&#39;s

Corpus&#39;s lexicon contains 0 tokens
Corpus&#39;s index contains 0 tokens</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/3ec01c8dd3115fff191f34d81a6aa9c353f3e09b/src/corpus.jl#L261-L295">source</a></section></article><h2 id="Processing-a-Corpus"><a class="docs-heading-anchor" href="#Processing-a-Corpus">Processing a Corpus</a><a id="Processing-a-Corpus-1"></a><a class="docs-heading-anchor-permalink" href="#Processing-a-Corpus" title="Permalink"></a></h2><p>We can apply the same sort of preprocessing steps that are defined for individual documents to an entire corpus at once:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using TextAnalysis</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; crps = Corpus([StringDocument(&quot;Document ..!!&quot;),
Corpus&#39;s index contains 0 tokens</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaText/TextAnalysis.jl/blob/992af7e7839fe025978db94663adb385ab9911d9/src/corpus.jl#L261-L295">source</a></section></article><h2 id="Processing-a-Corpus"><a class="docs-heading-anchor" href="#Processing-a-Corpus">Processing a Corpus</a><a id="Processing-a-Corpus-1"></a><a class="docs-heading-anchor-permalink" href="#Processing-a-Corpus" title="Permalink"></a></h2><p>We can apply the same sort of preprocessing steps that are defined for individual documents to an entire corpus at once:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using TextAnalysis</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; crps = Corpus([StringDocument(&quot;Document ..!!&quot;),
StringDocument(&quot;Document ..!!&quot;)])</code><code class="nohighlight hljs ansi" style="display:block;">A Corpus with 2 documents:
* 2 StringDocument&#39;s
* 0 FileDocument&#39;s
Expand Down Expand Up @@ -99,4 +99,4 @@
julia&gt; timestamps!(crps, &quot;Now&quot;)</code></pre><p>Additionally, you can specify the metadata fields for each document in a <code>Corpus</code> individually:</p><pre><code class="language-julia hljs">julia&gt; languages!(crps, [Languages.German(), Languages.English
julia&gt; titles!(crps, [&quot;&quot;, &quot;Untitled&quot;])
julia&gt; authors!(crps, [&quot;Ich&quot;, &quot;You&quot;])
julia&gt; timestamps!(crps, [&quot;Unbekannt&quot;, &quot;2018&quot;])</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../documents/">« Documents</a><a class="docs-footer-nextpage" href="../features/">Features »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 7 February 2024 18:27">Wednesday 7 February 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
julia&gt; timestamps!(crps, [&quot;Unbekannt&quot;, &quot;2018&quot;])</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../documents/">« Documents</a><a class="docs-footer-nextpage" href="../features/">Features »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 7 February 2024 22:32">Wednesday 7 February 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 61572d1

Please sign in to comment.