## 2 Materials and Methods
### Proposed Model
#### 2.5.3 Neural Network  
The neural architecture chosen is the LSTM. Given its characteristics, it is especially suitable for handling text sequences with long-term dependencies. The model is trained using a cross-entropy loss function and optimized with the Adam algorithm [30]. The learning rate is initially set to 0.001 and is reduced if the model does not improve its performance on the validation set after several epochs. An important aspect of this process is the selection of the optimization algorithm, where we have specifically chosen to use the Adam algorithm. This decision is based on several advantages Adam offers compared to other optimizers. First, Adam is known for his high computational efficiency, essential for handling the large and complex data sets used in our study. Its ability to maintain an adaptive learning step size for each parameter facilitates faster and more effective model tuning during training. Furthermore, the data set presents various linguistic variations and sparse structures. The Adam algorithm is particularly efficient in handling such data thanks to its moment updating mechanisms, ensuring more stable convergence, and avoiding extreme fluctuations that can occur with other optimizers. Another important factor in choosing [PERSON] is his ability to tune the model parameters effectively. This is crucial in our case, as we seek an optimal balance between precision and generalization. Adam facilitates finer tuning of parameters, thereby improving the model's accuracy and generalizability. Stability during training is another distinctive advantage of Adam. Even in scenarios where the error gradient can vary abruptly, [PERSON] maintains consistent performance, which is vital to the effectiveness of our chatbot model. The effectiveness of Adam has been widely demonstrated in various studies and applications in the field of NLP. Its ability to effectively handle the challenges associated with NLP models has been validated in the reviewed literature [31], reinforcing our decision to use this optimizer in our study. Table 3 details the architecture of an LSTM. The model is trained using a cross-entropy loss function and optimized with the Adam algorithm. The learning rate starts at 0.001, adjusting based on performance on the validation set. The LSTM architecture begins with an input layer of 500 neurons, followed by two LSTM layers. The first has 256 neurons (Tanh activation), and the second has 128 neurons (Tanh activation). The output layer is revised to have two neurons with the SoftMax activation function, aligning with the binary classification task. This deep structure captures complex data patterns, with possible layer adjustments based on task complexity and data volume. The choice of 128 units for the LSTM layers was based on a series of performance tests and validations. Initially, we experimented with different drive sizes, ranging from 64 to 256. These tests evaluated how each configuration affected the model's accuracy, loss, and generalization ability. We found that 128 units offered an optimal balance between computational complexity and model performance. With less than 128 units, the model tended to underfit, while with more than 128 units, we did not observe significant performance improvements that would justify the increase in computational requirements. The selection process was part of a broader hyperparameter optimization process. Cross-validation and grid search were used to evaluate various configurations systematically. Additionally, metrics such as validation loss and training time were considered to \begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer** & **Number of Neurons** & **Activation Function** \\ \hline Entrance & 500 & - \\ LSTM 1 & 256 & Tanh \\ LSTM 2 & 128 & Tanh \\ Exit & 10 & Softmax \\ \hline \hline \end{tabular}
\end{table} 
Table 3: LSTM architecture was used for the proposed model. ensure that the chosen configuration was practical from a model performance point of view and efficient in computational resource usage.