We have performed selectional Preferences by using the relationships in the knowledge graph triples to embed entities and relations.

The first problem is encoding relations using conventional dimension settings. The overall embedding size would be too big because there are many relations between words. In addition, finding the selectional preference score between two entities of a triple by comparing their multiplex word embedding vectors is another difficulty.

Different parameters have been used in other methods of selectional preferences. For example, in research (Zhang et al., 2019), the three parameters nsubj, dobj, and amod represent the preferences of the model. Nevertheless, since the preference in our model is based on the types of relations in the triples of the knowledge graph, the relation types play the role of embedding parameters of selectional preferences. In the knowledge graph, Farspredict that we used in this project, there are 392 relation types; we want to mention a few cases with a large number of triples. We can mention these types of relations: starring, phylum, and deathPlace.

## 4.3. Results

In the research conducted to detect triple relationships in a graph structure. Therefore, the selected classes are based on triples’ relation type. Reviewing the obtained results and re-reviewing the article (Zhang et al., 2019), found that the dataset used for word embedding affects the scores. Considering that knowledge graph triples are used for learning, the relation scores obtained from the implementation are more than other datasets. Our knowledge graph is sparse, and this characteristic harms the quality of the results. If the scattering were smooth, clearly better results would be obtained.

For example, the sample result for birthplace relations type is demonstrated in Fig. 2.

Figure 2 demonstrates the relationship score of people's names entities with different cities and places according to the area of birth. For example, Mr. Corneille Heymans was born in the city of Ghent with a probability of 95% and in the Flanders region with a probability of -0.14. The reason for obtaining these possible values is that the object of Ghent was seen five times, but Flanders is seen only once in the objects of the birthplace relationship. Another example: Cumbria object has been seen once as the object. But the existence of England has many repetitions in the role of object. Therefore, the possibility that Bob Benson is in a relationship with England is high.

In order to better understand the results presented in Fig. 2, it is necessary to understand the basis on which these results were obtained. Cosine similarity was used to calculate the degree of similarity between two embedding vectors that relate to the subject and object. This value measures the degree of similarity between two non-negative vectors in a multidimensional space. Cosine similarity measures the value of cosine between the angles of two vectors, which can be interpreted as the degree of similarity of two vectors. The range of cosine similarity is between − 1 and 1. The closer the cosine similarity value is to 1, the more similar the vectors are to each other. In this calculation, a value of 1 indicates that the two vectors are exactly similar to each other, a value of -1 indicates that the two vectors are in the opposite direction, and a value of 0 indicates that the two vectors are perpendicular to each other.

*A. Results Discussion*

The implementation carried out on Farspredict categorizes pairs of entities based on relation type. In fact, we will have as many classes as there are relation types. In this output, sp_score and base_score are calculated for each pair of entities. The results show the degree of dependence of these two entities based on each relation type.

Since the analysis is on triples that are each in the same relation type, the value of sp_score is high, and this is influenced by the type of our dataset, the knowledge graph. Therefore, the sp_score is more suitable for analyzing the dependence between two entities' semantic degree.

*B. Evaluation Protocol*

For the evaluation of SP models, researchers have exploited some kinds of tasks. The results of these evaluations are presented by some metrics that explain how much our results have improved.

*Evaluation Metrics*: Conventionally, semantic classification on knowledge graph triples should be evaluated by some metrics. In this part, we use sp_score as selectional preferences score function for our method. In addition, we use pseudo-disambiguation to evaluate the results of selectional preferences.

**sp_score**: This score shows the degree of pairing two entities in a specific relation type. This amount is obtained based on the frequencies of pair’s entities with the mentioned relation type. This score is calculated by Cosine similarity as mentioned in Eq. 4.

$$Cos\left(embeddedSubj,embeddedObj\right)=\frac{embedded\_Subj\cdot embedded\_Obj}{\left|\right|embedded\_Subj\left|\right|\cdot \left|\right|embedded\_Obj\left|\right|}$$

4

This formula calculates the Euclidean distance between two displacement vectors (embedded subject and embedded object).

**Pseudo disambiguation**

This method selects positive SP tuples from the knowledge graph and generates negative SP tuples by randomly replacing the head or tail [36]. As a result, pseudo-disambiguation only evaluates how well the model fits the knowledge graph rather than evaluating the SP acquisition models based on ground truth (human-labeled datasets). This method evaluates two-way and three-way modes.

In the two-way mode, it tries to determine which object is more appropriate for a verb. For this purpose, it adds a corrupt pair for each verb-object pair, which replaces the object with a random object. Two examples of correct pairs and their random replacement are given in Table 2.

Table 2

2-way pseudo-disambiguation tuple examples

V | O | O’ |

Cinematography | فیلم کلبه | فیلم نیومکزیکو |

Starring | فیلم خون بها | فیلم زمهریر |

* The table displays two examples of tuples, which consist of the names of two movies - The Shack (فیلم کلبه) and Blood Money (فیلم خونبها). These names have been replaced by the names of the movies New Mexico (نیومکزیکو) and Zamhrir (زمهریر), respectively, in order to create two new negative samples.

The three-way evaluation is based on the probability of a subject and an object appearing with a verb. The value of original triples is expected to be more than the corrupt ones of o’ and s’. Two example tuples are shown in Table 3.

Table 3

3-way pseudo-disambiguation tuple examples

V | O | S | O’ | S’ |

starring | فیلم چراغ های جمعه شب | جی هرناندس | فیلم اگر بمانم | والترهایتلر |

occupation | تام هیدلستون | بازیگر | کلودت کالبرت | سیاستمدار |

* The table shows two examples of tuples. One of them contains the name of the actor Jay Hernandez (جی هرناندس), who plays a role in the movie Friday Night Lights (چراغ های جمعه شب). This tuple is used to create a negative sample with the name Walter Heitler (والترهایتلر), and the name of the movie "If I Stay" has already been replaced. Additionally, the tuple has determined Tom Huddlestone's job (تام هادلستون) as an actor (بازیگر). To make another negative example, the parts of this tuple have been replaced with Claudette Colbert (کلودت کولبرت)'s job as a politician (سیاستمدار).

**Pseudo-disambiguation 3-way mode algorithm**

This algorithm demonstrates how to calculate the evaluation of pseudo-disambiguation in a three-way mode, where the correct triple should have a higher value of selectional preferences compared to the other three negative samples. All negative samples are verified to ensure they are not actual triples in the knowledge graph.

numSamples ← 0

**while** (h, r, t) **do**

**if** (SP(h, r, t) > SP(h′, r, t)) and (SP(h, r, t) > SP(h, r, t′)) and (SP(h, r, t) > SP(h′, r, t′)) **then**

accuracy ← (accuracy + 1)

**end if**

num_samples ← (num_samples + 1)

**end while**

$$Accuracy \leftarrow \frac{accuracy}{\text{n}\text{u}\text{m}\text{S}\text{a}\text{m}\text{p}\text{l}\text{e}\text{s} }$$

The accuracy obtained in Algorithm I is calculated by dividing the number of correct triples by the total number of triples for each relation type containing correct triples and negative triples obtained by replacing the entities at the head or tail.

**Evaluation Results**

We initiated this research to depict the application of SP over the corresponding Persian KG. To do so, we proposed SP-KG as a three-phase embedding method. As discussed in section 2, we applied SP of our Persian KG’s triples and found out how much each pair of entities (head and tail), based on a relation, prefer to display with each other as a triple.

We compare the results of pseudo-disambiguation using word2vec (Mikolov et al., 2013), Glove (Pennington et al., 2014), and Multiplex word embedding (Zhang et al., 2019) for calculating selectional preferences. Additionally, we evaluate the results of pseudo-disambiguation when using multiplex word embedding with the SP-10k dataset, which is a human-labeled dataset used to assess the performance of selectional preferences with MWE using spearman correlation.

**Knowledge graph SP evaluation with pseudo-disambiguation**

The proposed method in section 3 was implemented in two-way and three-way modes using the evaluation tool pseudo-disambiguation. Initially, all triples involved in the evaluation, as depicted in the knowledge graph, were taken into account, after which the average was computed. The accuracy results of SP-KG that are conducted by pseudo disambiguation achieved in two types of 2-way and three-way which are shown in Fig. 3 and Fig. 4. The values are sorted in ascending order by the accuracy of each relation type. After analyzing the knowledge graph and the result, the research team concluded that this average could not be reliable due to the diversity of the number of triples for each relation type. For example, for one relation type, there are 70,000 triples in the knowledge graph, and for another relation, there are just five ones. Therefore, we switched to the weighted average method. The results of both types of evaluation are shown in Table 4.

Table 4

Proposed method by pseudo-disambiguation

Method | Accuracy |

| Two-way | Three-way |

SP-KG | 0.63449 | 0.49531 |

Word2Vec | 0.45420 | 0.22532 |

Glove | 0.45803 | 0.22641 |

SP10k dataset | 0.66930 | 0.51369 |

The three-way evaluation is based on the probability of a subject and an object appearing with a verb. The value of original triples is expected to be more than the corrupt ones of o’ and s’. Two example tuples are shown in Table 3.

**Word2vec evaluation with pseudo-disambiguation**

Employing the word2vec technique serves as a pivotal component of our study, facilitating a comprehensive exploration of the intricate relationships between entities within the Farspredict knowledge graph (Mikolov et al., 2013). This sophisticated technique operates by generating distinct vectors for each entity, thereby capturing the nuances and degrees of association between them. A distinguishing feature of word2vec is its context-independent nature, enabling the creation of vectors irrespective of the part of speech or varied meanings associated with words. The versatility of this technique lies in its ability to seamlessly amalgamate diverse meanings into a unified vector representation.

In tandem with the Semantic Parsing (SP) methodology, we embark on a comparative analysis by extending our exploration to include word2vec. This approach serves as a robust benchmark to evaluate and contrast the outcomes derived from SP. The implementation of the word2vec technique on the Farspredict knowledge graph allows us to delve deeper into the semantic relationships embedded within the dataset. To enhance the precision of our analysis, we employ the pseudo-disambiguation method, adding a layer of sophistication to our evaluation framework.

By intertwining SP and word2vec within our study, we transcend the boundaries of traditional knowledge graph exploration, offering a nuanced understanding of the semantic intricacies present within the Farspredict dataset. This comparative analysis not only contributes to the refinement of entity relationships but also provides valuable insights into the complementary strengths and unique attributes of each technique in the context of Persian language semantics.

**Glove evaluation with pseudo-disambiguation**

Conducting an in-depth evaluation using Glove with a pseudo-disambiguation approach marks a significant stride in assessing the efficacy of word representation techniques. This innovative method excels in capturing the nuances of global words, leveraging an unsupervised approach designed by Stanford. The underlying principle involves the generation of word embeddings by aggregating a comprehensive word-word co-occurrence matrix derived from the corpus (31). In our pursuit of advancing knowledge graph exploration, we applied the Glove technique to the Farspredict Persian knowledge graph, employing it as a benchmark to evaluate the outcomes of our proposed method.

The Glove evaluation on Farspredict served as a crucial comparative analysis, shedding light on the strengths and nuances of our novel approach. This strategic evaluation is encapsulated in the results presented in Table 4, offering a comprehensive overview of the comparative performance metrics. The utilization of Glove as a reference point accentuates the unique contributions and potential advancements brought forth by our proposed method.

As we delve into the intricacies of pseudo-disambiguation coupled with Glove evaluation, we embark on a journey to not only validate the robustness of our approach but also to discern the nuanced variations in word representation within the context of the Persian language. This multifaceted evaluation not only contributes to the refinement of word embeddings but also sets the stage for a nuanced understanding of the complexities involved in capturing the semantic relationships encapsulated within the Farspredict knowledge graph.

**SP10K evaluation with pseudo-disambiguation**

As mentioned in section 2 as one of the related works, SP-10K is a dataset introduced for selectional preferences in 2019. In order to compare the performance of our proposed method with the method presented by Zhang and his colleagues in research (Zhang et al., 2019), we implemented our proposed method on this dataset. Table 4 shows the results of this evaluation.

The proposed method encompasses the values of both evaluation metrics. As seen in Table 4, the accuracy of both two-way and three-way is more than other tested techniques, indicating appreciative performance. By examining Fig. 5, we can see that the proposed model performs better than all the other five methods.