## 3 Proposed Methods
### Recurrent Network-Based Ensemble Method (RNE)  
The wisdom of the crowd posits that collective knowledge is better than knowledge of the few [58]. Drawing upon this, the objective of the ensemble method is to improve the prediction performance by combining the results of multiple models. An ensemble approach uses a set of model predictions from the first-level classifiers as inputs for the second-level learning model. The second-level model is trained to optimally combine the first-level classifiers' predictions to produce the final prediction. In this way, ensemble learning can turn a set of weak classifiers into a statistically strong classifier [22]. In various situations, the ensemble method has been shown to show more accurate predictions over single models. When the models return different results, the potential for performance improvement is more considerable when using an ensemble method [59].  
In this paper, we designed a named-entity recognition model, namely the recurrent network-based ensemble (RNE) method to extract ingredient entities and their attributes from recipe text. RNE built based on an ensemble-learning framework consists of recurrent network models such as RNN, GRU, and LSTM. These models are trained independently on the same dataset and combined to produce better predictions in extracting food entities such as ingredient names, products, units, quantities, and states for each ingredient in a recipe. The overall architecture of this model is shown in Figure 8.  
The input data to RNE is the named-entity dataset we created in Section 3.1, namely the FINER dataset. This dataset contains 11 tags in the IOB2 tagging scheme shown in Table 4. The dataset consists of 181,970 sentences and is divided into 80:20 percentage portions for training and testing. In the first layer, we retrieved the contextual meaning of words using pre-trained GloVe [60] word embeddings. In this layer, the pre-trained word embedding is used to map each word (\(\mathbf{w}_{1},~{}\mathbf{w}_{2},~{}\ldots~{}\mathbf{w}_{n}\)) in the sentence \(\mathbf{X}\) to a word vector. Next, in the second layer, we train three base classifiers independently on the same dataset using the Adam optimizer and cross-entropy loss function so that the loss function converges to a better local minimum. In this study, we use three bidirectional deep learning models, namely Bi-RNN, Bi-GRU, and Bi-LSTM, as the base classifiers. Each model produces an output prediction represented as \(\mathbf{P}_{1}\), \(\mathbf{P}_{2}\), and \(\mathbf{P}_{3}\). Next, in the combiner layer, we concatenate the three different predictions and obtain the final prediction \(\mathbf{Y}\), as shown in Figure 9. Specifically, we draw the final predicted label \(\mathbf{Y}\) through \(\mathbf{Y}=\mathbf{\mathcal{F}}([\mathbf{P}_{1}~{}\circ~{}\mathbf{P}_{2}~{}\circ~{}\mathbf{P}_{3}])\), with \(\circ\) denoting the concatenation operator and \(\mathbf{\mathcal{F}}:\mathbb{R}^{(D\times 3)}\rightarrow\mathbb{R}^{K}\) denoting a linear layer without any non-linear activation function. Note that we indicate \(D\) as the output dimension from each recurrent model and \(K\) as the number of classes that shall be predicted by the ensemble model. In practice, we set \(D\) equal to \(K\), and in this way we impose each recurrent model to predict the named entities while aggregating each prediction through this ensemble layer to obtain a more precise prediction. Figure 9 illustrates an output of NER sentence. All the implementation details for the experiments we carried out in this study are described in the experimental setup in the following subsection.  
Figure 7: GRU unit architecture.