blob: d657904ff2687653abbb9eb95e31e94597649021 [file] [log] [blame]
---
title: "IDS theme for revealjs"
subtitle: "a demo"
author:
- name: Marc Kupietz
- name: John Doe
institute: "IDS Mannheim"
date: "`r paste0('Mannheim, ', Sys.Date())`"
website: "https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/revealjs"
partner_logo: "logos/clarin-logo.svg"
funder_logo: "logos/text-plus-logo.svg"
output:
revealjs.ids::revealjs_presentation:
reveal_plugins:
- search
- zoom
- notes
- menu
reveal_options:
chalkboard:
theme: chalkboard
toggleNotesButton: true
menu:
numbers: true
lang: en
bibliography: references.bib
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
library(idsThemeR)
library(RKorAPClient)
library(highcharter)
library(tidyverse)
library(DT)
#source("https://gitlab.ids-mannheim.de/ICC/2023-07-20-ICC-ICLC10/-/raw/master/R/common.R")
```
# Introduction
## R Markdown
This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown [@R-rmarkdown] see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
## Slide with Bullets
### Subheading
- Bullet 1
- Bullet 2
- Second-level bullet
- Second-level bullet
- Third-level bullet
- Third-level bullet
- Bullet 3
<aside class="notes">
Here are some notes.
</aside>
# Methods
## Slide with R Output
```{r cars, echo = TRUE}
summary(cars)
```
## Slide with Plot
```{r pressure, fig.height=5, fig.width=12, message=F, warning=F}
plot(pressure)
```
# Results
## Registered Users
### for COSMAS II and KorAP
```{r registrations, message=F, warning=F}
registrierungen <-
read_tsv("http://www.ids-mannheim.de/cosmas2/projekt/intstats/registrierungen.csv") %>%
add_column(group = "registered users")
hc <- registrierungen %>%
hchart("line", hcaes(x = date, y = registered, group = group)) %>%
hc_add_theme(hc_theme_ids_light()) %>%
hc_yAxis(title = list(text = "")) %>%
hc_xAxis(title = list(text = "")) %>%
hc_legend(element_blank()) %>%
hc_size(height = 500, width = 1160)
hc
```
## Adjective Collocates
### of *Sockenpuppe* in the German Wikipedia Talk Corpus [@kupietz_wikipedia_talk_2026]
```{r ca, message=F, warning=F, escape=F}
library(RKorAPClient)
KorAPConnection("https://korap.ids-mannheim.de/instance/wiki", verbose=F) |>
collocationAnalysis(
"focus([spacy/u=ADJ] {[spacy/l=Sockenpuppe]})",
leftContextSize = 1,
rightContextSize = 0,
cacheAs = "sockenpuppe_aca.rds"
) |>
mutate(collocate = sprintf("[%s](%s)", collocate, webUIRequestUrl),
across(where(is.numeric), ~ round(.x, 2))) |>
select(collocate, logDice, pmi, ll) |>
head(8)
```
## Complete Source Code
### of the previous slide's collocation analysis
```R
library(RKorAPClient)
KorAPConnection("https://korap.ids-mannheim.de/instance/wiki", verbose=F) |>
collocationAnalysis(
"focus([spacy/u=ADJ] {[spacy/l=Sockenpuppe]})",
leftContextSize = 1,
rightContextSize = 0,
cacheAs = "sockenpuppe_aca.rds"
) |>
mutate(collocate = sprintf("[%s](%s)", collocate, webUIRequestUrl),
across(where(is.numeric), ~ round(.x, 2))) |>
select(collocate, logDice, pmi, ll) |>
head(8)
```
<small>Using RKorAPClient [@kupietz_rkorapclient_2020;@kupietz_building_2022]</small>
## Adjective Collocates (DataTable)
### of *Sockenpuppe* in the German Wikipedia Talk Corpus [@kupietz_wikipedia_talk_2026]
```{r cadt, message=F, warning=F, escape=F}
library(RKorAPClient)
KorAPConnection("https://korap.ids-mannheim.de/instance/wiki", verbose=F) |>
collocationAnalysis(
"focus([spacy/u=ADJ] {[spacy/l=Sockenpuppe]})",
leftContextSize = 1,
rightContextSize = 0,
cacheAs = "sockenpuppe_aca.rds"
) |>
head(8) |>
mutate(Collocate=sprintf('<a href="%s">%s</a>', webUIRequestUrl, collocate)) |>
select(Collocate, logDice, pmi, ll) |>
datatable(escape=F) |>
formatRound(columns=~logDice + pmi + ll, digits=2)
```
## Source Code
### Display Collocation Analysis Result as DataTable
```R
library(RKorAPClient)
KorAPConnection("https://korap.ids-mannheim.de/instance/wiki", verbose=F) |>
collocationAnalysis(
"focus([spacy/u=ADJ] {[spacy/l=Sockenpuppe]})",
leftContextSize = 1,
rightContextSize = 0,
cacheAs = "sockenpuppe_aca.rds"
) |>
head(8) |>
mutate(Collocate=sprintf('<a href="%s">%s</a>', webUIRequestUrl, collocate)) |>
select(Collocate, logDice, pmi, ll) |>
datatable(escape=F) |>
formatRound(columns=~logDice + pmi + ll, digits=2)
```
# References
## References