sentence_eval: Evaluate One Sentence

View source: R/search.R

sentence_evalR Documentation

Evaluate One Sentence

Description

Assesses if one sentence matches the search query and marks positive tokens/concept unique identifiers (CUI's).

Usage

sentence_eval(
  unique_id,
  unique_sentences,
  annotations,
  query_vect,
  keyword_mask,
  keyword_elements,
  cui_mask,
  cui_elements,
  use_negation
)

Arguments

unique_id

Sentence ID, i.e. row number in annotations dataframe.

unique_sentences

Dataframe of unique sentences for the patient.

annotations

NLP annotation dataframe.

query_vect

Vector of search query components.

keyword_mask

Query vector with only keywords.

keyword_elements

Vector of search query keywords.

cui_mask

Query vector with only CUI's.

cui_elements

Vector of search query CUI's.

use_negation

Should negated items be ignored in the keyword/concept search?

Value

If sentence matches query, returns sentences with marked tokens/CUI's, otherwise NA.


simon-hans/CEDARS documentation built on Feb. 14, 2024, 3:16 a.m.