Skip to content

Commit

Permalink
edit readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytimm committed Oct 7, 2024
1 parent e2bac4e commit a9bb2cb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 38 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package: hollr
Type: Package
Title: "A lightweight, versatile tool for text completion via local and cloud-based LLMs in R."
Title: Unified Framework for Chat Completion and Text Annotation with Local and OpenAI Language Models
Version: 1.0.0
Author: Jason Timm [aut, cre]
Authors@R: c(person("Jason", "Timm", role = c("aut", "cre"), email = "[email protected]"))
Maintainer: Jason Timm <[email protected]>
Description: A lightweight tool that provides a unified interface for text completion using local and cloud-based LLMs, with a focus on text annotation tasks.
Description: Enables chat completion and text annotation with local and OpenAI <https://openai.com/> language models, supporting batch processing, multiple annotators, and consistent output formats.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
LazyData: false
Depends:
R (>= 3.5)
Imports:
Expand Down
53 changes: 19 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@

# hollr

An R package designed for efficient chat completion and text annotation
using both local and cloud-based LLMs, with a focus on simplicity and
flexibility. Key features include:
An R package for chat completion and text annotation with both local
LLMs and OpenAI models, emphasizing simplicity and flexibility.. Key
features include:

- **Versatile Model Access**: Interact with cloud-based or local LLMs
(via Python/reticulate) through a straightforward function.
- **Versatile Model Access**: Interact with either local LLMs (via
Python/reticulate) or OpenAI models through a straightforward
function.

- **Multiple Annotator Support**: Facilitate text annotation workflows
with support for multiple annotators, including ensembling and
majority voting methods.

- **Batch and Parallel Processing**: Handle multiple inputs
simultaneously with local LLMs and speed up tasks by utilizing
multiple cores for cloud-based models.
simultaneously, leveraging local LLMs or speeding up tasks by
utilizing multiple cores when working with OpenAI models.

- **Consistent Output**: Ensure uniform data frame outputs regardless
of the model used, keeping results easily manageable.
- **Consistent Output**: Ensure uniform data frame outputs across
model types.

Ideal for users looking for a simple, unified solution for text
annotation with both local and cloud-based language models.
annotation using both local and OpenAI language models.

## Installation

Expand Down Expand Up @@ -98,14 +99,14 @@ class_task1 <- hollr::hollr(

#### Ouput

| id | country | summary |
|:---|:----|:--------------------------------------------------------------|
| 39340096 | United States | Study results demonstrate that informative explanations enhanced perceptions of mRNA booster safety, effectiveness, and willingness to vaccinate, while fostering trust in scientists across political ideologies. |
| 39320049 | United States | Study results demonstrate that rural Americans are less likely to disclose marijuana use to healthcare providers due to stigma, affecting their access to holistic medical care. |
| 39222956 | United Kingdom | Study results demonstrate that current donors and MSM exhibit higher homophily towards the prototypical UK blood donor, which is perceived as predominantly White, impacting ethnic minorities’ participation in blood donation. |
| 39194099 | Brazil | Study results demonstrate that belief in vaccine conspiracy theories negatively impacts vaccination intentions, with no significant changes in attitudes despite the pandemic, underscoring the need for enhanced health education. |
| 39148747 | United States | Study results demonstrate that state firearm acquisition patterns are influenced by gun homicide rates, strict laws, and ideologies, affecting inter-state dynamics and policies aimed at reducing firearm-related harms. |
| 39105482 | Not specified | Study results demonstrate that political ideologies like nationalism and socialism negatively impact biodiversity, while democracy positively influences protected area establishment, highlighting the need for tailored conservation policies. |
| id | country | summary |
|:---|:--------|:----------------------------------------------------------|
| 39340096 | United States | Study results demonstrate that providing scientific explanations about mRNA booster safety and effectiveness significantly improved willingness to receive the booster and enhanced trust in scientists among participants. |
| 39320049 | United States | Study results demonstrate that rural Americans are less likely to disclose marijuana use to healthcare providers due to stigma, impacting their health outcomes compared to urban residents. |
| 39222956 | United Kingdom | Study results demonstrate that ethnic minorities perceive blood donation as a White activity, influencing lower donation rates, while current donors and MSM show greater alignment with donor prototypes. |
| 39194099 | Brazil | Study results demonstrate that higher belief in vaccine conspiracy theories correlates with lower vaccination intention and knowledge, highlighting the urgent need for enhanced health education in public health strategies. |
| 39148747 | United States | Study results demonstrate that state policies reducing gun homicides impact firearm acquisition patterns across states, highlighting significant relationships between laws, crime rates, and mutual influences among U.S. states. |
| 39105482 | Not specified in the abstract. | Study results demonstrate that national political ideologies significantly influence biodiversity outcomes, with nationalism and socialism linked to threatened species, while democracy correlates with increased protected areas. |

### Parallel processing & multiple annotators

Expand Down Expand Up @@ -155,22 +156,6 @@ reticulate::use_condaenv(condaenv = env_name, conda = file.path(miniconda_path,
llm = 'meta-llama/Meta-Llama-3.1-8B-Instruct'
```

### Sequential processing

``` r
local_seq <- hollr::hollr(
model = llm,
id = pmids$pmid[1:10],
user_message = prompt[1:10],
annotators = 3,
#max_attempts = 7,
force_json = F,
flatten_json = F,
max_new_tokens = 75,
batch_size = 1
)
```

### Batch processing

``` r
Expand Down

0 comments on commit a9bb2cb

Please sign in to comment.