{'fraction_non_alphanumeric': 0.03138148667601683, 'fraction_numerical': 0.006954184198223469, 'mean_word_length': 4.640408701384311, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Question Answering System Using Graph-Pattern Association Rules (QAGPAR) On YAGO Knowledge Base

A question answering system (QA System) was developed that uses graph-pattern association rules on the YAGO knowledge base. The answer as output of the system is provided based on a user question as input. If the answer is missing or unavailable in the database, then graph-pattern association rules are used to get the answer. The architecture of this question answering system is as follows: question classification, graph component generation, query generation, and query processing. The question answering system uses association graph patterns in a waterfall model. In this paper, the architecture of the system is described, specifically discussing its reasoning and performance capabilities. The results of this research is that rules with high confidence and correct logic produce correct answers, and vice versa


Introduction
Knowledge bases provide information about a large variety of entities, such as people, countries, rivers, etc. Moreover, knowledge bases also contain facts related to these entities, e.g., who lives where, which river is located in which city [1]. The YAGO knowledge base [2] is a commonsense knowledge base, i.e. a collection of commonly known facts and information.
YAGO was built from extraction of Wikipedia using the WordNet ontology. However, WordNet's ontology is limited, so YAGO developed their own ontology. The original YAGO evolved into YAGO2 [3] with the addition of data extracted from GeoNames, so it can describe spatial entities using spatial data from GeoNames, such as longitude and latitude. The expansion of YAGO2 into YAGO3 [4] added multilinguality; in previous versions, data were only extracted from English Wikipedia. YAGO3 also groups entities based on languages supported by Wikipedia.
Knowledge-based question answering systems can answer questions that require specialized knowledge, where much information needs to be summarized and incorporated in real time rather than just having a paragraph of text that was retrieved previously. In ontology-based question answering systems [5], the knowledge base where the answers are sought, has a structured organization defined by the ontology. Users can ask a question in natural language and the system will return accurate answers directly after analyzing the question, retrieving information and extracting the answer. Ontology-based knowledge bases provide a convenient way to gain knowledge for users, but natural languages need to be mapped into queries.
Previous research has shown that there are two major challenges in ontology-based question answering systems that need to be addressed. Firstly, to understand the intent of the user in the question analysis stage and formally represent it. Secondly, to translate these formal representations into the correct queries adapted to a formal basic ontology request scheme. The first problem can be solved through natural language processing technology, while for the second question it is very important to look closely at the ontology to get answers. The question answering system can only provide answers based on an existing dataset. The system cannot provide an answer if it is not available in the dataset. We attempted to solve this problem by using graph-pattern association rules, which allow the system to provide predictions from the rule patterns in the dataset [6].
In this paper, we describe a question answering system using graph-pattern association rules on the YAGO knowledge base. The rest of this paper is organized as follows: related work is discussed in the next section (Section 2), after which graph-pattern association rules are described in Section 3. In Section 4, we present the system architecture of the proposed question answering system using graph-pattern association rules on the YAGO knowledge base. An evaluation of the system's performance will be given in Section 5. Finally, Section 6 contains the conclusions of this paper.

RELATED WORK
A question answering system (QA system) is the process of finding the right answer to natural language questions. Such a system was first introduced in the early 1970s. It was used for problem solving in a particular domain. In QA systems, three main approaches are used: 1.
natural language processing (NLP) systems, which map user questions into formal form, ensuring to get the most relevant answers; 2. information retrieval systems, used in conjunction with natural language processing, which focus on the extraction of facts from a number of large texts; 3. template-based systems, which match questions from users with a number of templates that have been prepared to get the information needed to produce the precise answer [7].
We focused on the third approach for the following reasons. A template-based QA system extends the natural language pattern matching approach to a database. System intelligence is manifested by a collection of manually created question templates. The first QA system that Omnibase is: object-property-value. Seiders' research also used template-based questioning systems. This system uses a common question template to get relationships between knowledge domains. The system uses 24 template types. Template-based QA systems are rarely studied by academics but are successfully applied in commercial applications, such as www.ask.com, that use the START approach [7].
Adolph et al. [6] created a QA system using the YAGO KB as the dataset. It uses RDF triple data and SPARQL queries. In general, the system consists of three components namely: 1.
YAGO as repository to answer questions in RDF triple form via SPARQL; 2. A repository of text patterns and paraphrased questions compiled with two approaches: automatic processing using ClueWeb to obtain patterns connected to relationships in YAGO and collecting paraphrases for questions by crowdsourcing to humans; 3. question processing to decompose natural language questions into the form of a RDF triple pattern in SPARQL.
Moussa et al. [8] developed a QA system using the YAGO Kb that can be used to recognize questions in the form of 5W 1 H. The system was developed further to be able to convert natural language questions into RDF triple form.
Unger et al. [9] created a QA system using RDF datasets, one of which is YAGO. They used SPARQL question templates to convert the questions into RDF triple form. Their system is more about query optimization to answer questions that cannot be solved by regular or RDF triple queries. For example: What cities have more than 3 campuses? Or, mention 3 cities in Indonesia. This system creates a query pattern for such questions, which cannot be isolated with the usual RDF triple relationships. This system uses the SPARQL database.
The approach used in the above systems is different from the approach we used. Our research used graph property [10] database using neo4j as the graph data base and graph processing [11].
In neo4j graph processing using cypher query. In addition we can also provide answers even though the answer is not available in the data set by using graph-pattern association rule approach.

QAGPAR SYSTEM ARCHITECTURE
The architecture of the proposed QA system using graph-pattern association rules (QAGPAR) on the YAGO knowledge base is as follows: question classification, graph component generation, query generation, and query processing. The system uses graph-patterns in a waterfall model. Input questions in natural language are translated into the form of a graph. This is done for two important reasons: 1) the dataset uses graph properties; 2) by adopting a graph model, the searching process on the dataset will be facilitated and speeded up. Next, the query is determined based on the graph model. If the answer does not exist, then it will be processed using graph-pattern association rules. The answer to be given in accordance with the query will be translated from the graph pattern to natural language and given to the user, as shown in Figure.   Generally, the whole process of system is divided into three major phases: Question analysis. This phase processes natural language requests to obtain a formal graph representation to match the graph database. This requires several stages, such as classifying and deciphering the question. The output of the analysis is the query pattern, i.e. natural language requests are labeled with morphological information and ontology concepts.
Query processing. A given graph-shaped query pattern will be processed and executed to get the answer in node or edge form. If no answer is obtained the association graph pattern will be used to get the desired edges or nodes.
Getting the answer. This process is done to convert the nodes and edges that have been obtained into natural language and return the result to the user.
In this research we used three classes of patterns, with 37 patterns in total. Pattern I consists of 18 patterns, Pattern II consists of 18 patterns, while Pattern III consists of 1 pattern.

A. Question classification
Question classification matches the question according to the question answering system. We use the question template technique, which means that the question in natural language that is entered must match an existing template. If the question does not match any template, then the question will not be processed. The output of this section is parsing the question. The output we expect in this process is different for each pattern. In Pattern I and Pattern II, the output that is captured contains the subject and the relation to the question. The relation that is used is different for each class of patterns. Some examples of templates used are given in Table I.

B. Graph component generation
The QAGPAR system will perform the transformation of the output at the stage of question classification into graph form. For Pattern I, we get a graph component with a node and an edge, for Pattern II we get a node with a property on that node, for Pattern III we get only two nodes. This is done so that the system can interpret the query to be used correctly. The transformation is done as shown in Table II.

C. Query generation
This stage generates queries based on applying the output model to the graph components.
The complete process is shown in Table III.

D. Query processing
The next process is query execution to get the answer from the database. If the answer is not obtained, then the system will provide a notification that the answer does not exist. In contrast to the other patterns, for Pattern I, when the answer does not exist in the database, the system will optimize the query using graph-pattern association rules. For example: for Pattern I in Table 2, the following graph-pattern association rule is used:

(a)-[diedIn]->(b)<-[wasBornIn]-(c)<-[hasChild]-(d) => (a)-[isMarriedTo]->(d)
In natural language, the rule is: 1. If A has child B and D has child B, then A is married to D 2. If A acted in film B and D directed film B, then A is married to D 3. If A died in city B, C was born in city B, and D had child C, then A is married to D The three association rules each have a level of confidence. In the previous research we used 2 kinds of confidence measures, i.e. standard confidence and PCA confidence. Table 4 above gives the values of standard confidence and PCA confidence of the rules.
E. System Algorithm QAGPAR has two system checkbox interfaces, namely a normal and a graph-pattern association rule checkbox interface. The algorithm used is shown in Figure. 2. The algorithm has an input question and the output is an answer. The input question is analyzed based on the question, the kind of pattern, relation (rail), node 1 (v1), node 2 (v2), and property (prop). Questions with Pattern I have relation and node 1, while node 2 and property are empty.
Pattern II has node 1 and property node 1, while node 2 and relation are empty. Pattern III has node 1 and node 2, while relation and properties are empty. When the class of the question is known, then the next step is to find the required part. For Pattern I questions, find v2 so as to form the node and edge (v1, v2) pairs. For Pattern II, search the relation so as to form pairs of nodes and edges (v1, v2). For Pattern III, look for the value of node property v1. If any pattern finds an answer, the system will give the answer, but if no answer is found (node, edge or property value is not found), then the system will give no answer. Different from the other patterns, if no answer is found to a Pattern-I question, then we can predict an answer using graph-pattern association rules. For example: to the question 'Who is married to Malekeh_Jahan?'(Siapa pasangan dari malekeh_Jahan?), the system did not find an answer using normal search ( Figure. 3 (a)). However, when trying graph-pattern association rules, the system can predict an answer based on the association rules made. In this case, the answer is 'Malekeh Jahan is married to Shah Qajar'(Malekeh Jahan adalah pasangan Shah Qajar) ( Figure. 3(b)).

Graph pattern association rule
We use graph properties to mine association rules [10] for the following reasons: we follow Agrawal's [12] research model by starting from 1 antecedent and increasing the antecedents to 2, 3 and 4. With the tools we use [11], we can automatically search for the graph pattern of a query. However, there is a problem, i.e. there is only one edge direction. This is certainly different from the actual data in the database: the relationship can come from two sides of the subject or object.
In this section, we will explain the confidence values that we used, i.e. standard confidence and PCA confidence, which we adopted from Luis [13] and Fan [14].
Confidence. This is a measure to determine the strength of a rule. The value is between 0 and 1. A rule that has high confidence is close to 1 and vice versa.
Standard Confidence. Standard confidence (conf) is a measure of the ratio of the number of rules, R, compared to the facts we know in the form of graph pattern P (G), as in the equation (1) below: PCA Confidence. Standard confidence does not distinguish between things that are not in the dataset and wrong things that are in the dataset. In other words, standard confidence cannot distinguish between wrong facts and unknown facts. Since the knowledge base has no negative facts, we used the partial completeness approach. Luis [15] proposed to used partial completeness assumption (PCA). If r (u, w) ∈ G for nodes u and w, then: In other words, we assume that if graph G knows some x-attribute of u, then all x-attributes of u can be seen. This assumption is converted to standard confidence, obtaining:

Experimental results
In the implementation of QAGPAR, YAGO ontology version 2017-W40-2 was utilized and converted to a Neo4J graph database. Java was used for developing the system. QAGPAR can provide answers according to the pattern input used, but when using graph-pattern association rules there are some issues, which will be discussed below.
We put the question: 'Who is married to Kurt_Brändle?', the system searched for the answer in the available database. Apparently, the answer was not in the database and the system gave as output 'no answer'. However, by using association rules, the same question was asked again to   test results showed that 90% of the answers were correct. 10% of the answers were wrong because there was one rule with incorrect logic, namely: 'If B is a citizen from country A, and B graduates from campuses C and D works on campus C, then D is a citizen of A.' For rules that have confidence below 0.5, 90% of the answers given are wrong, while only 10% of the answers are correct, because the rule is logically incorrect, for example: 'If A died in city B, C was born in city B, and C is the leader of country D, then A is a citizen of D.'

Conclusion
The introduction of huge structured knowledge repositories has opened up opportunities for answering questions, even when the answers are not in a database. In this study, graph-pattern association rules involving multiple relations between entities were used by operating directly on the semantic representations rather than finding answers in natural language. Query languages for accessing these repositories are well-established; however, they are too complicated for non-technical users, who would prefer to pose their questions in natural language. We have presented the QAGPAR system, which gives access to the accumulated knowledge of Wikipedia via the automatically acquired YAGO knowledge base. Our results showed that confidence values above 0.5 will give the correct answer and confidence values below 0.5 will give false results. However, the value of confidence alone is not enough to get the correct answer. Another important factor is the logic of the rules. Rules that have correct logic tend to give right answers, even when the confidence value is low. Rules that have incorrect logic tend to give wrong answers, even if the confidence value is high.