-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
62 lines (44 loc) · 1.8 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# uwebasr2
<!-- badges: start -->
<!-- badges: end -->
The goal of uwebasr2 is to provide access to [UWebASR](https://lindat.mff.cuni.cz/services/uwebasr/) API for audio transcription of Czech and Slovak audio files.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("skvrnami/uwebasr2")
```
## Usage
```{r example}
library(uwebasr2)
```
The library contains two functions that provide access to UWebASR API: `uwebasr_post` and `uwebasr_get`.
Both of the functions have similar parameters:
- `lang_model` - Language model that is to be used for speech transcription. The available
models are `CZ` for Czech language model and `SK` for Slovak language model.
- `file_path` (in the case of `uwebasr_post`) / `audio_url` (in the case of `uwebasr_get`) - path or URL to the audio.
- `format` - Format of the output. Available formats include: `plaintext` (default option) and `json`.
The API also accepts formats `trs`, `extended_trs` and `webvtt`, but the working of the package is not tested for using these formats.
The `uwebasr_post` uploads file from local filesystem to the API and returns the transcription.
```{r}
download.file("http://skvrnami.github.io/uwebasr/babis_dopis.mp3", "babis_dopis.mp3")
babis_dopis <- uwebasr_post(lang_model = "CZ", "babis_dopis.mp3")
cat(babis_dopis)
```
```{r, eval=FALSE}
# Doesn't work for some reason
grospic_intro <- uwebasr_get("CZ", "http://skvrnami.github.io/uwebasr/grospic.mp3", "plaintext")
cat(grospic_intro)
```