nimare.annotate.cogat.CogAtLemmatizer

class CogAtLemmatizer(ontology_df=None)[source]

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.

Variables
  • ontology_ (pandas.DataFrame) – Ontology in DataFrame form.

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

References

  • Poldrack, Russell A., et al. “The cognitive atlas: toward a knowledge foundation for cognitive neuroscience.” Frontiers in neuroinformatics 5 (2011): 17. https://doi.org/10.3389/fninf.2011.00017

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 (str) – Text with Cognitive Atlas terms replaced with unique Cognitive Atlas identifiers.