Skip to content

pbj_tools

Johnsd11 edited this page Apr 26, 2023 · 2 revisions

create_relation

def create_relation(cas, relation_type, category, source, target):

create_type

Create and add a Type

def create_type(cas, type_name, begin, end):

Add a type. If a known type is repeatedly added then it is faster to get the type from the type system once and call this function repeatedly with the given type.

def add_type(cas, type_type, begin, end):
def create_annotations(cas, type_name, offsets_list):

event_creator

def create_event(self, cas, dtr):
def create_event_mention(self, cas, dtr):

get_common_types

def get_annotation_at_offset(annotations, a_begins, wanted_begin):
def get_annotation_type_at_offset(annotations, a_begins, wanted_begin, wanted_type):
def get_or_create_event_mention(cas, annotations, a_begins, wanted_begin, wanted_type, end):
def get_or_create_procedure_mention(cas, annotations, a_begins, wanted_begin, wanted_type, end):
def get_or_create_sign_symptom_mention(cas, annotations, a_begins, wanted_begin, wanted_type, end):
def get_or_create_disease_disorder_mention(cas, annotations, a_begins, wanted_begin, wanted_type, end):
def get_or_create_medication_mention(cas, annotations, a_begins, wanted_begin, wanted_type, end):
def get_or_create_anatomic_mention(cas, annotations, a_begins, wanted_begin, wanted_type, end):

helper_functions

gets offsets

def get_offsets(annotations):

gets windowed offsets

def get_windowed_offsets(annotations, window_offset):

gets event mentions

def get_event_mention(cas, e_mentions, e_m_begins, begin, end):

gets covered list

def get_covered_list(to_cover_with, to_cover):

gets document ID

def get_document_id(cas):

token_tools

Gets token index by the offset

def get_token_index_by_offset(tokens, s_begin):

Gets token by offset

def get_token_by_offset(tokens, s_begin):
Clone this wiki locally