Yazılı para transferi talimatları üzerinden bilgi çıkarımı
Information extraction from written money transfer orders
Yazar: BERKE ORAL
Danışman: DOÇ. DR. GÜLŞEN ERYİĞİT
İstanbul Teknik Üniversitesi / Lisansüstü Eğitim Enstitüsü / Bilgisayar Mühendisliği Ana Bilim Dalı / Bilgisayar Mühendisliği Bilim Dalı
Derece: Yüksek Lisans, 2021
Konu: Bankacılık = Banking ; Bilgi ve Belge Yönetimi = Information and Records Management ; Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrol = Computer Engineering and Computer Science and Control

Özet:
Geleneksel bankacılık doküman işleme sürecinde bankaya faks, tarayıcı veya e-posta kanallarıyla gelen dokümanlar işlem tiplerine göre sınıflandırıldıktan sonra ilgili ekipler tarafından bilgi girişleri yapılır ve 3. bir ekip tarafından onaylanırlar. Bu akışın her bir adımında farklı bir operatörün dokümanları teker teker okunması ve sisteme gerekli bilgi girişini yapması gerekmektedir. Türkiye'de orta-büyük ölçekli bir bankaya her yıl milyonlarca doküman gönderilmektedir ve bu süreç oldukça yüksek insan gücüne ihtiyaç duymaktadır. 
Bankacılık düzenlemesi gereğince her bir işlemin ayrı kişiler tarafından kontrolünün gerekmesi ve makine öğrenmesi modellerinin yüzde yüz başarılı çalışamamaları sebebiyle sürecin tam otomasyonu mümkün değildir. Fakat insanı da içine alan, kısmen otomatikleştirilmiş bir sistem ile bilgi girişinin hızlandırılması mümkündür. Bu tezde yazılı para transferi talimatlarından talimat işlem bilgilerinin bankacılık sistemlerine girişini otomatikleştiren bir yaklaşım önerilmiştir.
Para transferi talimatları (yani elektronik fon ödemeleri, havale, yabancı para gönderimi ve ithalat ödemeleri) işlem tipleri arasında en yaygın olanlarıdır. Ayrıca çıkarılması gereken bilgilerin zenginliği sebebiyle diğer işlem tiplerine göre otomatik işlenmeleri daha zordur.
Geliştirdiğimiz bilgi çıkarımı sistemi birinci adımda doküman metni içerisindeki hesap numarası, banka adı gibi para transferi işlemlerinin alanlarına karşılık gelen varlıkları bulmaktadır. İkinci adımda ise bu varlıklar arasındaki ikili ilişkileri tahmin etmekte ve ikili ilişkilerden çizge tabanlı işlem çıkarım algoritmamızı koşarak işlemleri oluşturmaktadır. Bu bilgi çıkarımı sistemindeki varlık çıkarım ve ilişki çıkarım modellerimiz derin öğrenme mimarilerine sahiptirler. Modellerimizde FastText, ELMo ve BERT kelime temsil yöntemleri denenmiştir.
Dokümanın görsel kompozisyonuna ait öznitelikler modellere farklı yöntemler kullanılarak beslenmiştir. Pozisyonel Koordinat, Kafes Temsili, Kompozisyon Temsili ve GCN yöntemleri denenen yöntemlerdir. Farklı yöntemlerin farklı tiplerdeki dokümanlarda daha başarılı oldukları gözlemlense de ortalamada Kafes Temsili yönteminin daha başarılı olduğu görülmüştür. Çok kipli varlık ismi çıkarımı ve varlık ilişki çıkarımı algoritmalarımız CRF ve bağlılık ayrıştırıcısı tabanlı yöntemlere kıyasla sırasıyla 9.4 ve 11.1 yüzde puanı artış sağlamıştır. Algoritmalarımız, uçtan uca başarımında temel varlık ismi çıkarımı ve varlık ilişki çıkarımı yöntemlerini kullanan sisteme kıyasla daha çok işlemi daha doğru çıkartabilmiştir. 
Bilgi çıkarımı sistemimiz, bu tezin konusu olmayan doküman sınıflandırma ve çeşitli ön işleme ve rötuş adımlarıyla birlikte gerçek bankacılık doküman işleme sistemine entegrasyonu yapılmıştır. Otomatikleşmeyle birlikte havale dokümanlarının bankaya ulaşmalarından muhasebeleşmelerine kadar geçen süre 29 dakikadan 10 dakikaya düşmüş, elektronik fon ödemesi dokümanlarında ise 41 dakika olan bu süre 17 dakikaya düşmüştür.

Abstract:
With the digitalization of the banking field, customers now can perform most of their operations through electronic channels (e.g. mobile applications, internet banking, ATMs). Although a significant portion of the retail banking customers started to use the digital channels, corporate banking customers are still using written orders to reach banks. Nowadays, a mid-to-large scale bank in Turkey annually receives millions of written orders, each of which needs to undergo a laborious process. These documents arrive at the bank via fax, scanner, and email channels in image formats. In the traditional banking document processing flow, the first operator to open these documents classifies them by transaction types (e.g. EFT, insurance payment, tax payment) and forwards them to a unit that specializes in such transactions. The second operator reads the documents and enters the transactions into the banking system. To ensure the correctness of the inputted information, a third operator reads the documents again and makes the necessary checks. Later security checks are also performed to ensure the identity (e.g. signature control) and authority of the customer. Only after all these steps transactions can be executed.
Full automation of this process is not possible due to banking regulations and errors that machine learning algorithms might make. However, a system can be designed to automate labor-intensive classification and data inputting stages. The automated system uses human operators to control the correctness of the automatically extracted transaction information. Errornomously extracted transactions (e.g. OCR errors or missed fields) can be corrected by operators and sent to the stage of approval. If the extracted transaction information is correct, it can be executed with an approve button which minimizes the required manual effort. The automation of this pipeline requires an OCR system to extract text within images, a classification algorithm to determine process types of documents, and an Information Extraction system that is specific to the process type's transaction. In this thesis, we propose an Information Extraction system that automates the data input stage in this pipeline. Specifically, we focused on money transfer order documents (i.e. EFTs, book-to-book money transfers, foreign money transfers, and import payments) which contain their transaction information usually in free-text. 
Money transfer documents are the most frequent process types and they make up 53.5\% of all process types.  They are also one of the hardest process types to automatically process. To successfully extract transactions, one needs to fill slots (e.g. account number, bank name, etc.) of sender and receiver and as well as details of the transactions (e.g. amount, currency). We focus on free-formated documents where transaction information is stated in natural language which is usually in Turkish. Customers usually state entities that correspond to a transaction's slots in different places of a document. Furthermore, each document can contain multiple transactions where transactions can share some of their slots.  For instance, information regarding transaction expenses is usually stated once and used for different transactions in a document. Customers also usually state entities multiple times that correspond to the same slot. For example, the sender's name is usually written multiple times (document header, above signature, main text, etc.) within documents.
Overall, the transactions make document level, nested, n-ary structures. To parse such complex structures, our information extraction system first uses a NER algorithm to detect entities of interest (e.g. account numbers, IBANs, amounts), then predicts binary relations between each entity pair. Those predicted entities and relations are represented in a graph where each node is an entity and each edge is the relation. Lastly, a transaction extraction algorithm uses a series of maximum clique factorization operations on this graph to parse transactions. 
To predict named entities and binary relations we use deep learning based models. In each model, we represent words by either their FastText, ELMo, or BERT embeddings. We also use the character BiLSTM layer to further encode task-specific representations of words in our FastText and ELMo models. In our NER model, we use BiLSTM-CRF architecture to predict named entities. In our binary relation extraction algorithm, we further enrich word representations by their entity embeddings. We used BiLSTM based layer to obtain contextualized entity representations. To predict relations,  we concatenate pairs of entity representations and use an MLP layer to make predictions.
The banking order documents contain many visual clues that would be missed with textual analysis alone. They are written in a letter headed documents, contain logos, signatures, stamps, and footer bars. For example, sender's name is often stated above signature or inside stamps. Sometimes customers list account numbers in footer section which are unrelated to transactions on a document. To parse documents' visual informatPositionalsigned and experimented with five methods. Our Pozitional Coordinates (\textit{Pozisyonel Koordinatlar}) method simply uses word bounding boxes' relative coordinates and dimensions. In our Grid Embeddings (\textit{Kafes Temsili}) approach we divide documents into horizontal and vertical equal sized rectangles and learn an embedding for each rectangle. For words' visual representation we use the concatenation of corresponding rectangles. Our Grid CNN approach (\textit{Kafes CNN}) use CNN based approach which inputs an image of a document. CNN layers lower the width and height of the input tensor while encoding its visual features. Words' representations are selected from output tensor, similar to the Grid Embeddings approach. In our last two approaches, we use a layout analysis algorithm. Layout Embedding (\textit{Kompozisyon Temsili}) approach embeds words' paragraph box and line box number. Our GCN approach creates representation for each paragraph box and encodes them with a graph convolution network. In our experiments, we found that all of the approaches benefited our models. On average, Grid Embeddings performed better than others. We also observed that on certain types of documents and training situations Layout Embeddings and GCN approaches were better than others. 
We also experimented with the use of auxiliary tasks for model training. By jointly learning to predict documents' process type and named entities, we achieve a performance increase in some fields up to 3 percentage points. On the binary relation extraction model, the use of an auxiliary task that predicts whether a document contains multiple transactions allowed us to achieve minor improvements on the number of correctly extracted transactions. 
To train our models we labeled about 3500 documents and selected 600 of these as our test. Our named entity recognition model is tested against a CRF baseline. We achieved 9.4 percentage points of improvement in the CoNLL macro F1 score. Our best transaction extraction algorithm is tested against rule-based and transition-based models. Against better performing transition-based model 11.1 percentage points improvements are achieved in macro F1 score. Our information extraction system can extract transactions more correctly. Against CRF and rule-based baseline, our deep learning models increase transaction extraction precision on book-to-book money transfer transactions by 5, EFTs 2, and import payments 13 percentage points. 
Alongside document classification and various post-processing algorithms (which are not part of this thesis), our information extraction system is deployed in a real banking document processing system. Substantial gains are achieved in terms of manpower gains. Before the automation, cycle times (i.e. time between the document arrival and execution of its transactions) were 29 minutes for book-to-book money transfer documents and 41 minutes for EFTs. After the automation, we monitored the system for 6 months. In total, around 500k book-to-book money transfer documents and ~300k EFTs documents were processed by our system with average cycle times of 10 and 17 minutes respectively.