# A Knowledge and Semantic Fusion Method for Automatic Geometry Problem Understanding
## 5 Information Detect and Interpret Model
### Text-Level ERE and IDIM-T
#### 5.1.3 Relationship Extraction
(1) Knowledge Linking Module  
IDIM-T establishes a connection with SGKO. IDIM-T submits the keyword \(kw\) to SGKO, which retrieves the relationship type \(rt\) based on the \(kw\) and establishes a link between IDIM-T and the \(rt\) node, allowing IDIM-T to access all knowledge about \(rt\). Denote all knowledge of \(rt\) as \(knowledgeTree_{rt}\). Let \(rt\gets kw\) denote obtaining \(rt\) based on \(kw\). (2) Relationship Detection Module  
Detection of Relationship Existence in a Clause. Let \(KW=KW_{Autonomous}\cup KW_{Dependent}\) be the set of all relationship keywords. If the clause \(c\) contains any \(kw\in KW\), then there is a relationship mention in \(c\), and the ordered list of all keywords in \(c\) is obtained as \(KW_{c}\). Detection of Attached Relationship in Ternary Relationships. For \(c\), take the text fragment \(c^{\prime}\) from the current \(kw\) up to the next \(kw_{autonomous}\) or to the end of the sentence. Detect if there is any \(kw^{\prime}\in KW_{tranway}^{Attached}\) within \(c^{\prime}\). If \(kw^{\prime}\) exists, the clause \(c^{\prime}\) contains a mention of an attached relationship; otherwise, \(c\) only mentions the core relationship. (3) Template Matching Module  
IDIM-T generates a relationship matching template \(t\) based on \(kw\), and searches and extracts the arguments of the relationship according to the templates. This process is called template matching. Relationship Matching Template Generation. IDIM-T indexes the \"Core Keyword\" in \(knowledgeTree_{rt}\) to find the \(kw\), and then indexes to \(RSF_{kw}\). The first unused \(rsf\) in the ordered \(RSF_{kw}\) is taken as the framework of the template. Then, IDIM-T fills the template framework with knowledge attributes from \(knowledgeTree_{rt}\) to form a usable template \(t\). An illustration is shown in Figure 8.  
**Definition 10** (Relationship Matching Template). : _A relationship matching template \(t\) uses \(RSF\) as a frame and is essentially a list of records documenting the relative positional relationships between a series of relationship argument role information and specific keywords \(kw*\). Each record is formally represented as \(record=(ar,et,pos)\in t\). Here, \(ar\in\{subject,object,additionalentity\}\) represents the type of the argument role of entity \(e\), \(et\) represents the entity type of \(e\), which comes from preset knowledge attributes, and \(pos\) indicates the relative position between \(e\) and \(kw*\) with the keyword \(kw*\) as the reference point._  
Table 6 uses RSFs of Perpendicular as an example (refer to Figure 7), illustrating the template and its formal representation. Figure 8: Example of Perpendicular relationship matching template construction. Argument Searching. As for searching an argument entity, IDIM-T, according to \(record=(ar,et,pos)\in t\), starts from the position of \(kw\) in \(c\) and searches in the direction specified by \(pos\) for an entity mention of type \(et\). This entity is the one that plays the argument role \(ar\) in the relationship. Argument Slot Entity Quantity Detection. When an entity is found that matches the \(record\), IDIM-T first performs an argument slot entity quantity detection before extracting the entity. There is a preset conjunction table in IDIM-T that contains possible conjunctions. After exploring and finding a matching argument entity according to the \(record\), an entity boundary check is performed to see if there are conjunctions at the boundaries of the current entity to determine if it is a case of multiple entities mentioned in a single slot. Argument Entity Extraction. Argument entity extraction operates based on the relationship matching template, distinguishing between single and multiple argument entities. Single Argument Entity Extraction extracts a single entity mentioned in an argument slot, represented formally by entity mention (EM), \(ename\leftarrow EM(ar,et)\), where \(ar\) is the argument role, \(et\) is the entity type, and \(ename\) is the entity name.