Learn R Programming

vocaldia

This package contains functions that create and manipulate vocalisation diagrams. Vocalisation diagrams date back to early work in psychiatry (Jaffe and Feldstein, 1970) and social psychology (Dabbs and Ruback, 1987) but have only recently been employed as a data representation method for machine learning (Luz, 2013; Luz and Kane, 2009).

This provides a number of functions for generating vocalisation diagrams (vocaldias) from data frames containing, minimally, a column for start time of a vocalisation event (speech, silence, group-talk etc), a column for end time, and a column for the event identifier. It also contains some basic functions for reading and processing files from DementiaBank (.cha transcripts and audio files).

Functions getSampledVocalMatrix and getTurnTakingProbMatrix generate alternative versions of adjacency matrices for vocaldias. staticMatrix generates steady state diagrams from a vocaldia. printARFFfile generates a 'flat' representation of vocaldias for classifier training and evaluation.

Installation

You can install the released version of vocaldia from CRAN with:

install.packages("vocaldia")

Example

The following examples illustrate the use of vocaldia to create and visualise vocalisation graphs and their properties.

library(vocaldia)
## load some data
data(vocdia)

## select a dialogue
x <- subset(atddia, id=='Abbott_Maddock_01')

## show a probability matrix 
getTurnTakingProbMatrix(x)

## if you have igraph installed, visualise a vocal matrix
require('igraph')
subset(atddia, id=='Abbott_Maddock_01') %>% 
    getSampledVocalMatrix(individual=TRUE, nodecolumn='speaker') 
    %>% igraph.vocaldia %>% plot

## plot steady state of the Markov diagram
plot(staticMatrix(vocmatrix$ttarray, digits=4, history=TRUE))

See the following publication for further examples of use of this package:

Luz S, De La Fuente Garcia S, Albert P. A Method for Analysis of Patient Speech in Dialogue for Dementia Detection. In Resources and ProcessIng of linguistic, para-linguistic and extra-linguistic Data from people with various forms of cognitive impairment. Paris, France: ELRA. 2018. p. 35-42 (https://arxiv.org/abs/1811.09919)

Copy Link

Version

Install

install.packages('vocaldia')

Monthly Downloads

183

Version

0.8.4

License

GPL-3

Maintainer

Saturnino Luz

Last Published

August 14th, 2022

Functions in vocaldia (0.8.4)

getSampledVocalMatrix

getSampledVocalCountMatrix: generate vocalisation diagrams
plot.matrixseries

plotConvergence: plots Markov diagram convergence.
getSyllablesAndSilences

getSyllablesAndSilences: process Praat's grid for syllable nuclei
getSilences

getSilences read silences file
plot.vocaldia

plot.vocaldia
identifyPauses

identifyPauses: label pauses according to type.
read.cha

read.cha read CHA transcription file (format used by DementiaBank)
identifyGrpVocalisations

identifyGrpVocalisations: replace appropriate vocalisation types
printARFFfile

printARFFfile: Create arff files by creating and flattening vocaldias
vocmatrix

A sample vocalisation matrix
write.vocaldia

write.vocaldia
identifyVocalisations

identifyVocalisations: replace appropriate vocalisation types
startmatrix

startmatrix: return the first matrix of a converging series.
getTurnTakingMatrix

getSampledVocalCountMatrix: generate vocalisation diagrams
getTranscript

getTranscript: get transcription lines from .cha content
igraph.vocaldia

igraph.vocaldia: Create an igraph vocalisation diagram
makeVocalStatsDataset

makeVocalStatsDataset: create a dataset of vocalisation statistics (1 row per patient)
makeSessionDataSet

makeSessionDataSet: create a data frame for a session (e.g. cookie scene description) based on .cha transcription files
toDotNotation

toDotNotation: conver vocaldia to graphviz dot notation
staticMatrix

staticMatrix Iterate until transition probabilities converge (or give up).
vocaldia-package

vocaldia: Create and Manipulate Vocalisation Diagrams
namePauses

namePauses: name pause types.
getTurnTakingProbMatrix

getTurnTakingProbMatrix: create a vocaldia from a data.frame.
getTurnType

getTurnType: return type of turn
matrixExp

matrixExp: raise matrix to exp.
getIDs

getIDs get speaker role IDs (PAR, INV) and info from CHA content
getPID

getIDs get study-wide unique patient IDs from CHA content
anonymise

anonymise: anonymise a vocalisation diagram
appendSpeechRate

appendSpeechRate: append pre-generated speech rate data to given dataframe t
atddia

A sample Medical Team Meeting dialogue encoded as a vocaldia
getSampledVocalCountMatrix

getSampledVocalCountMatrix: generate vocalisation diagrams
getPauseType

getPauseType: name pause type between two vocalisation events.
getEntropy

getEntropy: safely return the Shannon entropy of a distribution.
getPofAgivenB

getPofAgivenB: transtion probability.