annotate_foods: Text Mining Pipeline to Annotate Free Nutritional Text with...

View source: R/annotate_foods.R

annotate_foodsR Documentation

Text Mining Pipeline to Annotate Free Nutritional Text with FOBI


This function provides a text mining pipeline to map nutritional free text to Food-Biomarker Ontology. This pipeline is composed of five sequential layers to map food items to FOBI with the maximum accuracy as possible.


annotate_foods(foods, similarity = 0.85, reference = fobitools::foods)



A two column data frame. First column must contain the ID (should be unique) and the second column must contain food items (it can be a word or a string).


Numeric between 0 (low) and 1 (high). This value indicates the semantic similarity cutoff used at the last layer of the text mining pipeline. 1 = exact match; 0 = very poor match. Values below 0.85 are not recommended.


FOBI foods table obtained with 'parse_fobi(terms = "FOBI:0001", get = "des")'. If this value is set to NULL, the last version of FOBI will be downloaded from GitHub.


A list containing two tibble objects: annotated and unannotated food items.


Pol Castellano-Escuder


Pol Castellano-Escuder, Raúl González-Domínguez, David S Wishart, Cristina Andrés-Lacueva, Alex Sánchez-Pla, FOBI: an ontology to represent food intake data and associate it with metabolomic data, Database, Volume 2020, 2020, baaa033,


# Free text annotation in FOBI
free_text <- data.frame(id = c(101, 102, 103, 104),
                        text = c("Yesterday I ate eggs and bacon with a butter toast and black tea", 
                                 "Crisp bread and rice crackers with wholegrain", 
                                 "Beef and veal, one apple", "pizza without meat"))

pcastellanoescuder/fobitools documentation built on Feb. 17, 2024, 4:30 p.m.