Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jbgruber/whisprrr


https://github.com/jbgruber/whisprrr

Last synced: 30 days ago
JSON representation

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# whisprrr

`whisprrr` is just a minimal wrapper for the Python package [Whisper](https://github.com/openai/whisper) by OpenAI:

> Whisper is a general-purpose speech recognition model. It is trained on a large dataset of diverse audio and is also a multitasking model that can perform multilingual speech recognition, speech translation, and language identification.

Besides making it possible to transcribe audio to text, the purpose of this repository is also to have a minimal R wrapper for a Python package.

## Installation

You can install the development version of whisprrr from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("JBGruber/whisprrr")
```

Then use `install_whisper` to set up the required Python environment (and install Python if necessary):

```r
install_whisper()
```

The process should be fully automatic/guided.
By default, the environment is set up as r-whisper" in the folder returned by `reticulate::virtualenv_root()`.
If you want to change that, the best way is to set RETICULATE_PYTHON_ENV before running `install_whisper()`:

```r
Sys.setenv(RETICULATE_PYTHON_ENV = "my-env")
```

Note that you have to set this environment variable in every new session or put it into your .Renviron file(e.g., with `usethis::edit_r_environ()`).

## Example

This is a basic example which shows you how to solve a common problem:

```{r example}
library(whisprrr)
download.file("https://github.com/openai/whisper/raw/main/tests/jfk.flac", "jfk.flac")
transcript_df <- transcribe("jfk.flac")
transcript_df
transcript_df$text
```

# Alternatives

- [audio.whisper](https://github.com/bnosac/audio.whisper)