Pseudo-Biber Aggregator

This package aggregates the lexicogrammatical and functional features described by Biber (1985) and widely used for text-type, register, and genre classification tasks.

The scripts are not really taggers. Rather, they use either udpipe or spaCy (via spacyr) part-of-speech tagging and dependency parsing to summarize and aggregate patterns.

Because they rely on existing part-of-speech tagging, the accuracy of the resulting counts are dependent on the accuracy of tagging. Thus, texts with irregular spellings, non-normative punctuation, etc. will likely produce unreliable outputs.

Basic usage

The package provides one function, biber(), which takes either udpipe- or spacyr-tagged text and produces a data frame of features for each document.

For example,

library(spacyr)
library(pseudobibeR)

spacy_initialize(model = "en_core_web_sm")

features <- biber(
  spacy_parse(
    c("doc_1" = "The task was done by Steve"),
    dependency = TRUE,
    tag = TRUE,
    pos = TRUE
  )
)

Testing

pseudobibR uses testthat for unit testing. To avoid having to distribute spacy or updipe models for tests – as these models can be many megabytes – the tests use saved output. Specifically, in the tests/testthat/text-samples/ directory,

If you update samples.tsv, you must run parse-samples.R to get the new parsed sentences.