# RTACompensator: Leveraging AraBERT and XGBoost for Automated Road Accident Compensation
## 2 Background
* \(Min\_wage\) is the minimum wage derived from the table attached to the Dahir (Figure 3), expressed in Moroccan Dirhams (MAD). * _Coeificient (i)_ could be 2 or 1.5, according to the right holder (i). \begin{table}
\begin{tabular}{p{142.3 pt} p{284.5 pt}} \hline \hline
**Damage** & **Disability Percentage (\%)** \\ \hline Permanent physical disability & Damage that obliges the victim to constantly rely on the help of another person to accomplish the ordinary acts of life. The associated disability percentage is 50\%. \\ \hline Physical pain & 10\%: if the physical pain is very important 7\%: if the physical pain is important 5\%: if the physical pain is quite important \\ \hline Congenital mutilation & - If the damage does not have bad effects on the victim’s career: 15\% if it is categorized as very important, 10\% if important, and 5\% if quite important. - If the damage has bad effects on the victim’s career: 35\% if it is categorized as very important, 30\% if important, and 25\% if quite important. \\ \hline Permanent physical incapacity & - For working individuals, if the victim faces accelerated retirement, the disability percentage is 20\%. It is 15\% if the victim loses promotion eligibility and 10\% if the victim is denied additional professional work. - For students, if the victim faces permanent suspension of studies, the disability percentage is 25\%, and if the victim faces semi-permanent suspension of studies, the percentage is 15\%. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Percentages of disability associated with each type of damage. Next, the judge calculates material compensation for each right holder using Equation (3). This amount is determined by multiplying the reference capital by a percentage specified in Article 11 of the law, as detailed in Table 2.  
\[Material\_Comp(i)=Ref\_Cap*Percentage(i) \tag{3}\]  
where the following are used:  
* _Material_Comp(i)_ is the material compensation for the right holder (i), expressed in Moroccan Dirhams (MAD). * _Ref_Cap_ is the reference capital, expressed in Moroccan Dirhams (MAD). * _Percentage (i)_ is derived from Table 2.  
Finally, the total initial compensation is calculated as the sum of both moral and material compensation, as represented in Equation (4). \[IC=\sum_{i=1}^{I}Moral\_Comp(i)+Material\_Comp(i) \tag{4}\]  
where the following are used:  
* \(IC\) is the initial compensation, expressed in Moroccan Dirhams (MAD). * \(I\) is the number of rights holders. Figure 4: The process of calculating initial compensation for rights holders in the event of the victim’s death. Step 4 of the process involves determining the part of responsibility, which quantifies the degree of fault attributed to the other party in causing the accident. For instance, running a red light results in full responsibility (1/1). The Moroccan legislator has established specific rates, such as 1/1, 3/4, 2/3, 1/2, 1/3, 1/4, and 1/5. Judges assign the appropriate rate based on the traffic accident report completed by the police. Each rate represents the proportion of fault assigned to the party, with the remainder (1 - rate) assigned to the victim. The final compensation is then calculated by multiplying the initial compensation by the applicable part of responsibility. Additional medical expenses, such as medications, tests, and surgeries, are then added to determine the total amount. This is illustrated in Equation (5):  
\[FC=(IC*Part\_Res)+Expenses \tag{5}\]  
where the following are used:  
* \(FC\) is the final compensation, expressed in Moroccan Dirhams (MAD). * \(IC\) is the initial compensation, expressed in Moroccan Dirhams (MAD). * \(Part\_Res\) is the part of responsibility. * _Expenses_ are medical expenses (medications, tests, surgeries) (all expressed in Moroccan Dirhams (MAD)). Once finalized, the judge will set a hearing session for the verdict.