I'm a bit new to AI and I'd like to use some kind of clustering algorithm to solve a problem:
I'm trying to parse pdf documents to get headings and titles. I can parse pdf to html and I'm then able to get some information on the lines of the document. I've identified some properties that can be useful for identifying the headings.
- font-size (int): of course it's quite usual that heading's font-size is bigger than normal text
- font-family (string): it's possible for headings to be bold so font-family may differ
- left property (int): it's also possible that headings are aligned a bit to the right, there's an indentation that's not always there on normal paragraphs
- bonus boolean: I have identified some properties that I can combine to get a boolean value. When the boolean is set to true it can increase the chances of the paragraph being a heading.
Of course, these are not rules that apply to all headings. Some headings may follow some of these but not all of them. It could also be possible that some 'normal' paragraphs follow all these points, but what I've seen is that, in general, those rules where what made headings different from paragraphs.
With this information, is there a way of doing what I'm looking for? As I said, I'm new to AI even though I have a background in CS and mathematics. I thought clustering could be interesting since I'm trying to create 2 clusters: headings and normal paragraphs.
What algorithm do you think might work for this use case. Should I look outside clustering?