Skip to content

Commit

Permalink
Merge pull request #28 from mlverse/updates
Browse files Browse the repository at this point in the history
PyPi release prep
  • Loading branch information
edgararuiz authored Oct 17, 2024
2 parents 7b26ac4 + 2a71940 commit 6fe3dfc
Show file tree
Hide file tree
Showing 9 changed files with 578 additions and 81 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ docs/

python/mall/src/
python/assets/style.css

python/README_files
python/README.html
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

<!-- badges: start -->

[![R-CMD-check](https://github.com/mlverse/mall/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mlverse/mall/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/mlverse/mall/branch/main/graph/badge.svg)](https://app.codecov.io/gh/mlverse/mall?branch=main)
[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R check](https://github.com/mlverse/mall/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mlverse/mall/actions/workflows/R-CMD-check.yaml)
[![Python tests](https://github.com/mlverse/mall/actions/workflows/python-tests.yaml/badge.svg)](https://github.com/mlverse/mall/actions/workflows/python-tests.yaml)
[![R package coverage](https://codecov.io/gh/mlverse/mall/branch/main/graph/badge.svg)](https://app.codecov.io/gh/mlverse/mall?branch=main)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->

<img src="site/images/favicon/apple-touch-icon-180x180.png" style="float:right" />
Expand All @@ -18,5 +17,5 @@ pre-determined one-shot prompt, along with the current row’s content.
`mall` is now available in both R and Python.

To find out how to install and use, or just to learn more about it, please
visit the official website: https://edgararuiz.github.io/mall/
visit the official website: https://mlverse.github.io/mall/

4 changes: 2 additions & 2 deletions _freeze/index/execute-results/html.json

Large diffs are not rendered by default.

60 changes: 59 additions & 1 deletion index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mall::llm_use("ollama", "llama3.2", seed = 100, .cache = "_readme_cache")
<!-- badges: end -->



Run multiple LLM predictions against a data frame. The predictions are processed
row-wise over a specified column. It works using a pre-determined one-shot prompt,
along with the current row's content. `mall` has been implemented for both R
Expand All @@ -44,6 +45,7 @@ Currently, the included prompts perform the following:
- [Classify text](#classify)
- [Extract one, or several](#extract), specific pieces information from the text
- [Translate text](#translate)
- [Verify that something it true](#verify) about the text (binary)
- [Custom prompt](#custom-prompt)

This package is inspired by the SQL AI functions now offered by vendors such as
Expand Down Expand Up @@ -298,6 +300,63 @@ For more information and examples visit this function's

:::

### Classify

Use the LLM to categorize the text into one of the options you provide:


::: {.panel-tabset group="language"}
## R

```{r}
reviews |>
llm_classify(review, c("appliance", "computer"))
```

For more information and examples visit this function's
[R reference page](reference/llm_classify.qmd)

## Python

```{python}
reviews.llm.classify("review", ["computer", "appliance"])
```

For more information and examples visit this function's
[Python reference page](reference/MallFrame.qmd#mall.MallFrame.classify)

:::

### Verify

This functions allows you to check and see if a statement is true, based
on the provided text. By default, it will return a 1 for "yes", and 0 for
"no". This can be customized.


::: {.panel-tabset group="language"}
## R

```{r}
reviews |>
llm_verify(review, "is the customer happy with the purchase")
```

For more information and examples visit this function's
[R reference page](reference/llm_verify.qmd)

## Python

```{python}
reviews.llm.verify("review", "is the customer happy with the purchase")
```

For more information and examples visit this function's
[Python reference page](reference/MallFrame.qmd#mall.MallFrame.verify)

:::



### Translate

Expand Down Expand Up @@ -486,4 +545,3 @@ llm_vec_sentiment("I am happy")
```{r}
llm_vec_translate("Este es el mejor dia!", "english")
```

Loading

0 comments on commit 6fe3dfc

Please sign in to comment.