By JIM KERSTETTER

There was a time when IBM was a monopolistic giant that looked indestructible. And there was a time when Microsoft looked like the tech company that could never be beaten.

Today, a handful of companies have that sort of iron grip on the industry, but perhaps none quite so much as Google — the ad-driven heart of the Alphabet conglomerate. Self-driving cars may be the future, and bioscience sure is interesting, but it’s the ads that pay the bills.

Now, even as Google enjoys historic success, a run of bad news has exposed a vulnerability in its automated advertising system. In recent weeks, big advertisers have become increasingly concerned that their brands have been appearing alongside YouTube videos posted by extremists and other unwelcome material.

Interactive Feature | Subscribe to the Bits Newsletter Get caught up on the latest from Silicon Valley and the technology industry, plus exclusive analysis from our reporters and editors, delivered to your inbox six days a week.

Automated ad systems may be good at identifying copyright violations, but they’re not so good at seeing things in context, the way that humans do, as Daisuke Wakabayashi writes. A gun being waved in a clip from an action movie, for example, is much different from a gun being waved in a recruiting video from a terrorist organization.

Google is turning to a type of artificial intelligence called machine learning to deal with the problem. In essence, the company’s engineers are trying to teach computers to see things in context, as a human would.

Google executives say they know this is an urgent problem. And as anyone who has followed the tech industry over the years knows, vulnerabilities are not to be taken lightly.

More tech news:

How Uber is using psychology to push its drivers’ buttons: The company is experimenting with behavioral science to subtly entice its independent work force to maximize company revenue.

It’s not really 50 Cent — it’s a bot. But fans love it. Music stars are deputizing chatbots as their automatic, ever-alert greeters on Facebook Messenger, handling the flood of inquiries that would overwhelm any human.