# Few-Shot Charge Prediction with Data Augmentation and Feature Augmentation
## 4 Experiment
### Dataset  
We used the available dataset from [9], which contains real cases for few-shot charges prediction, and the dataset has three subsets of different sizes, denoted as Criminal-S (small), Criminal-M (medium), and Criminal-L (large). Each case has a good structure, including fact description, charge, related article, and prison term. This paper chooses the fact description part of the case as input and extracts the charge label by regular expression. Since this paper explores the few-shot prediction task, and the dataset contains cases with multiple defendants and multiple charges, which increase the complexity of the charge prediction task, we filtered these multi-label cases. We kept 149 distinct charges with at least 10 cases. The detailed statistics are shown in Table 3. All datasets were divided into training set, validation set, and test set in the ratio of 8:1:1. In addition, this paper counted the statistical results of the number of distribution of charges in Criminal-S. It can be seen from the Figure 6 that the distribution of charges was extremely unbalanced. More than 50% of the charges had less than 200 training data, while there were only 10 charges with more than 2000 training data.  
The overall model was divided into two parts: data augmentation module and feature augmentation module. Tensorflow was uniformly used to build the neural network model. In the data augmentation module, in order to improve the data quality, we firstly cleaned the data and removed some invalid samples, then we discretized a large amount of information, normalizing the license plate number, mobile phone number, bank card number, and other information. The regular expression was used to extract the fact description from cases, THULAC was used for word separation, and the skip-gram algorithm of word2 vec  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Software Name** & **Parameter Description** \\ \hline Operating system & Windows 10 \\ \hline Development tool & Pycharm 2020 \\ \hline Version of Python & Python 3.6.13 \\ \hline Version of Tensorflow & Tensorflow = 1.14.0 \\ \hline Version of Numpy & Numpy = 1.16.0 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Experimental software environment.  
Figure 6: Imbalance graph of crime distribution.  
for word vector modeling: setting the vector dimension to 200, setting the maximum text length to 500, truncating if it was too long, and filling it with 0 if it was less than 500. The maximum document length was 32 sentences, words with a word frequency of less than five were regarded as unknown words, and the dimension of GRU hidden layer \(d_{w}\) was set to 256. The dropout was set to 0.5, the mixing factor \(\lambda\) was obtained from the beta distribution (\(Beta(\alpha,\alpha)\)) sampling, the parameter was \(\alpha=150\), the batch size was 64, and the learning rate was 0.01.  
In the feature augmentation module, the charge definition was also segmented, the word vector was modeled by using the skip-gram algorithm of word2 vec; the vector dimension was set to 200, the window size was set as 20, and the dropout to 0.5. All neural network models were trained by random gradient descent (SGD), and [PERSON] [41] was used as the optimizer. Iterative training was repeated during the experiment until the difference between two consecutive iterations was small enough, and the maximum epochs were 20. We employed accuracy (Acc.), macro-precision (MP), macro-recall (MR), and macro-F1 (F1) as our evaluation metrics.