## 3 Materials and Methods
### System Architecture
#### 3.2.1 Feature Engineering  
The process of developing input features for prediction models is described in this section. In this research, the input feature was a combination of technical indicator components and news sentiment score to create a better predictive model.  
* News Sentiment Score: In news sentiment analysis, FinBERT was used to generate the sentiment score. In order to efficiently use FinBERT for Thai news analysis, FinBERT with Thai news fine-tuning was implemented. This method trained an original FinBERT with extra data, which is Thai news in this research. According to Figure 4, there were six steps in the FinBERT with Thai news fine-tuning modeling process. The first step was to collect headlines from news sources. In this research, news sources  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Categories** & **Technical Indicators** \\ \hline Trend & Detrended Price Oscillator \\ Volume & Negative Volume Index \\ Volatility & Bollinger Bands Width \\ Trend & Simple Moving Average \\ Detrended Price Oscillator & The Stochastic RSI \\ Momentum & Price Rate of Change \\ Percentage Volume Oscillator–Histogram \\ Williams \%R \\ \hline \hline \end{tabular}
\end{table}
Table 2: Categories and names of technical indicators.  
Figure 3: An overall view of the proposed hybrid framework.  
in the financial and economic fields were collected from a total of six news agencies by using the web scraping method. After that, the acquired dataset was cleaned and text preprocessed, including text to lowercase, removal of punctuations and removing extra spaces. The next step is to manually label the news into three categories, negative and neutral. Then, the dataset is randomly divided into a training set with 80% and a testing set with 20%. The training set was used to add FinBERT supervised fine-tuning for sentiment analysis to fit a particular task in its training stage. Finally, the model was tested with the testing data set and performance measured with an F1-score and accuracy. * Technical Indicator Component: In this research, nine technical indicators are selected and used as input features of the proposed model. In the simple terms of the curse of dimensionality, the more features there are, the higher the risk of overfitting. To solve this issue, PCA is adopted to decrease the feature space along with consideration of a set of principal features. In order to create a principal component from PCA, there are steps to follow as shown in Figure 5. Firstly, the historical data was obtained from investing.com including open, high, low, close and volume data. After that, the \"ta\" package from [49] was used to generate technical indicators. Then, the technical indicators were normalized before reducing the dimensions of the data by using PCA. The result of PCA was the principal component, which in this research is done by starting from the first principal component until the sum of the explained variance ratio is greater than 80%. Therefore, this indicates that 80% of the information in the technical indicator can be explained by the \(n\)-principal component.  
Figure 4: A sentiment analysis modeling process.