Brazilian Court Documents Clustered by Similarity Together Using Natural
  Language Processing Approaches with Transformers
  Recent advances in Artificial intelligence (AI) have leveraged promising
results in solving complex problems in the area of Natural Language Processing
(NLP), being an important tool to help in the expeditious resolution of
judicial proceedings in the legal area. In this context, this work targets the
problem of detecting the degree of similarity between judicial documents that
can be achieved in the inference group, by applying six NLP techniques based on
transformers, namely BERT, GPT-2 and RoBERTa pre-trained in the Brazilian
Portuguese language and the same specialized using 210,000 legal proceedings.
Documents were pre-processed and had their content transformed into a vector
representation using these NLP techniques. Unsupervised learning was used to
cluster the lawsuits, calculating the quality of the model based on the cosine
of the distance between the elements of the group to its centroid. We noticed
that models based on transformers present better performance when compared to
previous research, highlighting the RoBERTa model specialized in the Brazilian
Portuguese language, making it possible to advance in the current state of the
art in the area of NLP applied to the legal sector.
