From 9adf2b1cea7905764ee7653d95593107632ccb65 Mon Sep 17 00:00:00 2001 From: Quarto GHA Workflow Runner Date: Thu, 24 Oct 2024 16:31:08 +0000 Subject: [PATCH] Built site for gh-pages --- .nojekyll | 2 +- index.html | 242 +++++++++++++++++++++++++++------------------------- search.json | 2 +- sitemap.xml | 40 ++++----- 4 files changed, 146 insertions(+), 140 deletions(-) diff --git a/.nojekyll b/.nojekyll index e58657d..2b639b7 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -a05aa748 \ No newline at end of file +14494313 \ No newline at end of file diff --git a/index.html b/index.html index b503f17..b40e353 100644 --- a/index.html +++ b/index.html @@ -231,16 +231,22 @@

Motivation

Get started

-
pak::pak("mlverse/mall/r")
+

From CRAN:

+
install.packages("mall")
+

From GitHub:

+
pak::pak("mlverse/mall/r")
-
pip install "mall @ git+https://git@github.com/mlverse/mall.git#subdirectory=python"
+

From PyPi:

+
pip install mlverse-mall
+

From GitHub:

+
pip install "mall @ git+https://git@github.com/mlverse/mall.git#subdirectory=python"
@@ -255,16 +261,16 @@

Get started

  • Install the official Ollama library

    -
    pip install ollama
  • +
    pip install ollama
  • Download an LLM model. For example, I have been developing this package using Llama 3.2 to test. To get that model you can run:

    -
    import ollama
    -ollama.pull('llama3.2')
  • +
    import ollama
    +ollama.pull('llama3.2')
@@ -283,25 +289,25 @@

LLM functions

-
library(mall)
-data("reviews")
-
-reviews
-#> # A tibble: 3 × 1
-#>   review                                                                        
-#>   <chr>                                                                         
-#> 1 This has been the best TV I've ever used. Great screen, and sound.            
-#> 2 I regret buying this laptop. It is too slow and the keyboard is too noisy     
-#> 3 Not sure how to feel about my new washing machine. Great color, but hard to f…
+
library(mall)
+data("reviews")
+
+reviews
+#> # A tibble: 3 × 1
+#>   review                                                                        
+#>   <chr>                                                                         
+#> 1 This has been the best TV I've ever used. Great screen, and sound.            
+#> 2 I regret buying this laptop. It is too slow and the keyboard is too noisy     
+#> 3 Not sure how to feel about my new washing machine. Great color, but hard to f…
-
import mall 
-data = mall.MallData
-reviews = data.reviews
-
-reviews 
+
import mall 
+data = mall.MallData
+reviews = data.reviews
+
+reviews 
@@ -337,20 +343,20 @@

Sentiment

-
reviews |>
-  llm_sentiment(review)
-#> # A tibble: 3 × 2
-#>   review                                                              .sentiment
-#>   <chr>                                                               <chr>     
-#> 1 This has been the best TV I've ever used. Great screen, and sound.  positive  
-#> 2 I regret buying this laptop. It is too slow and the keyboard is to… negative  
-#> 3 Not sure how to feel about my new washing machine. Great color, bu… neutral
+
reviews |>
+  llm_sentiment(review)
+#> # A tibble: 3 × 2
+#>   review                                                              .sentiment
+#>   <chr>                                                               <chr>     
+#> 1 This has been the best TV I've ever used. Great screen, and sound.  positive  
+#> 2 I regret buying this laptop. It is too slow and the keyboard is to… negative  
+#> 3 Not sure how to feel about my new washing machine. Great color, bu… neutral

For more information and examples visit this function’s R reference page

-
reviews.llm.sentiment("review")
+
reviews.llm.sentiment("review")
@@ -392,20 +398,20 @@

Summarize

-
reviews |>
-  llm_summarize(review, max_words = 5)
-#> # A tibble: 3 × 2
-#>   review                                        .summary                      
-#>   <chr>                                         <chr>                         
-#> 1 This has been the best TV I've ever used. Gr… it's a great tv               
-#> 2 I regret buying this laptop. It is too slow … laptop purchase was a mistake 
-#> 3 Not sure how to feel about my new washing ma… having mixed feelings about it
+
reviews |>
+  llm_summarize(review, max_words = 5)
+#> # A tibble: 3 × 2
+#>   review                                        .summary                      
+#>   <chr>                                         <chr>                         
+#> 1 This has been the best TV I've ever used. Gr… it's a great tv               
+#> 2 I regret buying this laptop. It is too slow … laptop purchase was a mistake 
+#> 3 Not sure how to feel about my new washing ma… having mixed feelings about it

For more information and examples visit this function’s R reference page

-
reviews.llm.summarize("review", 5)
+
reviews.llm.summarize("review", 5)
@@ -447,20 +453,20 @@

Classify

-
reviews |>
-  llm_classify(review, c("appliance", "computer"))
-#> # A tibble: 3 × 2
-#>   review                                        .classify
-#>   <chr>                                         <chr>    
-#> 1 This has been the best TV I've ever used. Gr… computer 
-#> 2 I regret buying this laptop. It is too slow … computer 
-#> 3 Not sure how to feel about my new washing ma… appliance
+
reviews |>
+  llm_classify(review, c("appliance", "computer"))
+#> # A tibble: 3 × 2
+#>   review                                        .classify
+#>   <chr>                                         <chr>    
+#> 1 This has been the best TV I've ever used. Gr… computer 
+#> 2 I regret buying this laptop. It is too slow … computer 
+#> 3 Not sure how to feel about my new washing ma… appliance

For more information and examples visit this function’s R reference page

-
reviews.llm.classify("review", ["computer", "appliance"])
+
reviews.llm.classify("review", ["computer", "appliance"])
@@ -502,20 +508,20 @@

Extract

-
reviews |>
-  llm_extract(review, "product")
-#> # A tibble: 3 × 2
-#>   review                                        .extract       
-#>   <chr>                                         <chr>          
-#> 1 This has been the best TV I've ever used. Gr… tv             
-#> 2 I regret buying this laptop. It is too slow … laptop         
-#> 3 Not sure how to feel about my new washing ma… washing machine
+
reviews |>
+  llm_extract(review, "product")
+#> # A tibble: 3 × 2
+#>   review                                        .extract       
+#>   <chr>                                         <chr>          
+#> 1 This has been the best TV I've ever used. Gr… tv             
+#> 2 I regret buying this laptop. It is too slow … laptop         
+#> 3 Not sure how to feel about my new washing ma… washing machine

For more information and examples visit this function’s R reference page

-
reviews.llm.extract("review", "product")
+
reviews.llm.extract("review", "product")
@@ -557,20 +563,20 @@

Classify

-
reviews |>
-  llm_classify(review, c("appliance", "computer"))
-#> # A tibble: 3 × 2
-#>   review                                        .classify
-#>   <chr>                                         <chr>    
-#> 1 This has been the best TV I've ever used. Gr… computer 
-#> 2 I regret buying this laptop. It is too slow … computer 
-#> 3 Not sure how to feel about my new washing ma… appliance
+
reviews |>
+  llm_classify(review, c("appliance", "computer"))
+#> # A tibble: 3 × 2
+#>   review                                        .classify
+#>   <chr>                                         <chr>    
+#> 1 This has been the best TV I've ever used. Gr… computer 
+#> 2 I regret buying this laptop. It is too slow … computer 
+#> 3 Not sure how to feel about my new washing ma… appliance

For more information and examples visit this function’s R reference page

-
reviews.llm.classify("review", ["computer", "appliance"])
+
reviews.llm.classify("review", ["computer", "appliance"])
@@ -612,20 +618,20 @@

Verify

-
reviews |>
-  llm_verify(review, "is the customer happy with the purchase")
-#> # A tibble: 3 × 2
-#>   review                                                                 .verify
-#>   <chr>                                                                  <fct>  
-#> 1 This has been the best TV I've ever used. Great screen, and sound.     1      
-#> 2 I regret buying this laptop. It is too slow and the keyboard is too n… 0      
-#> 3 Not sure how to feel about my new washing machine. Great color, but h… 0
+
reviews |>
+  llm_verify(review, "is the customer happy with the purchase")
+#> # A tibble: 3 × 2
+#>   review                                                                 .verify
+#>   <chr>                                                                  <fct>  
+#> 1 This has been the best TV I've ever used. Great screen, and sound.     1      
+#> 2 I regret buying this laptop. It is too slow and the keyboard is too n… 0      
+#> 3 Not sure how to feel about my new washing machine. Great color, but h… 0

For more information and examples visit this function’s R reference page

-
reviews.llm.verify("review", "is the customer happy with the purchase")
+
reviews.llm.verify("review", "is the customer happy with the purchase")
@@ -667,20 +673,20 @@

Translate

-
reviews |>
-  llm_translate(review, "spanish")
-#> # A tibble: 3 × 2
-#>   review                                        .translation                    
-#>   <chr>                                         <chr>                           
-#> 1 This has been the best TV I've ever used. Gr… Esta ha sido la mejor televisió…
-#> 2 I regret buying this laptop. It is too slow … Me arrepiento de comprar este p…
-#> 3 Not sure how to feel about my new washing ma… No estoy seguro de cómo me sien…
+
reviews |>
+  llm_translate(review, "spanish")
+#> # A tibble: 3 × 2
+#>   review                                        .translation                    
+#>   <chr>                                         <chr>                           
+#> 1 This has been the best TV I've ever used. Gr… Esta ha sido la mejor televisió…
+#> 2 I regret buying this laptop. It is too slow … Me arrepiento de comprar este p…
+#> 3 Not sure how to feel about my new washing ma… No estoy seguro de cómo me sien…

For more information and examples visit this function’s R reference page

-
reviews.llm.translate("review", "spanish")
+
reviews.llm.translate("review", "spanish")
@@ -722,34 +728,34 @@

Custom prompt

-
my_prompt <- paste(
-  "Answer a question.",
-  "Return only the answer, no explanation",
-  "Acceptable answers are 'yes', 'no'",
-  "Answer this about the following text, is this a happy customer?:"
-)
-
-reviews |>
-  llm_custom(review, my_prompt)
-#> # A tibble: 3 × 2
-#>   review                                                                   .pred
-#>   <chr>                                                                    <chr>
-#> 1 This has been the best TV I've ever used. Great screen, and sound.       Yes  
-#> 2 I regret buying this laptop. It is too slow and the keyboard is too noi… No   
-#> 3 Not sure how to feel about my new washing machine. Great color, but har… No
+
my_prompt <- paste(
+  "Answer a question.",
+  "Return only the answer, no explanation",
+  "Acceptable answers are 'yes', 'no'",
+  "Answer this about the following text, is this a happy customer?:"
+)
+
+reviews |>
+  llm_custom(review, my_prompt)
+#> # A tibble: 3 × 2
+#>   review                                                                   .pred
+#>   <chr>                                                                    <chr>
+#> 1 This has been the best TV I've ever used. Great screen, and sound.       Yes  
+#> 2 I regret buying this laptop. It is too slow and the keyboard is too noi… No   
+#> 3 Not sure how to feel about my new washing machine. Great color, but har… No

For more information and examples visit this function’s R reference page

-
my_prompt = (
-    "Answer a question."
-    "Return only the answer, no explanation"
-    "Acceptable answers are 'yes', 'no'"
-    "Answer this about the following text, is this a happy customer?:"
-)
-
-reviews.llm.custom("review", prompt = my_prompt)
+
my_prompt = (
+    "Answer a question."
+    "Return only the answer, no explanation"
+    "Acceptable answers are 'yes', 'no'"
+    "Answer this about the following text, is this a happy customer?:"
+)
+
+reviews.llm.custom("review", prompt = my_prompt)
@@ -795,13 +801,13 @@

Model selecti

Calling llm_use() directly will let you specify the model and backend to use. You can also setup additional arguments that will be passed down to the function that actually runs the prediction. In the case of Ollama, that function is chat().

The model to use, and other options can be set for the current R session

-
llm_use("ollama", "llama3.2", seed = 100, temperature = 0)
+
llm_use("ollama", "llama3.2", seed = 100, temperature = 0)

The model and options to be used will be defined at the Polars data frame object level. If not passed, the default model will be llama3.2.

-
reviews.llm.use("ollama", "llama3.2", options = dict(seed = 100))
+
reviews.llm.use("ollama", "llama3.2", options = dict(seed = 100))
@@ -814,20 +820,20 @@

Results caching

-
llm_use(.cache = "_my_cache")
+
llm_use(.cache = "_my_cache")

To turn off:

-
llm_use(.cache = "")
+
llm_use(.cache = "")
-
reviews.llm.use(_cache = "my_cache")
+
reviews.llm.use(_cache = "my_cache")

To turn off:

-
reviews.llm.use(_cache = "")
+
reviews.llm.use(_cache = "")
@@ -846,12 +852,12 @@

Key considerations

Vector functions (R only)

mall includes functions that expect a vector, instead of a table, to run the predictions. This should make it easier to test things, such as custom prompts or results of specific text. Each llm_ function has a corresponding llm_vec_ function:

-
llm_vec_sentiment("I am happy")
-#> [1] "positive"
+
llm_vec_sentiment("I am happy")
+#> [1] "positive"
-
llm_vec_translate("Este es el mejor dia!", "english")
-#> [1] "It's the best day!"
+
llm_vec_translate("Este es el mejor dia!", "english")
+#> [1] "It's the best day!"
diff --git a/search.json b/search.json index 1531ced..92c8d44 100644 --- a/search.json +++ b/search.json @@ -479,7 +479,7 @@ "href": "index.html#get-started", "title": "mall", "section": "Get started", - "text": "Get started\n\nInstall mall from Github\n\n\nRPython\n\n\npak::pak(\"mlverse/mall/r\")\n\n\npip install \"mall @ git+https://git@github.com/mlverse/mall.git#subdirectory=python\"\n\n\n\n\nDownload Ollama from the official website\nInstall and start Ollama in your computer\n\n\nRPython\n\n\n\nInstall Ollama in your machine. The ollamar package’s website provides this Installation guide\nDownload an LLM model. For example, I have been developing this package using Llama 3.2 to test. To get that model you can run:\nollamar::pull(\"llama3.2\")\n\n\n\n\nInstall the official Ollama library\npip install ollama\nDownload an LLM model. For example, I have been developing this package using Llama 3.2 to test. To get that model you can run:\nimport ollama\nollama.pull('llama3.2')\n\n\n\n\n\nWith Databricks (R only)\nIf you pass a table connected to Databricks via odbc, mall will automatically use Databricks’ LLM instead of Ollama. You won’t need Ollama installed if you are using Databricks only.\nmall will call the appropriate SQL AI function. For more information see our Databricks article." + "text": "Get started\n\nInstall mall\n\n\nRPython\n\n\nFrom CRAN:\ninstall.packages(\"mall\")\nFrom GitHub:\npak::pak(\"mlverse/mall/r\")\n\n\nFrom PyPi:\npip install mlverse-mall\nFrom GitHub:\npip install \"mall @ git+https://git@github.com/mlverse/mall.git#subdirectory=python\"\n\n\n\n\nDownload Ollama from the official website\nInstall and start Ollama in your computer\n\n\nRPython\n\n\n\nInstall Ollama in your machine. The ollamar package’s website provides this Installation guide\nDownload an LLM model. For example, I have been developing this package using Llama 3.2 to test. To get that model you can run:\nollamar::pull(\"llama3.2\")\n\n\n\n\nInstall the official Ollama library\npip install ollama\nDownload an LLM model. For example, I have been developing this package using Llama 3.2 to test. To get that model you can run:\nimport ollama\nollama.pull('llama3.2')\n\n\n\n\n\nWith Databricks (R only)\nIf you pass a table connected to Databricks via odbc, mall will automatically use Databricks’ LLM instead of Ollama. You won’t need Ollama installed if you are using Databricks only.\nmall will call the appropriate SQL AI function. For more information see our Databricks article." }, { "objectID": "index.html#llm-functions", diff --git a/sitemap.xml b/sitemap.xml index 86bb262..0403868 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,82 +2,82 @@ https://mlverse.github.io/mall/reference/llm_summarize.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/m_backend_submit.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/llm_use.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/reviews.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/llm_classify.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/llm_sentiment.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/llm_extract.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/r/NEWS.html - 2024-10-23T12:44:19.556Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/r/LICENSE.html - 2024-10-23T12:44:19.556Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/articles/performance.html - 2024-10-23T12:44:19.556Z + 2024-10-24T16:30:44.472Z https://mlverse.github.io/mall/articles/caching.html - 2024-10-23T12:44:19.556Z + 2024-10-24T16:30:44.472Z https://mlverse.github.io/mall/articles/databricks.html - 2024-10-23T12:44:19.556Z + 2024-10-24T16:30:44.472Z https://mlverse.github.io/mall/r/cran-comments.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/index.html - 2024-10-23T12:44:19.556Z + 2024-10-24T16:30:44.472Z https://mlverse.github.io/mall/reference/MallFrame.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/r_index.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/llm_custom.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/llm_verify.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/llm_translate.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z https://mlverse.github.io/mall/reference/index.html - 2024-10-23T12:44:19.560Z + 2024-10-24T16:30:44.476Z