Using NLP on raw HTML from scrapers More efficient than training them directly?
I have used rudimentary scrapers for years but always found that the process of training them doesn’t scale as well as I expect. In a scenario where one needs hundreds of scrapers all grabbing the same five or 10 pieces of information (dates, names, addresses, and ID numbers) is it possible to just grab the raw HTML and train an NLP model to find the relevant data rather than selecting specific selectors/paths?
It seems to me that finding these items in an HTML doc would be a trivial task for NLP and this would allow us to forgo scraper maintenance in the event that websites change. Assuming that I already have hundreds of thousands or millions of records in structured data that could be used for training, would modern tools make this a more efficient way of ingesting data?
4 comments
[ 3.3 ms ] story [ 23.6 ms ] threadhttps://arxiv.org/abs/2210.03945
https://arxiv.org/abs/2202.00217
https://arxiv.org/abs/2201.10608
My take is that fine-tuning a language model to parse HTML shouldn't be terribly difficult but you probably do need a computer with a good GPU. The one problem that current LLMs have is that they all have a limited attention window. BERT has a 512 token window and ChatGPT has a 4096 token window, where typically a token is less than a word. There are models with much longer windows (reformer) but those don't work as well as the state-of-the-art models, at least not yet.
Practically that means you can't feed a huge HTML document into the model without splitting it up first, if you do split it up you're going to lose the ability of the model to see the document as a whole (for instance match up the <div> and </div> tags)