AP Elizabeth Lane, a Mississippi Department of Health Food Inspector, listens to Marc Fogelsong, of Pita Pit's corporate office, explain food preparation at Mississippi’s largest outlet center. Some local governments are using social media to publicize restaurant inspection results. (AP)

Many diners regularly click onto the Yelp website to read reviews posted by other patrons before visiting a restaurant. Now prospective customers also can use Yelp to check health inspection scores for eateries in San Francisco, Louisville and several other communities.

Local governments increasingly are turning to social media to alert the public to health violations and to nudge establishments into cleaning up their acts. A few cities are even mining users’ comments to track foodborne illnesses or predict which establishments are likely t­­o have sanitation problems.

“For consumers, posting inspection information on Yelp is a good thing because they’re able to make better, informed decisions about where to eat,” said Michael Luca, an assistant professor at Harvard Business School who specializes in the economics of online businesses. “It also holds restaurants more accountable about cleanliness.”

The Centers for Disease Control and Prevention (CDC) estimates that more than 48 million people a year get sick from foodborne illnesses, 128,000 are hospitalized and 3,000 die. About 60 percent of outbreaks come from restaurants, according to the CDC.

Restaurant inspections, which are usually conducted by city or county health departments, vary across the country in frequency and in how scores are computed and citations are handled. Most, however, include surprise inspections and cite restaurants for high-risk violations, such as a refrigerator’s temperature not being set at the proper level or staffers using the same cutting board to make salad and handle raw chicken.

In recent years, dozens of city and county health departments have been posting restaurant inspection results on government websites to share with the public. Turning to Yelp or other social media, or using crowd-sourced information to increase public awareness, is the next logical step, some officials say.

“Yelp is a window into the restaurant. The restauranteurs don’t want a bad (health) score on Yelp. They’ll be more attentive about getting the restaurants cleaned up and safer,” said Rajiv Bhatia, former environmental health director for the San Francisco Department of Public Health.

“It’s also valuable because it allows the public to see the workings of a government agency, and puts some pressure on the agency to do its job,” said Bhatia, a physician who is now a public health consultant.

Inspection Scores

In 2005, San Francisco was one of the first cities to put its restaurant inspection information online. Eight years later, it was in the forefront once again, becoming the first city to sign onto the Yelp initiative to list health scores alongside diner reviews.

The city’s health department, which is responsible for inspecting 3,300 restaurants and another 2,200 establishments that prepare food, says the program is working well.

“It gives more information to the public about making decisions as far as where to go to eat,” said Richard Lee, the department’s acting director of environmental health. “Someone might not go to a restaurant based on the score they see on Yelp.”

Lee said that initially, only inspection scores and violations were posted on Yelp. But after getting complaints from local restaurants, he said the site also added the date the violation was corrected.

The National Restaurant Association, the industry’s trade group, said that while it supports transparency and consumers’ access to information, it worries that because inspection standards differ from city to city, Yelp users may not be familiar with rating terminology and therefore could draw incorrect conclusions.

David Matthews, the association’s general counsel, also said the timing of postings is critical because restaurants often correct findings and generate different ratings after a re-inspection.

“I could be inspected today and fail, and fix the problem tonight and have an inspector back out. But if Yelp only receives a weekly or monthly update, then I’ll be on the Yelp system for up to a month with a violation or a failure. That’s not an accurate reflection of the status of my restaurant,” Matthews said. “A fair system is crucial to restaurants, the majority of which are small businesses.”

Yelp collaborated with officials in San Francisco and New York to develop the open data tools that allow health departments to publish inspection information on the site or any other one that offers restaurant listings. They decided on a common format to report the data. Each city or county is responsible for making electronic information available in that format. Yelp’s software collects the data from health departments and puts it on its website.

So far, seven city or county health departments have joined the program, among them Los Angeles County, which includes the city of Los Angeles, and Wake County, North Carolina, which includes Raleigh. More are coming on board this year, according to Luther Lowe, Yelp’s director of public policy.

“The idea is to create a public-private partnership that’s a win-win-win,” Lowe said. “It empowers consumers with helpful information that’s germane to their dining decisions. It helps the cities by making their data more useful to their citizens. And it’s great for Yelp, because it makes the site even more useful.”

Lowe said Yelp has more than 135 million unique monthly visitors, and restaurant reviews are among the most common destinations.

Putting health scores and inspection results in an accessible place where consumers already are searching for restaurant information, he added, makes a lot more sense than “relying on those clunky (health department) dot.gov websites.”

Using Crowd-Sourcing

New York City has used Yelp reviews in a different way. Its Department of Health and Mental Hygiene launched a nine-month pilot study in July 2012 that used data-mining software to screen and analyze about 294,000 Yelp reviews. It searched for keywords such as “sick” or “food poisoning,” to find cases of foodborne illness that may not have been officially reported. The findings, which were published in a 2014 Centers for Disease Control and Prevention report, uncovered three unreported outbreaks linked to 16 illnesses and identified multiple food-handling violations at the restaurants.

The authors cautioned that while it may be beneficial to incorporate review information into the surveillance process to find foodborne illnesses, the process also requires “substantial resources,” including programming expertise and staffers available to read reviews, send emails and conduct interviews.

In a prepared statement to Stateline, the health department said that through the partnership with Yelp, it had identified four additional outbreaks since the study ended. “We are currently working to expand the project to add additional sources of social media data,” the department said.

Chicago has taken a different route. There, the Department of Public Health and a group of civic organizations launched a project in 2013 that identified and responded to restaurant complaints on Twitter. Over 10 months, staffers used an algorithm to track Twitter messages about foodborne illness. They identified people whose tweets mentioned words such as “food poisoning” or “stomach cramps.” They contacted them and sent them links to an online complaint form. A total of 133 restaurants were inspected, according to a health department report published by the CDC. Of those, nearly 16 percent failed inspection, and about 25 percent passed but had conditions that indicated critical or serious violations.

Chicago health officials also recently completed a “predictive analytics” pilot project that used software to aggregate real-time data such as previous citations, social media comments, building code violations and nearby construction. The goal was to try and predict which restaurants would be most likely to fail an inspection or draw violations and which should be targeted for visits.

The health department would not make anyone available to Stateline to discuss the pilot program.

Targeting Inspections

Bhatia, the former San Francisco environmental health official, said putting inspection data on Yelp or similar sites would result in safer conditions for diners because it would force restaurants to pay more attention to workplace practices that result in hazards. It also would alert inspectors to problems they may not know about, he said.

Bhatia said that predictive analytics also can be valuable, if it includes not only a history of inspections and social media comments, but environmental conditions, such as the building’s quality and occupational hazards for workers. Cities could use that data to move from routine inspections to targeted ones, he said.

For Luca, the Harvard Business School economist, using algorithms is the way to transform restaurant inspections.

He points to a 2013 study he co-authored that mined seven years of Yelp reviews in Seattle. It concluded that online postings can be used to predict the likely outcome of a restaurant’s health inspection.

Luca said that given the results of his study and others, restaurant inspectors need to change the way they do business. Instead of conducting random inspections two or three times a year, he said health departments should search online reviews using an algorithm that would tell them which places to inspect on which days. That information would come from Twitter, Yelp and other social media over time.

Luca said he envisions health departments performing random annual inspections and doing additional ones only when the algorithms signal something bad is going on. “There would be a large-scale reallocation of inspectors targeted at the places most likely to have violations,” he said.

The major challenge, Luca said, is for officials to come up with the details of how such a new inspection process would work.

“The science is there; the data is there; the human capital is there,” Luca said. “The process itself would be no more complicated than the current one. The biggest barrier is logistical.”

Luca and three of his collaborators at Harvard are so big on the idea they’re running a competition in Boston this month funded by Yelp. They’re asking people to devise their own algorithm to pinpoint violators. The winner will receive $3,000 and the two runners-up each will get $1,000.

“Cities haven’t acted because of inertia. They’re used to doing it the old way,” Luca said. “This is a great opportunity for local governments that are looking to innovate and cut through bureaucracy.”