Specifically, this model is a
bert-base-cased model that was fine-tuned on a dataset consisting of 400 English Instagram posts related to food. The
dataset is open source.
1from transformers import AutoTokenizer, AutoModelForTokenClassification
2from transformers import pipeline
3
4tokenizer = AutoTokenizer.from_pretrained("Dizex/InstaFoodBERT-NER")
5model = AutoModelForTokenClassification.from_pretrained("Dizex/InstaFoodBERT-NER")
6
7pipe = pipeline("ner", model=model, tokenizer=tokenizer)
8example = "Today's meal: Fresh olive poké bowl topped with chia seeds. Very delicious!"
9
10ner_entity_results = pipe(example)
11print(ner_entity_results)