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
OntologyStringResourcewith updatedSynonyms.This function takes a
MentionConfidence, a boolean value, and anOntologyStringResourceobject as inputs. It creates a newOntologyStringResourceobject with updated synonyms based on the providedMentionConfidenceand boolean values. The new_conf parameter represents the newMentionConfidenceto be set for theSynonyms. The new_cs parameter represents whether theSynonyms should be case sensitive or not. The resource parameter is the originalOntologyStringResourceobject whoseSynonyms 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
OntologyStringResourceto aDataFramefor 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: