create_session: Create a Session starting from an annotation data set.

create_sessionR Documentation

Create a Session starting from an annotation data set.

Description

A session is identified by the subsequent iteration of automatic labelling and manual review. It is associated with a folder where the original annotation file (with the initial manual classification) is stored, plus its updates after each classification iteration and supplemental files containing the Document Term Matrix (DTM), a summary of each classification iteration and the posterior samples of the Bayesian predictions.

Usage

create_session(
  Records,
  session_name,
  sessions_folder = getOption("baysren.sessions_folder", "Sessions"),
  DTM = NULL,
  dup_session_action = c("skip", "stop", "silent", "add", "replace"),
  use_time_stamp = TRUE
)

Arguments

Records

An annotation data frame.

session_name

A character string to label the session. Usually is Session followed by a number, without white spaces.

sessions_folder

The path to the folder where all sessions are stored.

DTM

An already existing DTM matrix (see create_training_set() and text_to_DTM().

dup_session_action

What to do if a session with the same name already exists. the options are: skip (if the session exists do nothing but raise a warning), stop (raise an error), silent (like skip but without warnings), add (create a new session marking that is a replicate of an existing one), replace (overwrite the existing session).

use_time_stamp

Add a times tamp to the original annotation file name.

Value

The path to the created session folder.

Examples

## Not run: 
journal <- perform_search_session(
  query = query, year_query = year_filter,
  session_name = "Session1", query_name = "Query1",
  records_folder = "Records",
  journal = "Session_journal.csv"
)

record_files <- extract_source_file_paths(journal)

Annotation_data <- create_annotation_file(record_files)

create_session(Annotation_data)

## End(Not run)

bakaburg1/BaySREn documentation built on March 30, 2022, 12:16 a.m.