extract_entities {TheOpenAIR}R Documentation

Extract Entities from a Text

Description

This function takes a character string or a path to a text file and returns a tibble describing the entities found in the text. The type of entities to be searched for and extracted can be defined by the user.

Usage

extract_entities(
  text,
  entity_types = c("locations", "persons", "organizations"),
  batch_size = NULL
)

Arguments

text

A character string containing the text to be processed, or a path to a text file

entity_types

A character vector containing names of entity types to be extracted. Defaults to c("locations", "persons", "organizations").

batch_size

An integer indicating the size of each batch, if the text input is supposed to be processed in batches. Set this to NULL to process all at once.

Value

A tibble

Author(s)

Ulrich Matter umatter@protonmail.com

Examples

 ## Not run: 
extract_entities("Hello, how are you?")
extract_entities("path/to/text/file.txt",  batch_size = 100)

## End(Not run)


[Package TheOpenAIR version 0.1.0 Index]