Tuesday 13 May 2014

How to build an ontology model for inferencing a best offer - a Telecom Company example.

The Business problem

In a modern rapidly changing business environment companies need to quickly respond to these changes to gain operational excellence. Typical Corporation has a central business analysts’ team that is constantly moni-toring overall business performance, benchmarking the market and adjust-ing up-to-date business strategy and sales tactics. This tactics needs further to be deployed and executed by the army of sales people widely spread geographically.
The Telecommunication Company that is referenced in this article has more than 1200 POS (point of sale) in the whole country. Sales process per-formed at each of them shall be coordinated on a daily basis with the recent company sales strategy in accordance to the customer needs, up-to-date product and service portfolio, technical assessment, and various locally available sales-promotions.
With CNL those issues could be addressed in a convenient way both for the human (business analysts) and computer (to run application assessing cus-tomer needs and automatically generate the best offer proposal) perspec-tives. CNL approach allows to 1) describe corporate offer (products and services) in a convenient but readable by the computer form, 2) describe business rules on how Customer needs shall be assessed at POS, 3) de-scribe rules to select the best offer in regard of Customer needs, company sales strategy and feasible to be delivered products and services.
This article refers to the real business case and real telecommunication company. However, due to trade secrets, its name is not disclosed here.


The CNL model

We present the construction process of a model of knowledge, which is the central part of the application, in Fluent Editor (Cognitum, Fluent Editor - Comprehensive tool for editing and manipulating ontologies with CNL, 2014). Fluent Editor is an ontology editor developed at Cognitum. It is a comprehensive tool for editing and manipulating complex knowledge bases and makes usage of a version of Controlled Natural Language first introduced in (Kapłański, 2011) as a specific CNL/OWL interface. By design, this version is compatible with OWL2 ontology standard (OWL- Web Ontology Language, 2014) and the grammar was inspired mainly by the Attempto Controlled English grammar (Kaljurand, 2008) .
We consider here a Telecom Company that sells “complete offers” to various types of customers. A complete offer is “a telephone offer” that will address a certain type of customer (Already-Customer, New-Customer...). Furthermore, the complete offer will include “gadgets” (e.g. a smart phone) and “packages” (e.g. 0.5 monthly GB usage for free) and many more characteristics. In the CNL supported by Fluent Editor it has the following form:

Every complete-offer address-customer a customer-type.
Every complete-offer has-contract-type a general-contract-type.
Every complete-offer has-price a price-per-month.
Every complete-offer includes a package.
Every complete-offer includes a gadget.
Every complete-offer serves a general-service-type.

Using this definition concrete instances of a complete-offer are defined as:

Mobile-Offer-Subscription-Already-Customer-05-Gb is a complete-offer.
Mobile-Offer-Subscription-Already-Customer-05-Gb address-customer Already-Customer.
Mobile-Offer-Subscription-Already-Customer-05-Gb serves Mobile.
Mobile-Offer-Subscription-Already-Customer-05-Gb has-contract-type Subscription.
Mobile-Offer-Subscription-Already-Customer-05-Gb includes Mobile-Package-05-Gb.
Mobile-Offer-Subscription-Already-Customer-05-Gb includes Phone-No-Gadget.
Mobile-Offer-Subscription-Already-Customer-05-Gb has-monthly-pln-price equal-to 20.

Where the name has been chosen to directly reflect the characteristics of the offer. So for example an offer Xx-Offer-Yy-Zz-Kk will serve Xxx, have-contract-type Yyyy, address-customer Zzzz and include Xxx-Package-Kkkk. Going further; we can define another offer like:

Mobile-Offer-Sim-Card-New-Customer-2-Gb is a complete-offer.
Mobile-Offer-Sim-Card-New-Customer-2-Gb address-customer New-Customer.
Mobile-Offer-Sim-Card-New-Customer-2-Gb address-customer Other-Operator-Customer.
Mobile-Offer-Sim-Card-New-Customer-2-Gb serves Mobile.
Mobile-Offer-Sim-Card-New-Customer-2-Gb has-contract-type Sim-Card.
Mobile-Offer-Sim-Card-New-Customer-2-Gb includes Mobile-Package-2-Gb.
Mobile-Offer-Sim-Card-New-Customer-2-Gb includes Phone-Camera-Touch-Screen.
Mobile-Offer-Sim-Card-New-Customer-2-Gb has-monthly-pln-price equal-to 60.

A package can have various characteristics, for example a mobile package will have a certain internet speed:

Every mobile-package is a package.

Mobile-Package-05-Gb is a mobile-package.
Mobile-Package-05-Gb has-internet-package-size The-"0.5 GB".

Where concrete names are chosen to reflect the characteristics of the package. Next we define a gadget as:

Phone-Camera-Touch-Screen is a gadget.
Phone-Camera-Touch-Screen has-type Phone.
Phone-Camera-Touch-Screen has-feature Camera.
Phone-Camera-Touch-Screen has-feature Touch-Screen.

The knowledge presented until now is typically specified by the Telecom Company and constitutes the base model, while the knowledge in the fol-lowing will be produced by the end-user of the application (a salesman for example). The end-user will generate this knowledge using Fluent Editor via a dialog and then it will run real-time queries over this same knowledge. Hence in the following we will call this knowledge the configuration as it configures the application.
To define the configuration, it is only needed to define Customer instances as for example:


Customer-1 is a customer.
Customer-1 has-name equal-to 'John'.
Customer-1 has-surname equal-to 'Doe'.
Customer-1 want-service Mobile.
Customer-1 want-internet-package-size The-"2 GB".
Customer-1 want-contract-type Sim-Card.
Customer-1 has-customer-type Already-Customer.
Customer-1 want-gadget-type Tablet.
Customer-1 want-gadget-feature Touch-Screen.

Rules and real time reasoning

Fluent Editor has a built-in OWL-reasoner (the current version of Fluent Editor uses HermiT reasoner (Boris Motik, 2009)), thus when all the base model and the configuration are written together, it is possible to make queries in CNL.
In order to generate the output for the end-user using the built-in reason-er, some business rules need to be added to the base model. This is possi-ble by using CNL rules that are compatible with SWRL rules (SWRL: A Semantic Web Rule Language, 2014), hence giving broad expressivity.
For example a simple set of business rules that relate the best offer for each client could be:


1) If a customer want-service a thing and a complete-offer serves the thing then the complete-offer has-service-wanted-by the customer.

2)  If a customer want-contract-type a thing and a complete-offer has-contract-type the thing then the complete-offer has-contract-wanted-by the customer.

3) If a customer have-customer-type a thing and a complete-offer address-customer the thing then the complete-offer address-customer-type-of the customer.

Where three new properties are defined: has-service-wanted-by, has-contract-wanted-by and address-customer-type-of.
With help of these rules, the end-user can “ask” the reasoner using ques-tions like:

Who-Or-What has-contract-wanted-by Customer-1 ?

In this case the reasoner will use rule 2 to decide which offer has the con-tract wanted by the customer (Sim-Card) and we will get back all Mobile-Offer-Sim-Card-Xxx that we defined.

Having defined some more involved rule like:


If a complete-offer has-service-wanted-by a customer and the complete-offer has-contract-wanted-by the customer and the complete-offer has-internet-speed-wanted-by the customer and the complete-offer address-customer-type-of the customer then the complete-offer has-characteristics-wanted-by the customer.

And asking (via the reasoner)

Who-Or-What has-characteristics-wanted-by Customer-1 ?

We will get back a single offer: Mobile-Offer-Sim-Card-Already-Customer-2-Gb because Customer-1 :

  • want-service Mobile.
  • want-internet-package-size The-"2 GB"
  • want-contract-type Sim-Card
  • has-customer-type Already-Customer

It is worth mentioning that the reasoner can also answer questions like:


Who-Or-What has-characteristics-wanted-by a customer that has-name equal-to 'John' and has-surname equal-to 'Doe' ?

Getting back the same answer as before.

Implementation

The application as presented until now, can be executed inside Fluent Edi-tor. As we can see in this Figure.


We chose to present the application like this because we think it is more intuitive. The CNL used in this image, can be downloaded here.
Nevertheless, the final application has been developed using ASP.NET MVC and Ontorion which is a scalable cloud based application that we developed at Cognitum (Cognitum, Ontorion™ - a distributed knowledge management system, 2014). Using Ontorion it is possible to use the same functionality of Fluent Editor in a programmatic way allowing us to build all kind of applica-tions.
In this case, we developed an application that is generating a form automat-ically based on the informations present in the base model. When the form is filled and submitted, it generates the configuration. Finally using this con-figuration and the rules (similar to the one presented in the last part), we were able to ask for the packages corresponding to the customer ad-dressed in the form.

The final stage of this application is presented in Figure 2 where we have the generated form on the left and the results of the rules on the right.



Conclusions

In this article we showed how it is possible to model a typical business prob-lem of a Telecom Company using Fluent Editor and its CNL. We showed that not only the modeling process is simple but that it is also possible to add logical rules to automatically match the suitable offer for each customer. Furthermore we saw that using the reasoning mechanism embedded in Fluent Editor, it is possible to ask for questions immediately and get back answers depending on the ontology model used.
In conclusion, the CNL we are using coupled with the simplicity of Fluent Editor, gives a way to simply create and modify complex ontologies. In our point of view, the most interesting part is that the whole CNL is compatible with known standards as OWL and SWRL thus files in these formats can be easily imported in Fluent Editor. Furthermore we have showed that, using the same logic, we were able to build a scalable web application using Ontorion.

It is possible to download the CNL example presented in this article here. This file can be opened with Fluent Editor (if you still haven't downloaded it you can do it here).


Bibliography
  • Boris Motik, R. S. (2009). Hypertableau Reasoning for Description Logics. Journal of Artificial Intelligence Research, 36:165-228.
  • Cognitum. (2014). Fluent Editor - Comprehensive tool for editing and manipulating ontologies with CNL. Retrieved from Cognitum: http://cognitum.eu/semantics/FluentEditor2/Default.aspx
  • Cognitum. (2014). Ontorion™ - a distributed knowledge management system. Retrieved from Cognitum: http://cognitum.eu/semantics/Ontorion/
  • Kaljurand, K. (2008). ACE View --- an Ontology and Rule Editor based on Attempto Controlled English. In OWLED - CEUR Workshop Proceedings (p. volume 432). Dolbear, Catherine and Ruttenberg, Alan and Sattler, Ulrike.
  • Kapłański, P. (2011). Controlled English Interface for Knowledge Bases. Studia Informatica, 84.
  • OWL- Web Ontology Language. (2014). Retrieved from http://www.w3.org/TR/owl-features/
  • SWRL: A Semantic Web Rule Language. (2014). Retrieved from http://www.w3.org/Submission/SWRL/



If you want to learn more about Fluent Editor CNL-EN grammar, visit this link.

*) FluentEditor 2, ontology editor, is a comprehensive tool for editing and manipulating complex ontologies that uses Controlled Natural Language. Fluent editor provides one with a more suitable for human users alternative to XML-based OWL editors. It's main feature is the usage of Controlled English as a knowledge modeling language. Supported via Predictive Editor, it prohibits one from entering any sentence that is grammatically or morphologically incorrect and actively helps the user during sentence writing. The Controlled English is a subset of Standard English with restricted grammar and vocabulary in order to reduce the ambiguity and complexity inherent in full English.

Simple form design (and more…) using Fluent Editor.

At Cognitum we are developing innovative business applications making use of semantic technologies that can dramatically improve company productivity. Today we would like to present a method using our technologies with which it is possible to build a complex C#-Silverlight business application using a combination of Fluent Editor and Ontorion. We will start by a simple example to better explain the potential of our approach. Then we will present a more realistic example presenting how this approach can be applied to solve common business problems.

Simple form design (and more...) using Fluent Editor.



Let’s imagine we want to make a Customer form containing a customer section with compulsory fields First-Name and Surname.  First of all we code the characteristics of the form using our Controlled Natural Language editor: Fluent Editor, obtaining the code:

Every form is a thing.
Every customer-form is a form.

Every customer-form must concern a customer.

Every customer must have-first-name (some-string-value).
Every customer must have-surname (some-string-value).

our C# application will then render the form as:


As we can see the name of the form is taken from (name)-form, the name of the section is the element concerning the form and the name of the field is taken from have-(name). Moreover as the fields have been declared in the CNL file with the must keyword, submitting the form without specifying these fields will result in an error.
Using this schema it is possible to construct all type of form fields. For example the code

Every customer must have-customer-type a customer-type.
Something is a customer-type if-and-only-if-it is either Already-Client or New-Client.


Will result in a field of type select


It is also possible to have optional checkbox fields using can or additional requirements if a certain choice is made. For example by adding the CNL code

Something is a already-client-customer if-and-only-if-it has-customer-type Already-Client.
Every already-client-customer must have-phone-number (some-integer-value).

Then after choosing the Already-Client option in the form, we will be asked for the phone-number of the customer.
Clearly using such method if we will in the future decide that a field, a field type or a field name have to be changed we can do this immediately by changing the content of the CNL file.
Another interesting consequence of using a CNL file to render the form is that after submitting the form we can easily obtain a CNL-compliant result. For example by filling out the form presented before and submitting it we will obtain a CNL code of the type

Customer-Form-0 is a customer-form.
Customer-1 is a customer.
Customer-1 is a already-client-customer.
Customer-1 has-first-name equal-to 'John'.
Customer-1 has-surname equal-to 'Dow'.
Customer-1 has-customer-type Already-Client.
Customer-1 has-phone-number equal-to '394829388'.
Customer-Form-0 concerns Customer-1.


Going yet one step further we can add to the model some simple rules that we would like the elements of the form to satisfy

Every package is-for a customer-type.
 
If a customer have-customer-type a thing and a package is-for the thing then the package is-package-for the customer.

And a simple instance of the package type:

Already-Client-Package is a package.
Already-Client-Package is-for Already-Client.

Then using Ontorion reasoner inside Fluent Editor, it is possible to ask questions like :  ‘’Who or What is-package-for Customer-1?” and the answer will be: Already-Client-Package. This can also be done automatically by the C# application using the MicroOntorion API. At this point the full potential of this method is unveiled. We will show in the next part how using this kind of approach it is possible to make a complex business application powered by Cognitum’s semantic technologies with a simple user interface intuitive to use.


If you want to learn more about Fluent Editor CNL-EN grammar, visit this link.

*) FluentEditor 2, ontology editor, is a comprehensive tool for editing and manipulating complex ontologies that uses Controlled Natural Language. Fluent editor provides one with a more suitable for human users alternative to XML-based OWL editors. It's main feature is the usage of Controlled English as a knowledge modeling language. Supported via Predictive Editor, it prohibits one from entering any sentence that is grammatically or morphologically incorrect and actively helps the user during sentence writing. The Controlled English is a subset of Standard English with restricted grammar and vocabulary in order to reduce the ambiguity and complexity inherent in full English.