kazu.krt.utils¶
Functions
Create a new |
|
|
Convert an |
- kazu.krt.utils.create_new_resource_with_updated_synonyms(new_conf, new_cs, resource)[source]¶
Create a new
OntologyStringResource
with updatedSynonym
s.This function takes a
MentionConfidence
, a boolean value, and anOntologyStringResource
object as inputs. It creates a newOntologyStringResource
object with updated synonyms based on the providedMentionConfidence
and boolean values. The new_conf parameter represents the newMentionConfidence
to be set for theSynonym
s. The new_cs parameter represents whether theSynonym
s should be case sensitive or not. The resource parameter is the originalOntologyStringResource
object whoseSynonym
s are to be updated.- Parameters:
new_conf (MentionConfidence)
new_cs (bool)
resource (OntologyStringResource)
- Returns:
- Return type:
- kazu.krt.utils.resource_to_df(resource, include_behaviour=False)[source]¶
Convert an
OntologyStringResource
to aDataFrame
for display in Streamlit.This function takes an OntologyStringResource object as input and transforms it into a pandas DataFrame. The DataFrame has four columns: type, text, confidence, and case_sensitive. The type column indicates whether the synonym is “original” or “alternative”. The text column contains the synonym text. The confidence column contains the mention confidence, and the case_sensitive column indicates whether the synonym is case sensitive or not.
- Parameters:
resource (OntologyStringResource)
include_behaviour (bool) – if True, include the behaviour column in the DataFrame
- Returns:
- Return type: