Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Sep 29, 2024
1 parent 062e990 commit ea8f712
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d1b8d815
60a57bf4
45 changes: 22 additions & 23 deletions reference/llm_classify.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,29 +305,28 @@ <h2 class="anchored" data-anchor-id="examples">Examples</h2>
<span id="cb2-29"><a href="#cb2-29" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb2-30"><a href="#cb2-30" aria-hidden="true" tabindex="-1"></a><span class="co"># Pass custom values for each classification </span></span>
<span id="cb2-31"><a href="#cb2-31" aria-hidden="true" tabindex="-1"></a><span class="fu">llm_classify</span>(reviews, review, <span class="fu">c</span>(<span class="st">"appliance"</span> <span class="sc">~</span> <span class="dv">1</span>, <span class="st">"computer"</span> <span class="sc">~</span> <span class="dv">2</span>)) </span>
<span id="cb2-32"><a href="#cb2-32" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; ! There were 2 predictions with invalid output, they were coerced to NA</span></span>
<span id="cb2-33"><a href="#cb2-33" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; # A tibble: 3 × 2</span></span>
<span id="cb2-34"><a href="#cb2-34" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; review .classify</span></span>
<span id="cb2-35"><a href="#cb2-35" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; &lt;chr&gt; &lt;dbl&gt;</span></span>
<span id="cb2-36"><a href="#cb2-36" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 1 This has been the best TV I've ever used. Great screen, and sound. NA</span></span>
<span id="cb2-37"><a href="#cb2-37" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 2 I regret buying this laptop. It is too slow and the keyboard is too… 2</span></span>
<span id="cb2-38"><a href="#cb2-38" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 3 Not sure how to feel about my new washing machine. Great color, but… NA</span></span>
<span id="cb2-39"><a href="#cb2-39" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb2-40"><a href="#cb2-40" aria-hidden="true" tabindex="-1"></a><span class="co"># For character vectors, instead of a data frame, use this function </span></span>
<span id="cb2-41"><a href="#cb2-41" aria-hidden="true" tabindex="-1"></a><span class="fu">llm_vec_classify</span>( </span>
<span id="cb2-42"><a href="#cb2-42" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"this is important!"</span>, <span class="st">"just whenever"</span>), </span>
<span id="cb2-43"><a href="#cb2-43" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"urgent"</span>, <span class="st">"not urgent"</span>) </span>
<span id="cb2-44"><a href="#cb2-44" aria-hidden="true" tabindex="-1"></a>) </span>
<span id="cb2-45"><a href="#cb2-45" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1] "urgent" "urgent"</span></span>
<span id="cb2-46"><a href="#cb2-46" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb2-47"><a href="#cb2-47" aria-hidden="true" tabindex="-1"></a><span class="co"># To preview the first call that will be made to the downstream R function </span></span>
<span id="cb2-48"><a href="#cb2-48" aria-hidden="true" tabindex="-1"></a><span class="fu">llm_vec_classify</span>( </span>
<span id="cb2-49"><a href="#cb2-49" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"this is important!"</span>, <span class="st">"just whenever"</span>), </span>
<span id="cb2-50"><a href="#cb2-50" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"urgent"</span>, <span class="st">"not urgent"</span>), </span>
<span id="cb2-51"><a href="#cb2-51" aria-hidden="true" tabindex="-1"></a> <span class="at">preview =</span> <span class="cn">TRUE</span> </span>
<span id="cb2-52"><a href="#cb2-52" aria-hidden="true" tabindex="-1"></a>) </span>
<span id="cb2-53"><a href="#cb2-53" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; ollamar::chat(messages = list(list(role = "user", content = "You are a helpful classification engine. Determine if the text refers to one of the following: urgent, not urgent. No capitalization. No explanations. The answer is based on the following text:\nthis is important!")), </span></span>
<span id="cb2-54"><a href="#cb2-54" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; output = "text", model = "llama3.2", seed = 100)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<span id="cb2-32"><a href="#cb2-32" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; # A tibble: 3 × 2</span></span>
<span id="cb2-33"><a href="#cb2-33" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; review .classify</span></span>
<span id="cb2-34"><a href="#cb2-34" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; &lt;chr&gt; &lt;dbl&gt;</span></span>
<span id="cb2-35"><a href="#cb2-35" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 1 This has been the best TV I've ever used. Great screen, and sound. 1</span></span>
<span id="cb2-36"><a href="#cb2-36" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 2 I regret buying this laptop. It is too slow and the keyboard is too… 2</span></span>
<span id="cb2-37"><a href="#cb2-37" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 3 Not sure how to feel about my new washing machine. Great color, but… 1</span></span>
<span id="cb2-38"><a href="#cb2-38" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb2-39"><a href="#cb2-39" aria-hidden="true" tabindex="-1"></a><span class="co"># For character vectors, instead of a data frame, use this function </span></span>
<span id="cb2-40"><a href="#cb2-40" aria-hidden="true" tabindex="-1"></a><span class="fu">llm_vec_classify</span>( </span>
<span id="cb2-41"><a href="#cb2-41" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"this is important!"</span>, <span class="st">"just whenever"</span>), </span>
<span id="cb2-42"><a href="#cb2-42" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"urgent"</span>, <span class="st">"not urgent"</span>) </span>
<span id="cb2-43"><a href="#cb2-43" aria-hidden="true" tabindex="-1"></a>) </span>
<span id="cb2-44"><a href="#cb2-44" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1] "urgent" "urgent"</span></span>
<span id="cb2-45"><a href="#cb2-45" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb2-46"><a href="#cb2-46" aria-hidden="true" tabindex="-1"></a><span class="co"># To preview the first call that will be made to the downstream R function </span></span>
<span id="cb2-47"><a href="#cb2-47" aria-hidden="true" tabindex="-1"></a><span class="fu">llm_vec_classify</span>( </span>
<span id="cb2-48"><a href="#cb2-48" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"this is important!"</span>, <span class="st">"just whenever"</span>), </span>
<span id="cb2-49"><a href="#cb2-49" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"urgent"</span>, <span class="st">"not urgent"</span>), </span>
<span id="cb2-50"><a href="#cb2-50" aria-hidden="true" tabindex="-1"></a> <span class="at">preview =</span> <span class="cn">TRUE</span> </span>
<span id="cb2-51"><a href="#cb2-51" aria-hidden="true" tabindex="-1"></a>) </span>
<span id="cb2-52"><a href="#cb2-52" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; ollamar::chat(messages = list(list(role = "user", content = "You are a helpful classification engine. Determine if the text refers to one of the following: urgent, not urgent. No capitalization. No explanations. The answer is based on the following text:\nthis is important!")), </span></span>
<span id="cb2-53"><a href="#cb2-53" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; output = "text", model = "llama3.2", seed = 100)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>


Expand Down
2 changes: 1 addition & 1 deletion search.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
"href": "reference/llm_classify.html#examples",
"title": "Categorize data as one of options given",
"section": "Examples",
"text": "Examples\n\n \nlibrary(mall) \n \ndata(\"reviews\") \n \nllm_use(\"ollama\", \"llama3.2\", seed = 100, .silent = TRUE) \n \nllm_classify(reviews, review, c(\"appliance\", \"computer\")) \n#&gt; # A tibble: 3 × 2\n#&gt; review .classify\n#&gt; &lt;chr&gt; &lt;chr&gt; \n#&gt; 1 This has been the best TV I've ever used. Gr… computer \n#&gt; 2 I regret buying this laptop. It is too slow … computer \n#&gt; 3 Not sure how to feel about my new washing ma… appliance\n \n# Use 'pred_name' to customize the new column's name \nllm_classify( \n reviews, \n review, \n c(\"appliance\", \"computer\"), \n pred_name = \"prod_type\" \n) \n#&gt; # A tibble: 3 × 2\n#&gt; review prod_type\n#&gt; &lt;chr&gt; &lt;chr&gt; \n#&gt; 1 This has been the best TV I've ever used. Gr… computer \n#&gt; 2 I regret buying this laptop. It is too slow … computer \n#&gt; 3 Not sure how to feel about my new washing ma… appliance\n \n# Pass custom values for each classification \nllm_classify(reviews, review, c(\"appliance\" ~ 1, \"computer\" ~ 2)) \n#&gt; ! There were 2 predictions with invalid output, they were coerced to NA\n#&gt; # A tibble: 3 × 2\n#&gt; review .classify\n#&gt; &lt;chr&gt; &lt;dbl&gt;\n#&gt; 1 This has been the best TV I've ever used. Great screen, and sound. NA\n#&gt; 2 I regret buying this laptop. It is too slow and the keyboard is too… 2\n#&gt; 3 Not sure how to feel about my new washing machine. Great color, but… NA\n \n# For character vectors, instead of a data frame, use this function \nllm_vec_classify( \n c(\"this is important!\", \"just whenever\"), \n c(\"urgent\", \"not urgent\") \n) \n#&gt; [1] \"urgent\" \"urgent\"\n \n# To preview the first call that will be made to the downstream R function \nllm_vec_classify( \n c(\"this is important!\", \"just whenever\"), \n c(\"urgent\", \"not urgent\"), \n preview = TRUE \n) \n#&gt; ollamar::chat(messages = list(list(role = \"user\", content = \"You are a helpful classification engine. Determine if the text refers to one of the following: urgent, not urgent. No capitalization. No explanations. The answer is based on the following text:\\nthis is important!\")), \n#&gt; output = \"text\", model = \"llama3.2\", seed = 100)"
"text": "Examples\n\n \nlibrary(mall) \n \ndata(\"reviews\") \n \nllm_use(\"ollama\", \"llama3.2\", seed = 100, .silent = TRUE) \n \nllm_classify(reviews, review, c(\"appliance\", \"computer\")) \n#&gt; # A tibble: 3 × 2\n#&gt; review .classify\n#&gt; &lt;chr&gt; &lt;chr&gt; \n#&gt; 1 This has been the best TV I've ever used. Gr… computer \n#&gt; 2 I regret buying this laptop. It is too slow … computer \n#&gt; 3 Not sure how to feel about my new washing ma… appliance\n \n# Use 'pred_name' to customize the new column's name \nllm_classify( \n reviews, \n review, \n c(\"appliance\", \"computer\"), \n pred_name = \"prod_type\" \n) \n#&gt; # A tibble: 3 × 2\n#&gt; review prod_type\n#&gt; &lt;chr&gt; &lt;chr&gt; \n#&gt; 1 This has been the best TV I've ever used. Gr… computer \n#&gt; 2 I regret buying this laptop. It is too slow … computer \n#&gt; 3 Not sure how to feel about my new washing ma… appliance\n \n# Pass custom values for each classification \nllm_classify(reviews, review, c(\"appliance\" ~ 1, \"computer\" ~ 2)) \n#&gt; # A tibble: 3 × 2\n#&gt; review .classify\n#&gt; &lt;chr&gt; &lt;dbl&gt;\n#&gt; 1 This has been the best TV I've ever used. Great screen, and sound. 1\n#&gt; 2 I regret buying this laptop. It is too slow and the keyboard is too… 2\n#&gt; 3 Not sure how to feel about my new washing machine. Great color, but… 1\n \n# For character vectors, instead of a data frame, use this function \nllm_vec_classify( \n c(\"this is important!\", \"just whenever\"), \n c(\"urgent\", \"not urgent\") \n) \n#&gt; [1] \"urgent\" \"urgent\"\n \n# To preview the first call that will be made to the downstream R function \nllm_vec_classify( \n c(\"this is important!\", \"just whenever\"), \n c(\"urgent\", \"not urgent\"), \n preview = TRUE \n) \n#&gt; ollamar::chat(messages = list(list(role = \"user\", content = \"You are a helpful classification engine. Determine if the text refers to one of the following: urgent, not urgent. No capitalization. No explanations. The answer is based on the following text:\\nthis is important!\")), \n#&gt; output = \"text\", model = \"llama3.2\", seed = 100)"
},
{
"objectID": "articles/caching.html",
Expand Down
28 changes: 14 additions & 14 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,58 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://edgararuiz.github.io/mall/LICENSE.html</loc>
<lastmod>2024-09-29T17:58:15.226Z</lastmod>
<lastmod>2024-09-29T18:03:49.792Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/llm_custom.html</loc>
<lastmod>2024-09-29T17:58:15.233Z</lastmod>
<lastmod>2024-09-29T18:03:49.799Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/llm_translate.html</loc>
<lastmod>2024-09-29T17:58:15.234Z</lastmod>
<lastmod>2024-09-29T18:03:49.799Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/llm_sentiment.html</loc>
<lastmod>2024-09-29T17:58:15.234Z</lastmod>
<lastmod>2024-09-29T18:03:49.799Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/reviews.html</loc>
<lastmod>2024-09-29T17:58:15.234Z</lastmod>
<lastmod>2024-09-29T18:03:49.800Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/llm_classify.html</loc>
<lastmod>2024-09-29T17:58:15.233Z</lastmod>
<lastmod>2024-09-29T18:03:49.799Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/articles/caching.html</loc>
<lastmod>2024-09-29T17:58:15.228Z</lastmod>
<lastmod>2024-09-29T18:03:49.794Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/articles/databricks.html</loc>
<lastmod>2024-09-29T17:58:15.228Z</lastmod>
<lastmod>2024-09-29T18:03:49.794Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/index.html</loc>
<lastmod>2024-09-29T17:58:15.233Z</lastmod>
<lastmod>2024-09-29T18:03:49.799Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/m_backend_submit.html</loc>
<lastmod>2024-09-29T17:58:15.234Z</lastmod>
<lastmod>2024-09-29T18:03:49.800Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/llm_summarize.html</loc>
<lastmod>2024-09-29T17:58:15.234Z</lastmod>
<lastmod>2024-09-29T18:03:49.799Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/llm_use.html</loc>
<lastmod>2024-09-29T17:58:15.234Z</lastmod>
<lastmod>2024-09-29T18:03:49.800Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/reference/llm_extract.html</loc>
<lastmod>2024-09-29T17:58:15.234Z</lastmod>
<lastmod>2024-09-29T18:03:49.799Z</lastmod>
</url>
<url>
<loc>https://edgararuiz.github.io/mall/index.html</loc>
<lastmod>2024-09-29T17:58:15.228Z</lastmod>
<lastmod>2024-09-29T18:03:49.794Z</lastmod>
</url>
</urlset>

0 comments on commit ea8f712

Please sign in to comment.