Ontology is how we represent concepts and their relationships within a certain domain. In machine learning, it provides a structured mechanism for data representation. It encompasses all objects, their attributes, behavior, and the constraints that manipulate interactions between objects. Let’s break this down for simplicity.
Consider we have a friend who is a tech-savvy smartphone enthusiast and can provide rational and genuine suggestions for purchasing any smartphone simply because they're well-versed in the newest market trends—the newest phones launched, their specifications, what brand launched them, and any hiccups encountered while using them. Now, if someone asked us that much detail about a smartphone, we would not be able to answer it with such accuracy as this friend of ours—the difference between a novice and an expert. This friend of us is the walking-talking example of ontology—an expert on data and the relationships within it. Ontology provides data in a very organized and logical manner so that machine learning models leverage the data provided to them to the fullest without getting lost in its intricacies.
Let’s move on to the next section, where we discuss ontology in detail.
Ontology is an organized way of categorizing and describing any domain knowledge. Ontology lays down the basis for forming conceptualizations for a machine learning model because it makes data interpretation easier. For any object, we discuss the following three things:
Class: A class is a representation of a concept within that domain. It’s basically a collection of objects. Anything that can be given a name can be considered an object.
Relation: They describe the relationship between objects. For example, as we’ll see for the Employee domain in Educative, the project manager’s relationship with the employee is that of “isA’’ . At the end of the day, the project manager is still an employee.
Properties: Properties constitute the attributes of an object, suppose being candid and trusting your team members could be key qualities of a project manager.
Axioms: Axioms help us make assumptions using factual data.
We take the example of an “Employee’’ object. An “Employee’’ is a generalized object that can take many forms; an “Employee’’, more specifically, can be a “Project Manager’’, a “Junior TCE’’, a “Senior TCE’’ and even a “Content reviewer.’’ Thus, the relation between a “Project Manager’’ and an “Employee’’ will be “isA.’’
This goes both ways, a “Project Manager’’ is also an “Employee’’ at the end of the day.
The following diagram illustrates the above-mentioned concepts.
The following is a basic employee dataset that we’ll use to pinpoint classes and their relationships.
For the above dataset, the classes are: employee ID, employee, designation, and tasks. As a best practice, any noun can be considered a class. The relationships between the objects of these classes are:
Employee hasAn EmployeeID
Employee isAssigned Designation
Employee isAlotted Task
Knowledge graphs are the representation of connected objects. This representation is both human and machine-readable. The best part about them is they can remodel themselves with the addition of new data. In other words, knowledge graphs are dynamic and don’t require manual updates.
Extracting entities or classes can be done with Named Entity Recognition, while relations can be determined using Relation Classification. Let’s create one for the above data!
Scenario search utilizes classes and objects to define objects. This function creates scenarios from objects’ properties and their relations. It essentially solves the problem that arises from data curation via a hierarchy of labels; data labels do not identify specific problems in a data scenario because the labels are too generalized.
Ontologies help create features in machine learning by transforming concepts and relationships into important features. In the healthcare industry, disease diagnosis is carried out by models trained on features extracted from that disease’s attributes and symptoms.
Ontologies can increase the decision-making power of intelligent systems. Based on predetermined rules and relations, a decision support system can easily comprehend complex situations and make better decisions. Ontology greatly assists finance departments where ontology can mentor AI-based systems to recommend appropriate investment plans based on the customer’s risk tolerance and financial objectives.
Solve the following challenge to see if you have understood ontology. It is recommended to solve the problem independently, without looking at the solution first. Also, note that your answer might not exactly match the provided answer; this is an open-ended question where multiple answers can be correct.
Create an ontology for a smartphone recommender system.
Hint: If you don’t know where to start, create appropriate classes and the relations between them.
Free Resources