In Facebook's apparent mission to track every aspect of people's lives, the internet giant may have figured out a way to tell when someone is going to die.
This might include a change in marital status, birthdays, new jobs, the birth of children, graduation, or death.
"The life change prediction engine computes the probability of a user undergoing a life change event using a machine learning model and historical data of other users of the social networking system who have went through life change events," the patent states.
As might be expected of Facebook, one of the main reasons for developing such an algorithm is advertising. By knowing the most intimate details of a person's life, the social network would be able to serve them with highly-relevant adverts.
For example, if such an algorithm were to predict that a user is pregnant from the type of posts they were making or reacting to, then it would be able to target that person with ads for nappies or baby clothes.
Some Facebook users may choose to publicly share information about major events in their lives, however Facebook's patent describes how such information could be gleaned through more subtle methods.
The patent states: "Beyond simple reliance on a change in user profile information, the described approach is better able to use all the information contained in the social networking system such as wall posts, instant messages, email messages, etc., to determine whether a user has undergone a life change event and/ or predict whether a user will undergo a life change event at a future time."
Other patent applications uncovered by The New York Times include one that can spy on users through their phone's microphone.
In this scenario, the microphone listens to what TV show a person is watching to suggest relevant content.
Facebook has previously said that patent applications are not an indication that it employs the technology or plans to use it in the future.
Facebook has faced intense scrutiny about its data practices in recent months, following revelations that UK data firm Cambridge Analytica harvested the personal data of Facebook users for the purpose of political profiling.
The scandal led to several high-profile figures to quit the social network, including Apple co-founder Steve Wozniak, who said in April that Facebook users make huge profits from its users' data but "the users get none of the profits back."
News of the life event patent also comes after Google recently published a paper describing an artificial intelligence algorithm that predicts the likelihood of death among hospital patients.
The algorithm, developed by Google's Medical Brain team, was used in two different hospitals to predict inpatient mortality. In the first hospital it was 95 per cent accurate, while in the second hospital it was 93 per cent accurate.
"This was significantly more accurate than the traditional predictive model," the paper stated.