Natural Language Processing and Fuzzy Tools for Business Processes in a Geolocation Context

In the geolocation field where high-level programs and low-level devices coexist, it is often difficult to find a friendly user interface to configure all the parameters. The challenge addressed in this paper is to propose intuitive and simple, thus natural language interfaces to interact with low-level devices. Such interfaces contain natural language processing (NLP) and fuzzy representations of words that facilitate the elicitation of business-level objectives in our context. A complete methodology is proposed, from the lexicon construction to a dialogue software agent including a fuzzy linguistic representation, based on synonymy.


Introduction
The question of geolocation is the core base of many companies working on geomarketing, traffic planning, or transport logistics. In the geomarketing area, social networks with recommendations (nearby social events, nearby restaurants, etc.) and determination of a customer profile depending on his/her choices, preferences, tastes, and so forth are examples of growth sectors, especially with the expansion of the mobile market that is rapidly growing. The company we are working with is a leader in geolocation middleware and proposes systems for child location, vehicle and fleet tracking, or delivery rounds. From the company's point of view, persons, vehicles, and goods are considered as devices that have to be tracked with accuracy using a Geohub and notifications must be sent according to the type of the required tracking. On the contrary, from the customer's point of view, a service has to be proposed according to a prior agreement but no (or few) technical detail(s) has (have) to be known. The Geohub coordinates geoinformation on a single platform to track devices and to give them orders knowing their position (e.g., what to do in case of traffic jam or accident on the road or if the vehicle has broken down). The Geohub interacts with all the tracked devices. Low-level messages (written in the Forth language) are sent by both the devices and the Geohub in "push" or "pull" mode. Two roles have to be distinguished: (1) the company that sells and connects devices to its hub and that configures the hub to satisfy the customer and (2) the customer who expresses his/her need (e.g., his/her fleet tracking) to an employee of the company that is able to configure the hub. Thus, the employee has to understand the customer's needs and elicit his/her preferences while configuring the Geohub.
An important challenge is to propose a smart interface, smart enough to let the customers configure the Geohub by themselves. The customers would have a phone conversation with a virtual assistant. We know that natural language processing (NLP) deals with NP-complete problems, which is why such an interaction needs many contextual elements to limit the possibilities. However, even with context, the problem remains quite hard since it implies important expertise to be able to translate the needs expressed in a natural language into a set of Forth scripts and programs written in other languages. Thus, there is a need for tools to capture these sometimes imprecise requirements (e.g., "I would like to be notified when one of my fleet vehicles arrives near the warehouse") and transform them into business processes. The fuzzy logic and its various methods and tools are of great 2 Advances in Artificial Intelligence help for such needs and especially the methods that deal with linguistic variables.
In previous works, we proposed a linguistic model designed to better understand and meet the needs expressed in a natural language: the semantic fuzzy 2-tuple model. While a previous paper [1] proposed a classification of several linguistic models, including the semantic fuzzy 2tuple model, this paper focuses on intuitive and simple interfaces, expressed in natural language, in a real-case study (geolocation applications), using the semantic fuzzy 2-tuple model.
The paper is organized as follows: we first review some NLP techniques and we focus on an interesting linguistic fuzzy model to deal with imprecisions. Our approach that mixes NLP with fuzzy tools in the geolocation context is then explained. Finally, a use case is presented: it exhibits the use of a fuzzy semantic approach to activate an alert in a geolocation context.

State of the Art
We first review some NLP techniques and then we are interested in fuzzy logic that deals with computing with words.
2.1. Some NLP Techniques. Since the first techniques to deal with natural language, many methods and algorithms have been proposed to understand and disambiguate sentences [3][4][5][6]. For example, decision trees and statistical models may give good results as soon as there is context enough in the speech corpus. In NLP, a formal grammar draws a set of normative rules to describe how the natural language runs.
Among the various formal grammars are the generative grammars, the transformational grammars, and the treeadjoining grammar (TAG) [7]. To make discourse analysis, part-of-speech tagging is often used to disambiguate words (e.g., "display" can be a noun, a transitive verb, or an intransitive verb) [8]. Syntax is part of formal grammar that deals with rules for the structure of a string (distribution of words, noun and adjective agreements, etc.). Meaning and formal syntax are the basis of the comprehension, according to Chomsky [9].
Moreover, there have been a lot of works about semantic parsing and question answering. For example, Popescu and collaborators developed semantic parsing for querying databases [10], Berant et al. trained a semantic parser on a web database, learning from question-answer pairs [11], and Shi and Mihalcea integrated several lexical resources into a unified knowledge base to enable robust semantic parsing [12].
Our aim is a bit different: we aim at building a (rather small) business-oriented database, depending on the needs of customers and on the way the experts define the business processes. However, semantics is the focus of our concerns because we feel with natural language. It is well known that semantics is the study of the meaning of words or sentences in their context. The concept of meaning is often fuzzy because natural language may be imprecise if we consider that each word (or set of words) has more than one meaning (without taking into account the figurative sense that is something else again).
Moreover, synonymy can give clues to understand the meaning of an expression or to link two expressions. Synonymy is one of the most difficult semantic relations to handle in NLP. It is very complex because no standard metric is available to measure the distance or proximity between two words or two concepts. In [13], some authors propose to quantify synonymy by what they call the angular distance and they recognize two types: relative synonymy and subjective synonymy. This distance is defined as a semantic distance between two conceptual vectors, where a conceptual vector is a combination of several concepts. Thus, relative synonymy is the synonymy between two terms with respect to a given concept. This synonymy is transitive with respect to the concept. Subjective synonymy permits stating that two terms are synonyms (while relative synonymy would have to state that they are not) when adopting a more general semantic field. For example, to cut and to fragment would not be relative synonyms but they would be subjective synonyms, from the general field "factory." In linguistics, the meaning of a vague or imprecise expression is a fuzzy set in the proper sense. What we call fuzzy semantics is an approach that uses fuzzy logic (Zadeh's sense) to express the fuzziness of the meaning.

Computing with Words and Fuzzy Logic.
Zadeh was the pioneer researcher to propose approaches to deal with imprecision and uncertainty when he introduced the fuzzy set theory, the fuzzy logic, and the concept of linguistic variables [14]. Since then, many fuzzy models have been proposed for computing with words but one seems the most appropriate in our case because it makes a simple correspondence between words and fuzzy scales: the 2-tuple fuzzy linguistic model [15].
In this model, each word or linguistic expression is translated into a linguistic pair ( , ) where is a triangularshaped fuzzy set and is a symbolic translation. If is positive, then is reinforced; else, is weakened. If the information is perfectly balanced (i.e., the distance between each consecutive word is exactly the same), then all the values are equally distributed on the axis. But if not (which may happen when talking about distance; e.g., "almost arrived" and "close to" are closer to each other than "far" and "out of route"), the values may not be equally distributed on the axis. Another model has thus been proposed to deal with such information called multigranular linguistic information [2]. To perform the computations, linguistic hierarchies composed of an odd number of triangular fuzzy sets of the same shape, equally distributed on the axis, are used as a fuzzy partition. The way the levels of hierarchy are constructed is as follows: let be the level and ( ) be the number of triangular fuzzy sets in the partition. Given the initial term (1) = 3, each subsequent term ( + 1) is determined by the relation ( + 1) = 2 × ( ) − 1. Thus, (2) = 5, (3) = 9, (4) = 17, and so forth (see Figure 1). A word may have one or two linguistic hierarchy(ies) and the representation of a notion (such as "distance") can be made up of several hierarchies. Thus, the fuzzy sets obtained are still triangular-shaped but not always isosceles triangular-shaped and the notation permits keeping both the hierarchy and the linguistic term. See [22,23] for a deeper review of these models.
Nevertheless, we have shown in recent papers that the 2-tuple model with unbalanced linguistic term sets does not allow modeling any kind of unbalanced scale. Indeed, when one linguistic expression is very far away from its next neighbor, the 2-tuple fuzzy linguistic model puts them artificially closer to each other because no appropriate linguistic hierarchy level can be found [24,25].
Recently, the same team has proposed an improvement of the 2-tuple model with extended linguistic hierarchies (ELH) [26]. The ELH permit generating the "missing" levels of hierarchies (i.e., level 1 with ( 1 ) = 7, level 2 with ( 2 ) = 11, level 3 with ( 3 ) = 13, etc.). However, this appears to be too constraining because we loose the flexibility of the original model. Indeed, when adding so many labels on the axis, how can we guarantee that each label will correspond to a linguistic term or expression? The idea behind the fuzzy 2-tuple model is to use the continuity of the scale while computing with only a few words (seen as discrete numbers on the axis). With the ELH, this is hard to do. However, we have recently proposed a comparison between two 2-tuple linguistic models and we showed the links between them [27].
The model we have proposed in a previous paper is called semantic fuzzy 2-tuple model and is of course inspired by the 2-tuple fuzzy linguistic model [28]. It uses the symbolic translations to generate the data set. In our model, the 2tuples are twofold. Except the first one and the last one of the partition, they all are composed of two half 2-tuples: an upside and a downside 2-tuple. In our context (geolocation) where the linguistic terms are usually unbalanced, this choice is quite relevant and it has been shown in a previous paper [29].

Semantic Fuzzy 2-Tuples.
More precisely, the linguistic values are composed by a pair (s, v) where s is a linguistic term and v is a number giving the position of s on the axis.
Definition 1 (see [28]). Let S be an unbalanced ordered linguistic term set and be the numerical universe where the terms are projected. Each linguistic value is defined by a unique pair (s, v) ∈ S × . The numerical distance between s and s +1 is denoted by with Definition 2 (see [28]). Let = { 0 , . . . , } be an unbalanced linguistic label set and ( , ) be a linguistic 2-tuple. To support the unbalance, is extended to several balanced linguistic label sets, each one denoted by ( ) = { ( ) 0 , . . . , ( ) ( )−1 } defined in the level of a linguistic hierarchy LH with ( ) labels. There is a unique way to go from S (Definition 1) to according to an algorithm detailed in [28].
The aim of the partitioning is to assign a label ( ) (indeed one or two) to each term s . The selection of ( ) depends on both the distance and the numerical value v . We look for the nearest level-they are all known in advance-that is, for the level with the closest grain from . Then, the right ( ) is chosen to match v with the best accuracy. has to minimize the quantity min |Δ −1 ( ( ) , 0) − v |, with Δ −1 ( , ) being the function that computes the numerical equivalent value of ( , ); that is, Δ −1 ( , ) = + .
By default, the linguistic hierarchies are distributed on [0, 1], so a scaling is needed in order for them to match the universe .
The function returns a set of bridge unbalanced linguistic 2-tuples with a level of granularity that may not be the same for the upside rather than for the downside.
We now explain how NLP tools have been used to enhance business processes in a geolocation context.

NLP and Fuzzy Linguistics
Offering an interface based on a full natural language dialogue is a complex task that is NP-hard. Thus, reducing the complexity is compulsory. The semantic analysis implies using a substantial database to catch the meaning of the dialogue and to take into account the imprecision and subjectivity due to the natural language and human reasoning.
In the following, we propose an approach to elicit the choices (in a natural language interface), so the experts can express their business process needs: configure the GPS mobiles and create geolocation alerts easily.

Natural Language Integration.
We aim at giving customers and experts a way to express their needs and business objectives via a natural language interface. In the short term, the idea is to obtain a complete vocal assistant in the geolocation context. That assistant would permit retrieving information about the condition of a user's mobile or, more generally, of the mobiles of a user's fleet. It would also permit changing the mobile configuration, programing alerts, and offering high-level features that would be translated into lowlevel configurations and/or alert programing.
The approach we propose follows the Question Answering Systems in which the program (the software) leads the dialogue to avoid dead ends or unproductive loops. The program starts with a first question. After each answer, it analyzes it to decide whether it shall make a decision right now or ask another question, according to a given scenario.
The first step of the dialogue interface construction is to prepare a lexicon to be able to analyze the sentences.
The lexicon is built from a corpus of documents among which are advertisements from the company, some documentation of the web applications and of the Application Programing Interface (API), and language files (if the interface is conceived and designed for several countries).
In software engineering, texts displayed in the applications as well as the labels, the buttons, the menu titles, the help menu, and so forth are grouped together in a single "key-value" file for each supported language. Values are dynamically loaded while the software is being started and the language file chosen is the one that the user speaks. This permits separating style (text) and content (code) and facilitating the software translations.
Once the corpus is exhaustive, a statistical study is performed on the occurrences of the words from the corpus. Of course, grammatical words are excluded. We obtain a set of the most relevant words of the jargon of the field (here: geolocation jargon); these words will constitute the entrylevel lexicon. The method TF-IDF (Term Frequency-Inverse Document Frequency) [30] is completely efficient for this task.
The words obtained are now called tokens.
3.2. Parts of Speech Tagging, Lexicon, and Synonyms. Tokens, expressions, and parts of speech are grouped together in an XML file through PoS (parts of speech) tagging [31] where each lexicon input receives a set of descriptive tags. Each input is labeled with a grammatical tag to express the grammatical category (noun, verb, adjective, adverb, etc.). These tags may help to disambiguate certain words (e.g., "base" can be an adjective, a noun, or a transitive verb) since this kind of ambiguity is very common in a natural language [8].
PoS tagging is realized through automatic tagging tools such as TreeTagger (http://www.cis.uni-muenchen.de/ ∼schmid/tools/TreeTagger/). TreeTagger permits regrouping the PoS tagging and the lemmatization: it groups together the different inflected forms of a word so they can be analyzed as a single item. Then, we add semantic tags to the most relevant lexicon inputs, from a business-level point of view. These tags permit representing the knowledge and the semantic concepts. Thus, several inputs (words) can be linked to these semantic tags. The empirical way to build the lexicon is unavoidable and necessary because expert knowledge is needed.

</tokens>
Semantic tags may represent generic elements (vehicles, persons, cities, etc.) as well as specific geolocation elements (types of alerts, points of interest, kinds of mobiles, etc.). Now that the tagged basic core of the lexicon is created, it has to be enriched for a better exhaustivity and in order to make the interface accept the largest number of terms. As we are in a closed domain, the lexicon size will not be too big. The extension of the core is performed using a method based on several French dictionaries of synonyms: DES has one big advantage: it presents the synonyms as cliques. A clique is a subset of synonyms sharing a particular meaning [32,33]. Thus, a word belongs to just as many cliques as it has different meanings.
For each term of the lexicon, a set of synonyms from the different sources is retrieved. The set is the intersection of all the synonyms to avoid the noise (i.e., too specific or too wide synonyms or synonyms with a figurative sense) and to avoid conflicts between dictionaries (e.g., term is a synonym of according to dictionary 1, but is a synonym of term according to dictionary 2: in that case, is excluded). This set is assigned with the semantic tags of the original term of the lexicon. A bit like DES, the Dictionary of Collins has an advantage: main synonyms can be distinguished from additional synonyms, so there is a classification between synonyms, according to their semantic distance to the original word.

Fuzzy Partitions to Catch the Meaning of the Concepts.
For each concept whose meaning may be imprecise or fuzzy, a fuzzy partition with our 2-tuple model is performed by experts. As an example, if the expert gives five labels to represent the semantic concept DISTANCE, they are by default considered as uniformly distributed on their axis. Looking for synonyms gives a set of five synonym bags, one bag per label. The distance between each label is computed using the number of shared synonyms in each bag. Resemblance rate matrices are then computed to determine both the order of the terms and the distance between them. The more common the synonyms, the closer. Finally, it is easy to construct the partition of the five unbalanced terms thanks to our 2-tuple linguistic model. See Figure 2 where both partitions (top: Herrera and Martínez's one; down: ours) are shown.
At the top of the figure, the partition seems perfectly balanced because the model forces having a midterm (here, "CloseTo"). The rest of the terms are automatically placed from left to right. At the bottom of the figure, our partition is unbalanced because we used our method with semantics and synonyms. Of course the big difference between both models is that in our case fuzzy subset "Far" meets "OutOfRoute" with a membership degree less than 0.5 (0.15 actually). But our model guarantees the minimal coverage property, as proved in [28], which is enough in the computations. The semantic tokens (e.g., "close to") are then expressed through our 2-tuples and compared to the fuzzy partition.
Adverbs such as "very" will modify their associated 2-tuple through the translation value, which has to be seen as a modifier.
In the following, we propose a use case using both fuzzy models: Herrera and Martínez's one and ours.
As a use case, we keep the same example as before with an alert that is triggered depending on (1) the distance between the mobile and the arrival (a warehouse) that is subject to (2) time tolerance and depending on (3) the battery level. If the time tolerance is high enough, the alert is not triggered when the mobile is quite far away from the arrival and the battery level is low (to save battery). The alert is triggered, even if the battery level is low, when the mobile drives out of route of the arrival. The software and the library to compute the partitions have been written in Java, using jFuzzyLogic with the extension we have proposed (see the website of our project https://salty .unice.fr/attachments/175/jFuzzyLogicExtended.jar) and the FCL (Fuzzy Control Language) specification (IEC 61131-7). The FCL script below uses three inputs and one output. . . .

END_RULEBLOCK END_FUNCTION_BLOCK
Two different partitions were used for the inputs: the 2tuple partition by Herrera et al. and our 2-tuple partition (in the FCL extract, only our partition is shown through the pairs). A study and a comparison between both models show that no alert is triggered with Herrera et al. 's model when (i) distance is between CloseTo and Far (=600) and battery level is Maximum (=100) and when (ii) distance is Far (=700) and battery level is Maximum while an alert would have been triggered with our 2-tuple model. This is due to the fact that the unbalancement is weaker in this model than in ours. Figure 3 describes the exchanges between mobiles and the Geohub.

Business Grammars.
Regarding the natural language interface, the next step is to determine a noncontextual business grammar. This grammar defines the business concepts taken into account by the dialogue interface. For example, in a geolocation alert, the grammar defines the various components of the alert and these components will be transformed in parameters or questions to ask users during the dialogue. This permits specifying a general concept by subconcepts that can themselves be specified later. The syntax used is of EBNF (Extended Backus-Naur Form) kind to define each element of the business grammar. The following example shows a simplified grammar for the definition of a geolocation alert: This grammar defines an alert as being composed (compulsory) of a type of alert, a mobile, a place, and a notification. A mobile is either a vehicle or a person, and so forth. In the example, POI means "point of interest" and ZOI "zone of interest." The grammar will be useful for leading the dialogue scenario (see Section 4.2).
Terminal symbols of each grammar are linked directly to one (or more) semantic tag of the business lexicon. Thus, the dialogue interface links the words from the lexicon and their semantics from the business level. For example, in the extract of grammar, a MOBILE is either a VEHICLE or a PERSON. Using the lexicon, we will find the entry truck tagged with semantic tag VEHICLE. The dialogue interface will make the connection with VEHICLE each time the word truck is found during the analysis of the user sentences.

Towards an Approach of a Dialogue Software Agent
The dialogue interface in natural language we propose is a kind of software agent. then to realize the tasks that follow, such as creating an alert on the Geohub, configuring a mobile device, and displaying information of a user account. The agent uses the business lexicon and grammar that it loads dynamically while launching. The lexicon is stored in a hash table while the grammar is loaded through a TAG (tree-adjoining grammar). Despite the fact that the tree representation is restrictive regarding the knowledge representation, the tree is easier to use for immediate processing through database querying. In case of ungrammatical statements, the sentence is analyzed without any error because only the semantic tags are retrieved. If no semantic tag is detected, the agent asks a question to obtain those tags. The generation of answers is a wide subject [34] and is in our case performed from the template. Templates are composed of three kinds of elements: elements coming from the previous user statements, predefined expressions, and the answer. Thus, if the previous statement is "I want to notify Alan," it is analyzed as "I want <notification> to notify</notification> <recipient>Alan</recipient>". The agent will answer with a question generated by the following template: "What message do you want to send <recipient>?," that is, "What message do you want to send Alan?" or "What message do you want to send your recipient?" Figure 4 shows an extract of the grammar represented by a TAG.
The dialogue between the software agent and the user is composed of several steps: (ii) It retrieves the answer and forwards it to the parser. The parser acts like a preprocessor that prepares the analyze phase. It labels each word of the sentence (the answer) thanks to the semantic tags of the lexicon.
(iii) The next step is the analysis of the sentence. Only semantic tags are used (but the grammatical ones may be useful in future works) because there is a need for reducing the complexity (we recall that the aim is to catch the meaning) and because it permits some flexibility (ungrammatical sentences may be considered as correct as soon as the meaning is clear; see the principle of extended grammar by Harris [35]). (iv) Given that the nodes of the TAG correspond to components (or necessary conditions) of the accomplishment of a given task, the agent tries to check/validate all the nodes. The children nodes are linked together with an AND operator; that is, they all are compulsory to validate the parent node. The leaves of the same node are linked together with an OR operator; that is, only one leaf is needed. Each time a parameter is entered, the corresponding node is marked (validated). (v) Then, the agent checks whether all the nodes are marked: (a) If this is the case, then the whole set of parameters has been retrieved and the task may begin. (b) Else, the agent asks a question that corresponds to the missing parameter. Then, it parses and analyzes the answer and restarts the validation process.
The dialogue proceeds until all the parameters are entered by the user.

Prototype Implementation.
We have developed a prototype software agent for a dialogue in natural language Advances in Artificial Intelligence 9 Figure 5: Example of a dialogue on Android platform (in French, the translation being included in the article). specialized for geolocation in an Android application. To facilitate the dialogue, we used the speech recognition and synthesis of Android system for the user interaction. The application called DeveryDialog permits realizing several tasks like programing an alert, displaying the mobile list for a count, changing the frequency of data (GPS positions) collection, and so forth.  agent, and then the business grammars are checked. In this case (alert creation), the alert TAG will be chosen. The agent tries to validate the tree elements since the user has given several parameters in a single answer. Indeed, he/she gave information about the alert type (gets is linked by semantic tag with ZONE_ENTRY type), the mobile, and the destination. Thus, the agent makes a try about the notification in order to retrieve all the parameters ("Who do you want to send the notification to?"). Screen 3 shows the rest of the conversation (user says "I want to notify Alan" and the agent asks "What message do you want to send your recipient?"). The fourth and last screen of Figure 5 shows the message to be sent ("Please go to the train station as soon as possible.") and a summary given by the agent to be sure the dialogue has been efficient and the request has been understood. The alert can now be created on the Geohub through the Deveryware geolocation API.
Answers that would be considered as being off topic do not modify the dialogue run because, after their analysis, the validation phase will always point to the next missing parameter so the agent will always ask to fill it out. Besides, the term "son" has been declared in the lexicon and tagged as MOBILE; "Alan" has also been declared and tagged as RECIPIENT. In its final version, the software agent will be connected to the contacts and profiles of each user. The profiles contain the mobiles declared by the users, the address lists, and the zones and points of interest the users have recorded.
While running a real-case example, we can see that an alert is triggered 24 seconds after the mobile leaves the road (the corridor, actually): indeed, the vehicle left at 10:32:02 and the alert is given at 10:32:26 (see Figure 6).

Conclusion
Starting from a real-case study for a company, this paper proposes and explains a generic method to take into account natural language in a geolocation interface where an implementation has been proposed. A lexicon has been created, dedicated to the geolocation field using PoS tagging and dictionaries of synonyms. The internal representation of the imprecision, that is, the fuzzy semantics of the sentences, is dealt with in a model inspired by the 2-tuple fuzzy linguistic representation model by Herrera and Martínez where unbalancement is the key concept. The partition is constructed while taking into account the semantics of the concepts (synonyms and resemblance rate matrices). A dialogue software agent has been implemented on Android platform.
In future works, we will formalize the partitioning method that uses synonyms. We also want to introduce more contextual elements and ontologies to be able to understand more words and to deal with several languages.