# NAP: Natural App Processing for Predictive User Contexts in Mobile Smartphones
## 1 Introduction  
The recent and brief history of smartphones is mainly marked by rapid technological growth. Both hardware and software have significantly improved in recent years, enabling and motivating the development of new applications (apps). It is estimated that the Google Play Store had more than 2.5 million apps available in 2019 [1]. Together with the massive number of apps available, the number of apps installed is also increasing significantly. It is estimated that smartphone users install more than 150 apps on their devices [2]. Given this scenario with many apps installed, optimizing the app management is essential if we want to deliver an efficient system to the user. Searching for an app becomes not practical, making the user spend a lot of time until finding the app. This motivated researchers to develop app prediction methods, such as FALCON [3], which are based on context signals and user access patterns. Another important issue is resource allocation in smartphones. If we can predict the app usage behavior, it is possible to assign the required resources in advance to the expected app. For instance, it is possible to preload the app in memory or avoid the system to kill the next app to be used in situations when memory is saturated [4]. To build an efficient app prediction model, it is essential to analyze the user's behavior over time. For instance, does the user typically change the most used apps along time? How relevant are the most used apps in the prediction task? If it is possible to use context features, such as time and smartphone energy status, it will help in the app prediction? In this work, we propose to discuss these questions using a neural network applied to a long app usage dataset record. The idea is to treat the app usage dataset as sequential data, where we want to predict the next application given a sequence of previous applications used. Neural networks can collect knowledge from the data set and establish a relationship between the input and the prediction. One kind of neural network often used to process sequence data is the Recurrent Neural Network (RNN). One of the RNN's features is to predict the next element of a sequence. For instance, predict a company's share price given its history on the stock market, or perform a weather forecast given the previous weather conditions [5]. These examples are in the time-series prediction group, which means the dataset is following a timeline sequence. Another example, where RNN is often used is in language modeling (LM). LM represents probabilistic models that can predict the next word in the sequence given the words that precede it [6]. Since words follow communication patterns to build sentences, we can use RNN to learn these patterns and use them to predict the next word. For instance, if we try to predict the next word in the sentence \"Please, give me a glass of...\", the most probable word might be \"water\" due to the sentence pattern used in the English language. If we extend to multiple possible candidates, we can say that \"water, juice and soda\" might be good candidates for the given sentence. In this work, we build a model to predict the next application based on the LM approach, the Natural App Processing (NAP). If it is possible to correlate the applications and features as words in sentences, we can reproduce the word prediction task to the app prediction problem. First, we process the apps and features as words using the tokenization and encoding. The encoded are used as input to the RNN. The RNN output is processed by a softmax function to give the prediction. In the end, we evaluate the prediction using categorical cross-entropy. We used a dataset with 34 users containing app usage ranging from 6 to 14 months. We evaluate the app usage monthly for all users, and we got 86.58% accuracy in the app prediction using Recall@5. This paper has the following orientation. First, we briefly present the methods used in previous works and their interpretation of the application prediction problem.