nimare.annotate.cogat.CogAtLemmatizer

class CogAtLemmatizer(ontology_df=None)[source]

Bases: object

Replace synonyms and abbreviations with Cognitive Atlas identifiers in text.

Parameters:

ontology_df (pandas.DataFrame, optional) – DataFrame with three columns (id, name, alias) and one row for each alias (e.g., synonym or abbreviation) for each term in the Cognitive Atlas. If None, loads ontology file from resources folder. Default is None.

Variables:
  • ontology (pandas.DataFrame) – Ontology in DataFrame form.

  • regex (dict) – Dictionary linking aliases in ontology to regular expressions for lemmatization.

Notes

The Cognitive Atlas [1] is an ontology for describing cognitive neuroscience concepts and tasks.

References

See also

nimare.extract.download_cognitive_atlas

This function will be called automatically if ontology_df is not provided.

Methods

transform(text[, convert_uk])

Replace terms in text with unique Cognitive Atlas identifiers.

transform(text, convert_uk=True)[source]

Replace terms in text with unique Cognitive Atlas identifiers.

Parameters:
  • text (str) – Text to convert.

  • convert_uk (bool, optional) – Convert British English words in text to American English versions. Default is True.

Returns:

text – Text with Cognitive Atlas terms replaced with unique Cognitive Atlas identifiers.

Return type:

str