I am trying to find the best approach to this problem.
Consider that there is a type of text document, for instance a letter. I will refer to this as the Document Type
.
I will refer to an individual instance of a Document Type
as a Document
.
A Document
is a list of words, and includes word
, x_position
and y_position
for each word, but there will be slight variations. For example words may be slightly differently positioned, or maybe not present, or maybe extra words. This is the core of the problem.
I will use supervised learning to classify each document, resulting in data of this shape -
Training Data
document, word, x_position, y_position, classification
1, {anonymized}, 167, 198, FirstName
1, some, 454, 17, 0
1, other, 124, 279, 0
1, words, 687, 826, 0
1, {anonymized}, 946, 342, PhoneNumber
2, {anonymized}, 169, 195, FirstName
2, some, 453, 16, 0
2, different, 123, 276, 0
2, words, 689, 822, 0
2, {anonymized}, 948, 346, PhoneNumber
Of course there will be many more documents and many more words in each document.
Note that an unclassified word
has changed between documents, and the x_position
s and y_position
s have also changed slightly, as described above.
What is the best approach to use machine learning to build a model that will classify the following document, again with slightly different x_position
s and y_position
s and words
.
Test Data
James, 165, 196 -> expect classification of FirstName
similar, 452, 18
different, 121, 279
words, 689, 822
0121789456, 941, 348 -> expect classification of PhoneNumber
This is a follow on question from this question. Your thoughts and advice would be greatly appreciated.