Study on the named entity recognition method implementation for food safety

In order to improve the relevance and efficiency of food safety supervision, a food safety knowledge database and a named entity recognition (NER) model that can extract food safety entities such as poison, disease, and symptom has been constructed. First, the key content of ‘‘Food Safety Accident Determination and Prevention Control’’ was identified, and 8265 valid statements were obtained. It then used data cleaning and sequence marking to obtain the dataset, dividing the dataset into training, validation and test sets in the ratio of 8:1:1. The Chinese food-safety domain NER model was constructed by introducing a bidirectional encoder representation from transformers (BERT) as a vector embedding model based on a bi-directional long short-term memory (BiLSTM) combined with a conditional random field (CRF). The BERT-BiLSTM-CRF model achieved 96.96% accuracy, 83.87% precision, 87.14% recall and an F1 value of 85.48, with low model error and high accuracy, and successfully extracted eight types of entities: poison, disease, host, category, source, symptom, disinfection method and drug. The NER model for food safety based on the BERT-BiLSTM-CRF has high accuracy and can establish an exclusive knowledge base for food safety, which helps improve food safety supervision efficiency.