nimare.annotate.cogat.extract_cogat

extract_cogat(text_df, id_df=None, text_column='abstract')[source]

Extract Cognitive Atlas terms and count instances using regular expressions.

Parameters
  • text_df ((D x 2) pandas.DataFrame) – Pandas dataframe with at least two columns: ‘id’ and the text. D = document.

  • id_df ((T x 3) pandas.DataFrame) – Cognitive Atlas ontology dataframe with at least three columns: ‘id’ (unique identifier for term), ‘alias’ (natural language expression of term), and ‘name’ (preferred name of term; currently unused). T = term.

  • text_column (str, optional) – Name of column in text_df that contains text. Default is ‘abstract’.

Returns

  • counts_df ((D x T) pandas.DataFrame) – Term counts for documents in the corpus.

  • rep_text_df ((D x 2) pandas.DataFrame) – Text DataFrame with terms replaced with their CogAt IDs.

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

Examples using nimare.annotate.cogat.extract_cogat