Natural Language Processing could definitely allow for some context-dependent ads within an article. When reading something on the new C# 7, I'm most likely not interested in some tupperware I decided not to buy on Amazon a couple of weeks ago, but I might be interested in a couple of books on C# and might find these ads acceptable. Don't track me, track and machine learn content people consume.
It's being done. The whole recommendation systems market/community is growing at an enormous rate.
There are a few basic types:
- new user (no cookie/session), lands on the main page: show the most popular stuff
- new user, lands on a concrete product page: item to item recommendation (others who bought this also bought this)
- user with active session: try to match to previous sessions, try to figure out what's next for this session (and optimize for time spent on site, or total cart value, or max clicks, or who knows)
And of course there are simple text based algorithms, like a full text search engine combined with scoring/ranking, and then there's the new fancy DNN stuff, and matrix factorization in between.