I have a list of bank statements. They look pretty much like this:
- Received transaction. Reason[separator] invoice from [date][separator][number]. Counterparty[separator] [company name]
- Payment to another bank [IBAN]/[company name] inv. [invoice number(s)]
- Payment of taxes
- Received payment on [invoice numbers][separator][dates]
I need to be able to extract key information from these statements, such as invoice numbers, or counterparty. Separators may vary or may not exist at all. Counterparty names will be different, so I want to be able to recognize that this part of the text is counterparty or at least cluster them all together and then I will name the clusters. Is it possible at all to perform some clustering on each line and then another one that will group the extracted groups? For example, groups of invoices, groups of dates, and so on. Or maybe I need to unite all lines and then cluster but in this case, sometimes I may need 2-3 words if the counterparty name is longer or one string (for example invoice number).
Any advice on what to look for - algorithms, papers, or some similar examples?