A recently-published patent application from Uber has revealed that the ride-sharing company is planning on using artificial intelligence to identify a passenger’s behavioral state, including being drunk, before being picked up. With this technology, Uber is hoping to better tailor its ride-sharing options for its ever-growing user base.

The patent, titled “Predicting user state using machine learning” describes a system that uses machine learning to study the usual behavior of Uber users. These behaviors include several factors, including location, the precision of users’ clicks on the app’s buttons, spelling accuracy when communicating with drivers, average walking speed, and how long it takes passengers to request for a ride. The usual time when users hail an Uber will also be included in the system.

According to Uber’s patent application:

“The user state model is trained to predict user state using past features in conjunction with previously-identified unusual user states. That is, the user state prediction module detects whether the user has input data in a way that is unusual for that particular user and/or in a way differing from normal user behavior that is similar to the differences for other users having unusual behavior.”

Thus, if an intoxicated user hails a ride while walking and typing clumsily, the ride-hailing company’s AI system would be able to make an assumption that the user is less than sober. Once the system detects that a user is likely drunk, it would “alter the parameters” of its service in order to match the passenger with drivers who have relevant experience and training. Based on the passenger’s state, Uber might also restrict a drunk user’s access to its shared ride services.

“the user may not be matched with any provider, or limited to providers with experience or training with users having an unusual state” reveals the patent application.

The patent is authored by members of Uber’s Trust & Safety Team, who are tasked with making the company’s service and products safer. Overall, the system stands to benefit both passengers and drivers, considering that intoxication has proven to be a problem for Uber so far. According to an investigation from CNN, at least 103 Uber drivers have been accused of abusing intoxicated passengers over the past four years. Uber drivers have also reported instances where they got assaulted by passengers who were drunk.

The use of AI systems is steadily gaining ground. In China alone, SenseTime, a company involved in mainstream smartphone applications such as AR filters, has been working with the Chinese government in developing AI solutions that are capable of matching footage from crime scenes to criminal database photos. After a funding round led by Chinese e-commerce giant Alibaba earlier this year, SenseTime’s total valuation rose to over $4.5 billion, making it one of the most valuable AI startups in the industry.

In the United States, AI is starting to get embraced by the US military, with self-driving vehicles and AI-powered weapons being in development. Just recently, Google saw protests from staff over the company’s participation in the Pentagon’s artificial intelligence initiative, Project Maven. According to reports, Google’s AI technology has been used to improve military drones’ image-processing capabilities, which has been helping the military fight threats in several regions such as the Middle East. Google, for its part, stated that its work with the Pentagon has been “mundane,” and that the technology it provided was limited only to non-offensive uses.