## 2 Materials and Methods
### Similarity Detection
#### 2.3.1 Edit Distance  
The Levenshtein distance counts the frequency of editing operations (insert, substitute, and delete) that converts one string to the other string. The Jaro-Winkler distance accounts for the lengths of two strings and partially accounts for the type of typographical errors humans make when typing texts. The Jaro-Winkler distance (\(d_{w}\)) is calculated as:  
\[d_{w}=sim(s_{1},s_{2})+lp\{1-sim(s_{1},s_{2})\} \tag{1}\]  
where \(sim\) is the Jaro Similarity for strings, \(s_{i}\), \(l\) is the length of a maximum 4 characters long common prefix, and \(p\) is a constant scaling factor for how much the score is adjusted upwards for having common prefixes. The \(sim\) is calculated as:  
\[sim(s_{1},s_{2})=\left\{\begin{array}{cc}0&if\ m=0\\ \frac{1}{8}\left(\frac{m}{s_{1}}|+\frac{m}{|s_{2}|}+\frac{m-t}{m}\right)& otherwise\end{array}\right. \tag{2}\]  
where \(\left.\left.\left.\left.  
The CBOW is a method for predicting the current word from surrounding context words. The objective function of the CBOW model is:  
\[J=\frac{1}{V}\sum_{i=1}^{V}logp(w_{i}|w_{i-n},\dots,w_{i-1},w_{i+1},\dots,w_{i+n}) \tag{3}\]  
where \(V\) is the size of the vocabulary item, \(n\) is the window size, and \(w(t)\) denotes words.  
Skip-gram is a method for learning the sequence of neighboring words based on a word and its pattern of appearances. The objective function of the skip-gram model is:  
\[J=\frac{1}{V}\sum_{i=1}^{V}\sum_{-n\in J;i\in n,j\
eq 0}logp(w_{i+j}|w_{j}) \tag{4}\]  
With the fastText algorithm, it is possible to take character level information into account in order to capture the meaning for suffixes/prefixes expanding Word2 vec [18]. This algorithm assesses each word as a bag of character n-grams (Figure 4). There are several advantages of fastText: high training speed, applicability to large-scale corpora, and the efficiency for low-frequency words and words outside the vocabulary [19].  
The Doc2 vec creates a numeric representation of a document of a certain length in order for it to be able to situate similar documents close to one another, much like Word2 vec does. This method extends Word2 vec by inputting additional parameters that are treated as an additional context vector. The learning algorithms are a distributed memory (DM) and a distributed bag of words (DBOW). Each paragraph or post message is mapped to a  
Figure 4: Architecture of fastText; \(w_{t}\) denote “N”-gram features.  
Figure 3: Architecture of CBOW and skip-gram [6].  
unique vector using the word as the target in a DM and context words as the target in the DBOW [18]. Figure 5 shows the architecture of DM and DBOW.  
Wikipedia in Japanese (downloaded on 29 June 2018) was used as the learning data to create a distributed representation. In a Japanese document, there are no spaces between words, and spaces were inserted in the text from Wikipedia based on Japanese grammar and dictionary entries using MeCab [20] and mecab-ipadic-NEologd [21], with verb outputs as bare infinitives. Then, the Gensim package [22] in Word2 vec and the library of fastText [23] were used to create trained vectors. In the parameters of each of these algorithms, the number of dimensions of the vectors was set to 300, the number of epochs to 5, and the size of the context window to 5; loss function was hierarchical softmax and the minimum number of word occurrences was set as 1. In determining these parameters, the optimal parameters in Word2 vec and fastText were explored as follows: vectors from 200 to 1000, epochs 5 and 10, context windows from 5 to 20, and loss functions were softmax (only fastText), hierarchical softmax, and negative sampling. Other parameters were set to default. In Doc2 vec with DM and DBOW, pre-trained word vectors were downloaded from [24]. All experiments for the training models were run on a computer with the Ubuntu 18.04 operating system, Intel Core i7-9700K, and 64 GB RAM, with the Programming language Python 3.8.3.