\documentclass[english]{jnlp_3.5}
\usepackage{jnlpbbl_2.2}
\usepackage[dvipdfmx]{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{url}
\usepackage{hangcaption_jnlp}
%%%%\usepackage{udline}
%%%%\setulminsep{1.2ex}{0.2ex}
%%%%\let\underline=\ul
\allowdisplaybreaks


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% author's definition
%%%%\usepackage{times}
%%%%\usepackage{url}
%%%%\usepackage{latexsym}
%%%%\renewcommand{\UrlFont}{\ttfamily\small}
%%%%\usepackage{microtype}
%%%%\usepackage{times}
%%%%\usepackage{latexsym}
\usepackage{lingmacros}
%%%%\usepackage{amsmath}
%%%%\usepackage{graphicx}
%%%%\usepackage{array, tabularx, caption, boldline}
%%%%\usepackage{cellspace}
%%%%\usepackage{url}
\usepackage{makecell}
%%%%\usepackage{multirow}
%%%%\usepackage{xcolor}
%%%%\usepackage{subcaption}
\usepackage{booktabs}
%%%%\usepackage{comment}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
%%%%\usepackage{lipsum}
%%%%\newcommand\blfootnote[1]{%
%%%%  \begingroup
%%%%  \renewcommand\thefootnote{}\footnote{#1}%
%%%%  \addtocounter{footnote}{-1}%
%%%%  \endgroup
%%%%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Volume{29}
\Number{4}
\Month{December}
\Year{2022}
%%%%\Issuetitle{Special Issue: XXXXXXXX}

\received{2022}{4}{1}
\revised{2022}{7}{30}
\accepted{2022}{9}{8}

\setcounter{page}{1138}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\esubject{General Paper}
\etitle{Universal Graph based Distantly Supervised Relation Extraction}
\eauthor{Qin Dai\affiref{tohoku} \and Benjamin Heinzerling\affiref{tohoku}\affiref{aip} \and Naoya Inoue\affiref{stony} \and Kentaro Inui\affiref{tohoku}\affiref{aip}} 
\eabstract{%
This paper explores how the Distantly Supervised Relation Extraction (DS-RE) can benefit from the use of a Universal Graph (UG), the combination of a Knowledge Graph (KG) and a large-scale text collection. A straightforward extension of a current state-of-the-art neural model for DS-RE with a UG may lead to degradation in performance. We first report that this degradation is associated with the difficulty in learning a UG and then propose three training strategies: (1) Path Type Adaptive Pretraining, which sequentially trains the model with different types of UG paths; (2) Path Type-wise Local Loss, which is an alternative approach of the Path Type Adaptive Pretraining to generate UG path type-wise local error signals so as to prevent the reliance on a single type of UG path; and (3) Complexity Ranking Guided Attention mechanism, which restricts the attention span according to the complexity of UG paths so as to force the model to extract features not only from simple UG paths but also from complex ones. Experimental results on both biomedical and NYT10 datasets prove the robustness of our methods and achieve a new state-of-the-art result on the commonly used NYT10 dataset. The code and datasets used in this paper are available at \url{https://github.com/baodaiqin/UGDSRE}. In addition, a DS-RE toolkit developed based on this work is available at \url{https://github.com/baodaiqin/UKG-RE}.
}
\ekeywords{Relation Extraction, Distant Supervision, Knowledge Graph, Universal Graph, Multi-hop Reasoning, Curriculum Learning}

\headauthor{Dai et al.}
\headtitle{Universal Graph based Distantly Supervised Relation Extraction}

\affilabel{tohoku}{}{Graduate School of Information Sciences, Tohoku University}
\affilabel{aip}{}{RIKEN Center for Advanced Intelligence Project}
\affilabel{stony}{}{Department of Computer Science, Stony Brook University}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\maketitle


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}

Relation Extraction (RE) is an important task in Natural Language Processing (NLP). RE aims to turn unstructured texts into structured Knowledge Graph (KG), which is typically stored as ($e_1$, $r$, $e_2$) triplets, where $e_1$ is a \textit{head entity}, $r$ is a relation and $e_2$ is a \textit{tail entity}, such as (\textit{aspirin}, \textit{may\_treat}, \textit{pain}) and (\textit{Guy Maddin}, \textit{place\_lived}, \textit{Winnpeg}). RE can be formulated as a classification task to predict a predefined relation $r$ from entity pair $(e_1,e_2)$ annotated evidences. 

One obstacle that is encountered when building a RE system is the generation of a large amount of manually annotated training instances, which is expensive and time-consuming. For coping with this difficulty, \citeA{mintz2009distant} propose Distant Supervision (DS) to automatically generate training samples via linking KGs to texts. They assume that if ($e_1$, $r$, $e_2$) is in a KG, then all sentences that contain ($e_1$, $e_2$) (hereafter, \emph{sentence evidences}) express the relation $r$. It is well known that the DS assumption is too strong and inevitably accompanies the wrong labeling problem, such as the sentence evidences (\ref{sent:wronglabel} and \ref{sent:wronglabel_gen}) below, which fail to explicitly express \textit{may\_treat} and \textit{place\_lived} relation respectively.
\eenumsentence{
    \item {\it The tumor was remarkably large in size, and \textbf{pain}$_{e_2}$ unrelieved by \textbf{aspirin}$_{e_1}$.} \label{sent:wronglabel}
    \item {\it \textbf{Aspirin}$_{e_1}$ is widely used for short-term treatment of \textbf{pain}$_{e_2}$, fever or colds.} \label{sent:goodlabel}
}
\enumsentence{
    {\it He is now finishing a documentary about \textbf{Winnipeg}$_{e_2}$, the final installment of a personal trilogy that began with ``Cowards Bend the Knee'' (a 2003 film that also featured a hapless hero named \textbf{Guy Maddin}$_{e_1}$).}
    \label{sent:wronglabel_gen}
}
\enumsentence{
    {\it To evaluate initial combination therapy with metformin plus \textbf{Colesevelam HCI}$_{e_1}$, in drug-naive Hispanic patients with \textbf{Type 2 Diabetes}$_{e_2}$ ...}
    \label{sent:wronglabel_bio}
}


Recently, neural network models with attention mechanism have been proposed to alleviate the wrong labeling problem via attending informative sentence evidences such as (\ref{sent:goodlabel}) \cite{lin2016neural,ji2017distant,du2018multi,jat2018improving,han2018neural,han2018hierarchical}.
However, there is a large portion of entity pairs that lack enough informative sentence evidences that explicitly express their relation.
This makes Distantly Supervised Relation Extraction (DS-RE) further challenging \cite{sun2019leveraging}.

For compensating the lack of informative sentence evidences, \citeA{dai2019incorporating} utilize multi-hop paths connecting a target entity pair (hereafter, \emph{path}) over a KG as extra evidences for DS-RE and report its effectiveness on performance improvement.
%%%%An example of such multi-hop KG path can be seen in Figure~\ref{fig:kgexam}, 
    An example of such multi-hop KG path can be seen in Figure~\ref{fig:kgexam_ugexam}a, 
where $p_1$ depicts a multi-hop KG path of the form of {\it $e_1$ $\underrightarrow{\textit{component\_of}}$  $e_3$ $\underrightarrow{\textit{may\_treat}}$ $e_2$}. The KG path is then used for predicting the relation between the target entity pair ($e_1$, $e_2$), which is not clearly described in the sentence evidence \ref{sent:wronglabel_bio} above.
However, KGs are often highly incomplete \cite{min2013distant} and may be too sparse to provide enough informative paths in practice, which may hamper the effectiveness of multi-hop paths. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 1
\begin{figure}[t]
\begin{center}
\includegraphics{29-4ia4f1.pdf}
\end{center}
%%%%\label{fig:kgexam}
%%%%\label{fig:ugexam}
\hangcaption{(a) KG-based path, (b) our UG-based path, where \textbf{Colesevelam HCl} and \textbf{Type 2 Diabetes} are the target entities, \textbf{COLESEVELAM ...}, \textbf{Colestipol} and \textbf{hyperglyceridemia} are intermediate entities, each UG path consists of multiple hops and each hop represents a KG relation (such as ``\textit{Colestipol may treat hyperglyceridemia}'') or Text (or Textual) relation (such as \textsf{TR1} and \textsf{TR2}), which is the sentence containing two (target or intermediate) entities.}
\label{fig:kgexam_ugexam} 
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Given this background, in this study, we take one step further, aiming for inducing maximal signals of distant supervision from both a KG and a large text collection (hereafter, \emph{Text}).
For this purpose, we consider using multi-hop paths over a Universal Graph (UG) as extra features for DS-RE. 
Here, we define a UG as a joint graph representation of both KG and Text, where each node represents an entity from KG or Text, and each edge indicates a KG or Textual relation, 
%%%%as shown in Figure~\ref{fig:ugexam}. 
    as shown in Figure~\ref{fig:kgexam_ugexam}b. 
The path $p_2$ in the figure is an example of UG path comprised of a textual edge \textsf{TR1}, a KG edge \textit{may\_treat}, and another textual edge \textsf{TR2}. 
By augmenting the original KG with textual edges, one can expect far more chances to find informative path evidences between any given target entity pairs, because the number of such textual edges is likely to be much larger than the number of KG edges (Note that one can collect as many textual edges as needed from a raw text corpus with an entity linker).
Extending a KG to a UG, therefore, may allow a DS-RE model to learn richer distant supervision signals. 

The idea of using multi-hop paths over a UG is not necessarily new on its own. 
For example, \citeA{toutanova2015representing} propose to use a UG for knowledge graph completion, and \citeA{das2017question} propose a model trained to reason over a UG for question answering. 
However, there is no prior study that has explored the effective way to use a UG for the task of DS-RE from text. 
In fact, finding an effective way of using a UG for DS-RE is not as simple as it may seem. 
As we report in this paper, a straightforward extension of the model propsed by \citeA{dai2019incorporating} to the UG setting (as shown in Figure~\ref{fig:ugmodexam}) may result in performance degradation. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 2
\begin{figure}[b]
\begin{center}
\includegraphics{29-4ia4f2.pdf}
\end{center}
\caption{A UG-based framework for DS-RE task.}
\label{fig:ugmodexam}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Motivated by this, in this paper, we address how one can make effective use of UG for DS-RE. 
We first report our observation that a straightforward extension of the \cite{dai2019incorporating} model to the UG setting tends to allocate the majority of attention to only a limited set of UG paths such as short KG paths and miss out the learning from a wide range of UG paths (\S\ref{sec:attbia}), which hinders performance gain.
In order to alleviate the negative effect of the attention bias and realize the potential of UG paths for DS-RE, we propose three training  (or debiasing) strategies: (1) Path Type Adaptive Pretraining (\S\ref{sec:pre}), (2) Path Type-wise Local Loss, both of them aim to improve the adaptability of the model to various UG paths; and (3) Complexity Ranking Guided Attention mechanism (\S\ref{sec:rank}), which enables the model to learn from both simple and complex UG paths. Experimental results on both biomedical and NYT10 \cite{riedel2010modeling} datasets prove that: (1) UG paths have the potential to bring performance gain for DS-RE as compared with KG paths; (2) the proposed training methods are effective to fully exploit the potential of UG paths for DS-RE because the proposed methods significantly and consistently outperform several baselines on both datasets and especially achieve a new state-of-the-art result on the commonly used NYT10 dataset. The code and datasets used in this paper are available at \url{https://github.com/baodaiqin/UGDSRE}. In addition, we have developed a DS-RE toolkit based on this work for further practical usages, and released it at \url{https://github.com/baodaiqin/UKG-RE}.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Related Work}

To improve the performance of a model for DS-RE, recently, researchers introduce various attention mechanisms. \citeA{lin2016neural} propose a relation vector based attention mechanism. \citeA{jat2018improving,du2018multi} propose multi-level (e.g., word-level and sentence-level) structured attention mechanism. \citeA{ye2019distant} apply both intra-bag and inter-bag attention for DS-RE. \citeA{han2018hierarchical} propose a relation hierarchy based attention mechanism. \citeA{han2018neural} propose a joint model that adopts a KG embeddings based attention mechanism. \citeA{jia2019arnor} propose an attention regularization framework to select informative sentence evidences for DS-RE. However, these models rely only on noisy sentence evidences from DS, neglecting the rich UG paths for DS-RE.

Besides the sentence evidences from DS, researchers also leverage external evidences for DS-RE. 
\citeA{ji2017distant,hu-etal-2019-improving} apply entity descriptions as extra evidences, \citeA{lin2017neural} utilize multilingual text as extra evidences and \citeA{vashishth2018reside} use multiple extra evidences including entity types, dependency and relation alias information for DS-RE. \citeA{alt2019fine} utilize pretrained language model as background information for DS-RE. \citeA{sun2019leveraging} apply relational table extracted from Web as supplementary evidences for DS-RE. 

To apply DS-RE beyond sentence boundary, \citeA{quirk2017distant} utilize syntactic information to extract relation from neighboring sentences. \citeA{zeng2017incorporating} apply two-hop KG paths
identified from two-hop textual paths as extra evidences for DS-RE. Different from this work, we directly use the rich UG paths as extra evidences.
\citeA{dai2019incorporating} extend the framework of \cite{han2018neural} by introducing multiple KG paths as extra evidences for DS-RE. \citeA{neelakantan-etal-2015-compositional,das2017chains} use multiple reasoning paths over Text and KG for relation prediction in the paradigm of Knowledge Graph Completion. Our work differs from the ones mentioned above in two ways: (i) We utilize the UG paths as extra evidences for the task of DS-RE from text, moreover, (ii) we take into account the factor of attention bias while encoding UG paths and propose three effective debiasing methods to exploit the potential of UG paths for DS-RE.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Base Model}
\label{sec:evencoder} 

We select the DS-RE model proposed by \citeA{dai2019incorporating} as our base model and extend it into our UG setting. Given a target entity pair $(e_1, e_2)$, a bag of corresponding sentence evidences $S_r=\{s_1,...,s_n\}$ and a bag of UG paths $P_r=\{p_1,...,p_m\}$, the base model aims to measure the probability of $(e_1, e_2)$ having a predefined relation $r$ (including the empty relation NA).
The base model consists of four main modules: KG Encoder, Sentence Evidence Encoder, Path Evidence Encoder and Relation Classification Layer, as shown in Figure~\ref{fig:ugmodexam}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 3
\begin{figure}[t]
\begin{center}
\includegraphics{29-4ia4f3.pdf}
\end{center}
\hangcaption{Overview of the base model and our proposed Complexity Ranking Guided Attention mechanism (\S\ref{sec:rank}). The base model takes the sentence evidences (e.g., $s_1$, ...) containing a target entity pair and the UG paths (e.g., $p_1$, ...) connecting the entity pair as input for predicting their relation. The KG embeddings of the entity pair (i.e., $\mathbf{h}$ and $\mathbf{t}$) are used for calculating the attention over these sentences and paths. The Complexity Ranking Guided Attention mechanism is proposed to force the model to attend both simple UG paths (e.g., $p_1 \sim p_j$) and complex ones (e.g., $p_{m-j+1} \sim p_m$).}
\label{fig:proposed_model}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{KG Encoder}

Suppose we have a KG containing a set of fact triplets $\mathcal{O}=\{(e_1, r, e_2), ...\}$, where each fact triplet consists of two entities $e_1, e_2 \in \mathcal{E}$ and their relation $r \in \mathcal{R}$. Here $\mathcal{E}$ and $\mathcal{R}$ stand for the set of entities and relations respectively.

The KG Encoder then encodes $e_1, e_2 \in \mathcal{E}$ and their relation $r\in\mathcal{R}$ into low-dimensional vectors $\mathbf{h}$, $\mathbf{t}$ $\in R^d$ and $\mathbf{r}$ $\in R^d$ respectively, where $d$ is the dimensionality of the embedding space. The KG Encoder adopts TransE \cite{bordes2013translating} to score a given triplet. Specifically, given a triplet $(e_1, r, e_2)$, TransE evaluates its plausibility via Equation~\ref{eq:kgc2}:
\begin{align}
f_r(e_1,e_2) & = b - \|\mathbf{r}_{ht}-\mathbf{r}\|_1, \label{eq:kgc2} \\
\mathbf{r}_{ht} & = \mathbf{t} - \mathbf{h}, \label{eq:transe1}
\end{align}
where $b$ is a bias constant, $\|.\|_1$ is $L_1$ norm and $\mathbf{r}_{ht}$ is a latent relation embedding for $(e_1, e_2)$.
The conditional probability can be formalized over all fact triplets $\mathcal{O}$ as follows:
\begin{gather}
\mathit{P}(e_1, r, e_2|\theta_{\mathcal{E}}, \theta_{\mathcal{R}}) = \mathit{P}(r|(e_1, e_2), \theta_{\mathcal{E}}, \theta_{\mathcal{R}}) + \mathit{P}(e_1|(r, e_2), \theta_{\mathcal{E}}, \theta_{\mathcal{R}}) + \mathit{P}(e_2|(e_1, r), \theta_{\mathcal{E}}, \theta_{\mathcal{R}}) \\
\mathit{P}(r|(e_1, e_2),\theta_{\mathcal{E}}, \theta_{\mathcal{R}}) =\frac{\exp(f_{r}(e_1,e_2))}{\sum_{r'\in \mathcal{R}}\exp(f_{r'}(e_1,e_2))}\\
\mathit{P}(e_1|(r, e_2),\theta_{\mathcal{E}}, \theta_{\mathcal{R}}) =\frac{\exp(f_{r}(e_1,e_2))}{\sum_{e_1'\in \mathcal{E}}\exp(f_{r}(e_1',e_2))}\\
\mathit{P}(e_2|(e_1, r),\theta_{\mathcal{E}}, \theta_{\mathcal{R}}) =\frac{\exp(f_{r}(e_1,e_2))}{\sum_{e_2'\in \mathcal{E}}\exp(f_{r}(e_1,e_2'))}
\end{gather}
where $\theta_{\mathcal{E}}$ and $\theta_{\mathcal{R}}$ are parameters for entities and relations respectively. 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Sentence Evidence Encoder}

Given a bag of sentence evidences $S_r=\{s_1,...,s_n\}$, the Sentence Evidence Encoder applies CNN-Max (see Appendix \S\ref{ap:cnnmax}) on each sentence, namely $\mathbf{s}_i = \text{CNN-Max}(s_i)$, to derive the sentence representations $\{\mathbf{s}_1,...,\mathbf{s}_n\}$.
The encoder then calculates the bag-level vector representation $\mathbf{s}_{\mathrm{all}}$ via Equation~\ref{eq:cnnall}:
\begin{align}\label{eq:cnnall}
\mathbf{s}_{\mathrm{all}} &= \sum^n_{i=1}a_i\mathbf{s}_i, \\
a_i &=\frac{\exp(\mathbf{r}_{ht} \cdot \mathbf{x}_i)}
{\sum^n_{k=1}\exp(\mathbf{r}_{ht} \cdot \mathbf{x}_k)},\nonumber\\
\mathbf{x}_i &= \tanh(\mathbf{W}\mathbf{s}_i + \mathbf{b}) \nonumber
\end{align}
where $\mathbf{r}_{ht}$ is from Equation~\ref{eq:transe1}, $\mathbf{W}$ is the weight matrix, $\mathbf{b}$ is the bias vector, $a_i$ is the weight (or attention) for the $i$-th sentence in $S_r$.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Path Evidence Encoder}

Given a bag of UG paths $P_r=\{p_1,...,p_m\}$ connecting an entity pair of interest ($e_1$, $e_2$), the Path Evidence Encoder encodes them into a bag-level vector representation $\mathbf{p}_{\mathrm{all}}$. Since we represent a path as a sequence of words (or a long sentence), 
%%%%as shown in Figure~\ref{fig:ugexam}, 
    as shown in Figure~\ref{fig:kgexam_ugexam}b, 
analogously to the Sentence Evidence Encoder, we apply a CNN-Max (see Appendix \S\ref{ap:cnnmax}) to encode each path $p_i$, namely $\mathbf{p}_i = \text{CNN-Max}(p_i)$. The bag-level path representation $\mathbf{p}_{\mathrm{all}}$ for $P_r$ is then calculated via Equation~\ref{eq:pathall}:
\pagebreak
\begin{align}\label{eq:pathall}
\mathbf{p}_{\mathrm{all}} &=\sum^m_{i=1}a'_i\mathbf{p}_i,\\
a'_i &= \frac{\exp(\mathbf{r}_{ht} \cdot \mathbf{x'}_i)}
{\sum^m_{k=1}\exp(\mathbf{r}_{ht}\cdot \mathbf{x'}_k)},\nonumber\\
\mathbf{x'}_i &= \tanh(\mathbf{W}\mathbf{p}_i + \mathbf{b}) \nonumber
\end{align}
where $a'_i$ is the weight (or attention) for the $i$-th path in $P_r$.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Relation Classification Layer}

The conditional probability of $(e_1,e_2)$ having a relation $r$ is formulated via Equation~\ref{eq:pathall11}:
\begin{gather}\label{eq:pathall11}
P(r|(e_1, e_2), S_r,P_r,\theta_S, \theta_P)=\frac{\exp([\mathbf{o}]_r)}{\sum_{c=1}^{n_r}\exp([\mathbf{o}]_c)}\\
\mathbf{o}=\mathbf{M}\mathbf{v}+\mathbf{d}, \mathbf{v}=[\mathbf{s}_{\mathrm{all}}; \mathbf{p}_{\mathrm{all}}]
\end{gather}
where $[;]$ denotes vector concatenation, $\theta_S$, $\theta_P$ are the parameters in Sentence Evidence Encoder and Path Evidence Encoder, $\mathbf{M}$ is the representation matrix of relations, $\mathbf{d}$ is a bias vector, $\mathbf{o}$ is the output vector containing the prediction scores of all predefined relations, $[\mathbf{o}]_c$ is the prediction score for the relation $c$, and $n_r$ is the total number of relations.

Given a training dataset consisting of triplets $\mathcal{O}=\{(e_1^1, r^1, e_2^1), (e_1^2, r^2, e_2^2), ...\}$, we minimize the objective function as follows:
\begin{equation}\label{eq:objective_prop}
J(\theta)=-\frac{1}{|\mathcal{O}|}\sum_{i=1}^{|\mathcal{O}|}\log P(e_1^i,r^i,e_2^i|\theta_{\mathcal{E}},\theta_{\mathcal{R}}) + \log P(r^i|(e_1^i, e_2^i), S_{r^i}, P_{r^i}, \theta_S,\theta_P)
\end{equation}
The base model is optimized with Stochastic Gradient Descent (SGD). Following \cite{han2018neural}, we optimize $P(e_1^i,r^i,e_2^i|\theta_{\mathcal{E}},\theta_{\mathcal{R}})$ and $P(r^i|(e_1^i, e_2^i), S_i, P_i, \theta_S,\theta_P)$ in parallel.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Proposed Training Method}
\label{sec:proposed}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Problem of Attention Bias}
\label{sec:attbia}

While extending the base model into our UG setting, we observe that the base model tends to allocate more attention to KG or linguistically simple paths as compared to Textual paths (i.e., the path comes from Text), Hybrid paths (i.e., the path comes from both Text and KG), 
%%%%or linguistically complex ones, as shown in Figure~\ref{fig:attpathtp} and Figure~\ref{fig:attlen}. 
    or linguistically complex ones, as shown in Figure~\ref{fig:test}a and Figure~\ref{fig:test}b. 
We consider that this would be because paths including Textual relations (i.e., Textual and Hybrid paths) or complex paths are comparatively much more implicit and indirect than KG or simple paths in the aspect of describing a relationship. However, this does not necessarily indicate that the former is not informative for DS-RE. For instance, 
%%%%in Figure~\ref{fig:ugexam}, 
    in Figure~\ref{fig:kgexam_ugexam}b, 
the complex Hybrid path $p_2$ is useful for predicting (\textbf{Colesevelam\_HCl}, \emph{may\_treat}, \textbf{Type\_2\_Diabetes}), because $p_2$ implies a plausible line of reasoning `` {\it \textbf{Colesevelam\_HCl} $\underrightarrow{alternative\_to}$ Colestipol $\underrightarrow{may\_treat}$ hyperglyceridemia $\underrightarrow{strong\_link\_to}$ \textbf{Type\_2\_Diabetes}}''. However, since it takes more effort to ``understand'' the complex Hybrid path than the simple explicit one such as $p_1$ 
%%%%in Figure~\ref{fig:ugexam}, 
    in Figure~\ref{fig:kgexam_ugexam}b, 
the base model tends to take the ``shortcut'' and only allocates very low attention ($a'_2 \approx 8.0 \times 10^{-36}$) on the path $p_2$, and thus fails to learn from such complex but informative UG path evidences.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 4
\begin{figure}[t]
\begin{center}
\includegraphics{29-4ia4f4.pdf}
\end{center}
%%%%  \label{fig:attpathtp}
%%%%  \label{fig:attlen}
\hangcaption{(\textbf{Left}) Average attention weights across different path types. (\textbf{Right}) Average attention weights across different length range of paths. Here, we use path length as an indicator of path complexity, which denotes the number of words in a path.}
\label{fig:test}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

To reduce the negative effect of the attention biases and make full use of the UG paths, we propose the following training (or debiasing) strategies: Path Type Adaptive Pretraining (\S\ref{sec:pre}), Path Type-wise Local Loss (\S\ref{sec:locloss}) and Complexity Ranking Guided Attention (\S\ref{sec:rank}). 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 5
\begin{figure}[t]
\begin{center}
\includegraphics{29-4ia4f5.pdf}
\end{center}
\hangcaption{Path Type Adaptive Pretraining strategy, where ``Textual/Hybrid/KG P.'' represent Textual, Hybrid, and KG paths respectively, and ``Sent.'' represents the sentence evidences. In this strategy (\textbf{Pretrain}), instead of using all types of paths to train the base model in all iterations, we sequentially train the model with Textual, Hybrid and KG paths, and then finetune it with all types of paths.}
\label{fig:pre_stra}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Path Type Adaptive Pretraining}\label{sec:pre} 

%%%%As shown in Figure~\ref{fig:attpathtp}, 
    As shown in Figure~\ref{fig:test}a, 
the base model tends to bias toward KG paths. This indicates that the base model mainly relies on KG paths so that it is incapable of capturing informative features from Textual and Hybrid paths.
This bias will decrease the flexibility and adaptability of the base model to different types of UG paths.

To address this issue, we propose a debiasing strategy called Path Type Adaptive Pretraining.
In this strategy, we pretrain the base model sequentially using Textual, Hybrid, and KG Paths as path evidences, and then finetune it with all types of paths as illustrated in Figure~\ref{fig:pre_stra}. We hypothesize that this strategy can prevent the reliance on a single type of UG paths and improve the capacity of extracting features from the entire UG paths, and thereby increase the performance. This training strategy partially belongs to the field of Curriculum Learning, which is first proposed by \cite{bengio2009curriculum} to enhance a machine learning model by presenting training data in a meaningful order, starting from easy examples (e.g., a single type of UG paths) and
moving on to more difficult ones (e.g., all types of UG paths).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Path Type-wise Local Loss Training}\label{sec:locloss}

We also propose another training strategy called Path Type-wise Local Loss to reduce the negative effect of the attention bias towards a specific type of UG path. As shown in Figure~\ref{fig:locloss}, the path type-wise local loss measures the cross-entropy between the prediction from each type of UG paths (e.g., Hybrid path) and the target relation (e.g., \textit{may\_treat}). We denote this loss as $L_{type}$ (e.g., $L_{Hybrid}$) and calculate it via Equation~\ref{eq:locloss},
\begin{gather}\label{eq:locloss}
L_{type}=-\log\frac{\exp([\mathbf{o}_{type}]_r)}{\sum_{c=1}^{n_r}\exp([\mathbf{o}_{type}]_c)}\\
\mathbf{o}_{type}=\mathbf{M}_{tw}\mathbf{p}_{type}+\textbf{b}_{tw}
\end{gather}
where $\mathbf{o}_{type}$ is the output vector containing the prediction scores of all predefined relations, $[\mathbf{o}_{type}]_c$ is the prediction score for the relation $c$, and $n_r$ is the total number of relations, $\mathbf{M}_{tw}$ is a representation matrix of relations, $\mathbf{b}_{tw}$ is a bias vector and $\mathbf{p}_{type}$ is the feature of one type of UG paths (e.g., $\mathbf{p}_{Hybrid}$), which is calculated via Equation~\ref{eq:pathall}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 6
\begin{figure}[t]
\begin{center}
\includegraphics{29-4ia4f6.pdf}
\end{center}
\caption{Path Type-wise Local Loss Training.}
\label{fig:locloss}
\vspace{-0.5\Cvs}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The overall loss of the UG based DS-RE model (denoted as $L$) consists of the entire UG path loss ($L_{UG}$), which is calculated via Equation~\ref{eq:ugloss}, KG path loss ($L_{KG}$), Textual path loss ($L_{Textual}$) and Hybrid path loss($L_{Hybrid}$). The overall loss $L$ is calculated via Equation~\ref{eq:allloss}, where $\beta$ is a hyperparameter denoting the weight of each loss and is set as $1.0$ in this work.
\begin{gather}\label{eq:ugloss}
L_{UG}=-\log\frac{\exp([\mathbf{o}_{UG}]_r)}{\sum_{c=1}^{n_r}\exp([\mathbf{o}_{UG}]_c)}\\
\mathbf{o}_{UG}=\mathbf{M}_{UG}\mathbf{v}_{UG}+\textbf{b}_{UG}, \mathbf{v}_{UG}=[\mathbf{s}_{all};\mathbf{p}_{KG};\mathbf{p}_{Textual};\mathbf{p}_{Hybrid}] \\
\label{eq:allloss}
L = L_{UG} + \beta_1L_{KG} + \beta_2L_{Textual} + \beta_3L_{Hybrid}
\end{gather}

Path Type-wise Local Loss training strategy is an computation-effective alternative of the Path Type Adaptive Pretraining, because (i) both strategies are proposed for dealing with the same attention bias problem; (ii) the former has better operability in practice than the latter, because the former can avoid retraining whenever new UG paths come.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Complexity Ranking Guided Attention}\label{sec:rank} 

%%%%Similar to the bias towards KG paths, the base model also focuses on linguistically simple paths, as shown in Figure~\ref{fig:attlen}, 
    Similar to the bias towards KG paths, the base model also focuses on linguistically simple paths, as shown in Figure~\ref{fig:test}b, 
%%%%even though complex ones are informative (e.g. $p_2$ in Figure~\ref{fig:ugexam}). We hypothesize that 
    even though complex ones are informative (e.g. $p_2$ in Figure~\ref{fig:kgexam_ugexam}b). We hypothesize that 
restricting the attention span to the complex (or simple) paths can force the model to pay attention to the complex (or simple) paths, thereby effectively utilize them. Under this hypothesis, we propose a Complexity Ranking Guided Attention mechanism, as illustrated in Figure~\ref{fig:proposed_model}. 

Specifically, given a bag of paths $P_r=\{p_1,...,p_m\}$, we rank them according to their complexity scores ($\kappa $), which are calculated via $\kappa =\tau_1 + \tau_2$, where $\tau$ denotes the feature for capturing linguistic complexity (e.g., path length). Sentence length ($\tau_1$) (i.e., the number of tokens in a sentence) and lexical richness ($\tau_2$) (i.e., the number of token types) are commonly used features for evaluating sentence complexity \cite{brunato2018sentence}. Therefore, this work adopts them to calculate the complexity for a given path. 

Then, we group top $j$ most and least complex paths into a set of complex and simple paths respectively, where $j$ is a hyperparameter.\footnote{In our experiments, we set $j$ as $30$ for NYT10 dataset and $50$ for Biomedical dataset.} The set level representation is calculated via \linebreak
Equation~\ref{eq:pathcomp}.
\begin{gather}\label{eq:pathcomp}
\mathbf{p}_{\mathrm{complex}\,or\,\mathrm{simple}}=\sum_{i\in top\_j \, or\, i\in last\_j}a'_i\mathbf{p}_i \\
a'_i=\frac{\exp(\mathbf{r}_{ht}\cdot\mathbf{x'}_i)}{\sum_{k\in top\_j\,or\,k\in last\_j}\exp(\mathbf{r}_{ht}\cdot\mathbf{x'}_k)},\nonumber\\
\mathbf{x'}_i = \tanh(\mathbf{W}\mathbf{p}_i + \mathbf{b}) \nonumber
\end{gather}
%%%%As shown in Figure~\ref{fig:attlen}, 
    As shown in Figure~\ref{fig:test}b, 
the base model mainly focuses on simple paths, but it is also attracted by complex ones to some extent. In other words, $\mathbf{p}_{\mathrm{all}}$ in Equation~\ref{eq:pathall} only represents some (but not all) portion of information from simple paths. Therefore, in order to make full use of the information from both simple and complex paths, we extract both $\mathbf{p}_{\mathrm{simple}}$ and $\mathbf{p}_{\mathrm{complex}}$ instead of the latter only, and concatenate the resulting representation $\mathbf{s}_{\mathrm{all}}$, $\mathbf{p}_{\mathrm{all}}$, $\mathbf{p}_{\mathrm{simple}}$ and $\mathbf{p}_{\mathrm{complex}}$ as the input to the relation classification layer. The conditional probability $P(r|(e_1, e_2), S_r, P_r,\theta_S,\theta_P)$ is formulated via Equation~\ref{eq:pathall1}.
\begin{gather}\label{eq:pathall1}
P(r|(e_1, e_2), S_r,P_r,\theta_S, \theta_P)=\frac{\exp([\mathbf{o}]_r)}{\sum_{c=1}^{n_r}\exp([\mathbf{o}]_c)},\\
\mathbf{o}=\mathbf{M}\mathbf{v}, \mathbf{v}=[\mathbf{s}_{\mathrm{all}}; \mathbf{p}_{\mathrm{all}};\mathbf{p}_{\mathrm{complex}};\mathbf{p}_{\mathrm{simple}}]+\mathbf{d}
\end{gather}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Experiments}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Data}
\label{sec:data}

We evaluate our proposed framework on a biomedical dataset and NYT10 dataset \cite{riedel2010modeling}. The statistics of both datasets are summarized in Table~\ref{tab:kb_sta}. We will detail both datasets as follows.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% table 1
\begin{table}[t]
\input{04table01.tex}
\hangcaption{Statistics of datasets in this work, where \textbf{R} and \textbf{EP} stand for the target Relation and Entity Pair, $\#_1$/$\#_2$ represent the number of training and testing data respectively.}
\label{tab:kb_sta}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\textbf{Biomedical Dataset}. We create the datatset by linking a biomedical KG with biomedical Text. We choose UMLS\footnote{\url{https://www.nlm.nih.gov/research/umls/}} and Medline corpus as the biomedical KG and Text respectively. UMLS is a frequently used biomedical knowledge base, while Medline corpus is a large collection of biomedical abstracts, both are developed and maintained by the U.S. National Library of Medicine.\footnote{\url{https://www.nlm.nih.gov/}} For identifying UMLS entity mentions in the Medline corpus, we use a state-of-the-art UMLS Named Entity Recognizer (NER), ScispaCy \cite{neumann-etal-2019-scispacy}. The NER identifies UMLS concepts and annotates them by their corresponding UMLS Concept Unique Identifier (CUI) and entity types.

From the UMLS KG and the entity linked Medline corpus, we extract fact triplets (i.e., $(e_1, r, e_2)$) and corresponding sentence evidences containing $(e_1, e_2)$ under the restriction that: (1) each entity pair should be connected by a RO (RO stands for ``has Relationship Other than synonymous, narrower, or broader'') relationship; (2) each entity should belong to the following entity types: Protein, Gene, Disease or Syndrome, Enzyme, Chemical, Sign or Symptom and Pharmacologic Substance. Then we divide the collected triplets and sentence evidences into training and testing set according to the year when the source abstract of sentence evidence was published. The former is aligned to the years until 2008 and the latter to the years 2009$\sim$2018, ensuring the testing set only contains the unobserved triplets. 

To simulate the noise in the real world, besides the ``related'' triplets, we also extract the ``unrelated'' triplets and sentence evidences based on a closed world assumption: pairs of entities not listed in a KG are regarded to have NA relation and sentences containing them are considered to be the NA sentence evidences. We divide the NA triplets and NA sentence evidences in the same way mentioned above. We use a subset of UMLS (see Appendix \S\ref{ap:sub})  and the Medline abstracts published until 2008 as the KG and Text respectively to create the UG for path retrieval. In addition, we use the same subset of UMLS triplets mentioned above to train the KG Encoder introduced in \S\ref{sec:evencoder}.

\textbf{NYT10}. The dataset is created by aligning Freebase relational facts with the New York Times Corpus. Sentence evidences from the year 2005$\sim$2006 are used for training and the evidences from 2007 are used for testing. NYT10 dataset has been widely used by \cite{lin2016neural,ji2017distant,du2018multi,jat2018improving,du2018multi,han2018neural,han2018hierarchical,vashishth2018reside,ye2019distant,alt2019fine}. We use Freebase\footnote{From the entire Freebase, we only collect the triplets with the relations that are mentioned in NYT10 dataset for UG creation, ensuring there is no data leakage problem.} and ClueWeb12 with Freebase entity mention annotations \cite{gabrilovich2013facc1} as the KG and Text to create the UG for path searching. In addition, following \cite{han2018neural}, we use FB60K for training the KG Encoder.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Settings}
\label{sec:settings}

Given an entity pair ($e_1$, $e_2$), we create the UG path set $P_r$ by performing random walks over the UG from $e_1$ till $e_2$ with maximum step.\footnote{We manually set the maximum step as 3.}
We follow \cite{lin2016neural} and conduct the held-out evaluation, in which the model for DS-RE is evaluated by comparing the fact triplets identified from evidences (i.e., the bag of sentence evidences $S_r$ and the bag of UG path evidences $P_r$) with those in KG. Following the evaluation of previous works, we draw Precision-Recall curves and report the Area Under Curve (AUC) and Precision@N (P@N) metrics, which gives the percentage of correct triplets among top N ranked candidates.
The parameter settings of our experiments are detailed in Appendix \S\ref{ap:para}.

To demonstrate the effectiveness of our framework, we choose the model proposed by \cite{dai2019incorporating} as the baseline model, because this is the closest model in terms of incorporating multiple paths for DS-RE. Henceforth, ``Sent+KG'' is the baseline model, which uses both sentence evidences and KG paths. ``Sent+UG'' represents the base model in \S\ref{sec:evencoder} which takes UG paths instead of KG paths as path evidences. ``Sent+UG+Pretrain'', ``Sent+UG+Locloss'' and ``Sent+UG+Ranking'' denote the base model trained with Path Type Adaptive Pretraining strategy, Path Type-wise Local Loss training and Complexity Ranking Guided Attention mechanism, respectively.
``Sent+UG+Ranking+Pretrain'' and \\ ``Sent+UG+Ranking+Locloss'' mean the base model trained with the combination two strategies.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Performance Comparison}
\label{sec:results}

\textbf{Precision-Recall Curves}. The Precision-Recall (PR) curves of each model on the biomedical and NYT10 datasets are shown in Figure~\ref{fig:prc_bio} and Figure~\ref{fig:prc_nyt}, respectively.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 7 and 8
\begin{figure}[t]
\noindent\begin{minipage}{.5\textwidth}
\begin{center}
\includegraphics{29-4ia4f7.pdf}
\end{center}
\caption{PR curves on Biomedical dataset.}
\label{fig:prc_bio}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\begin{center}
\includegraphics{29-4ia4f8.pdf}
\end{center}
\caption{PR curves on NYT10 dataset.}
\label{fig:prc_nyt}
\end{minipage}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The results show that: (1) ``Sent+UG'' does not have obvious advantages than ``Sent+KG'', illustrating that due to the biases discussed in \S\ref{sec:attbia}, simply applying UG paths on the base model has limited effect on improving the performance of DS-RE. (2) ``Sent+UG+Pretrain'',  ``Sent+UG+Locloss'' and ``Sent+UG+Ranking'' achieve better overall performance than \linebreak
``Sent+KG'' on both datasets, especially when the recall is greater than $0.3$, demonstrating that UG has the potential to enhance the performance and the proposed debiasing strategies are effective for exploiting the potential of UG for DS-RE. (3) ``Sent+UG+Ranking+Locloss'' achieves the highest precision over the (almost) entire recall range on both datasets, proving that the ``Ranking'' and ``Locloss'' have a mutual complementary relationship on exploiting UG for DS-RE. This is understandable because the two proposed strategies deal with different types of biases, in addition, ``Locloss'' enhances the base model by effectively tuning its weights, while ``Ranking'' enhances the base model by adjusting its attention mechanism. (4) The consistent improvement on two datasets from different domains further proves the validity of our proposed methods. (5) Although ``LocLoss'' and ``Pretrain'' are equally effective, the former has better operability in practice, because the former performs better than the latter and could avoid retraining whenever new UG paths come.


\textbf{AUC and P@N Evaluation}. Table~\ref{tab:patn_bio_nyt} further presents the results in terms of AUC and P@N. From them, we have similar observation to the PR curves.
We also observe that the effectiveness of UG paths is more pronounced on Biomedical dataset than on NYT10 dataset. We speculate that compared to the generic NYT10 dataset, further Background Knowledge (BK) is needed to identify relations from Biomedical dataset, and UG paths could be utilized as the BK to facilitate such scientific DS-RE.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% table 2
\begin{table}[t]
\input{04table02.tex}
\caption{P@N and AUC on Biomedical and NYT10 dataset ($\mathrm{k}=1,000$).}
\label{tab:patn_bio_nyt}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\textbf{Comparison with Various State-of-the-art Baselines}. To demonstrate the effectiveness of our proposed model, we also compare it against the following baselines:
\begin{itemize}
    \item \textbf{Mintz} \cite{mintz2009distant}: A multi-class logistic regression model under DS.
    \item \textbf{MultiR} \cite{hoffmann2011knowledge}: A probabilistic graphical model for multi-instance learning.
    \item \textbf{MIMLRE} \cite{surdeanu2012multi}: A graphical model for multi-instance multi-label learning.
    \item \textbf{PCNN} \cite{zeng2015distant}: A CNN-Max based RE model.
    \item \textbf{PCNN+ATT} \cite{lin2016neural}: A CNN-Max based RE model with relation embedding based attention mechanism.
    \item \textbf{BGWA} \cite{jat2018improving}: Bi-GRU based RE model with word and sentence level attention mechanism.
    \item \textbf{PCNN+HATT} \cite{han2018hierarchical}: A CNN-Max based RE model with relation hierarchy based attention mechanism.
    \item \textbf{RESIDE} \cite{vashishth2018reside}: A neural network based model which makes use of relevant side information (e.g., syntactic information), which is encoded by Graph Convolution Networks.
    \item \textbf{DISTRE} \cite{alt2019fine}: A pretrained language model based RE model with relation embedding based attention mechanism.
    \item \textbf{RELE} \cite{hu-etal-2019-improving}: A multi-layer attention-based model, which makes use of both KG embedding and entity description for DS-RE.
    \item \textbf{Sent+KG} \cite{dai2019incorporating}: A CNN-Max based RE model with KG embedding based attention mechanism, which makes use of KG paths as extra evidences.
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 9
\begin{figure}[b]
\begin{center}
\includegraphics{29-4ia4f9.pdf}
\end{center}
\caption{PR curves of previous state-of-the-art methods and our proposed model on NYT10 dataset.}
\label{fig:prc_stnyt}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fig. 10
\begin{figure}[b]
\begin{center}
\includegraphics{29-4ia4f10.pdf}
\end{center}
\caption{PR curves of previous state-of-the-art methods and our proposed model on Biomedical dataset.}
\label{fig:prc_stbio}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\noindent
The results shown in Figure~\ref{fig:prc_stnyt}, Figure~\ref{fig:prc_stbio}, Table~\ref{tab:patn_stnyt} and Table~\ref{tab:patn_stbio} indicate that: (1) our selected base model, ``Sent+KG'', is a strong baseline because it significantly outperforms other state-of-the-art models; and (2) our proposed model (i.e., ``Sent+UG+Ranking+Locloss'') can effectively take advantage of the rich UG paths for DS-RE because it beats the strong baseline on both datasets and achieves a new state-of-the-art result on the commonly used NYT10 dataset.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% table 3
\begin{table}[t]
\input{04table03.tex}
\hangcaption{P@N and AUC from previous state-of-the-art DS-RE models and our proposed model (i.e., ``Sent+UG+Ranking+Locloss'') on NYT10 dataset, where \dag represents that these results are quoted from (Alt et al. 2019),  \ddag indicates the results using the pretrained model from (Han et al. 2018b) and $\star$ indicates the results are obtained by carefully re-running corresponding codes.}
\label{tab:patn_stnyt}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% table 4
\begin{table}[t]
\input{04table04.tex}
\hangcaption{P@N and AUC from previous state-of-the-art DS-RE models and our proposed model (i.e., ``Sent+UG+Ranking+Locloss'') on Biomedical dataset, where $\ast$ indicates the results are obtained by using OpenNRE (https://github.com/thunlp/OpenNRE) and $\star$ indicates the results are obtained by carefully re-running corresponding codes.} 
\label{tab:patn_stbio}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Case Study}

Table~\ref{tab:casestudy} shows some UG path examples that are scored with highest (``High'') or lowest (or lower than $2.0\times10^{-2}$) (``Low'') attention by the base and our proposed models. For instance, ``Path 1'' and ``Path 4'' in the table generally mean `` ${e_1}$ $\underrightarrow{is\_responsible\_for}$ $e_3$ \linebreak
$\underrightarrow{is\_the\_chemical\_class\_of}$ $e_4$ $\underrightarrow{may\_treat}$ ${e_2}$'' and ``${e_1}$ $\underrightarrow{contains}$ $e_3$ $\underrightarrow{includes}$ ${e_2}$'', and therefore can be seen as the informative paths for identifying \emph{gene\_associated\_with\_disease} and \emph{/location/contains} relation between $e_1$ and $e_2$, respectively. However, due to the attention bias problem discussed in \S\ref{sec:attbia}, the base model ignores such complex but useful paths and thus misidentifies the target relations. The high attention score from our proposed model indicates that our proposed training strategies could help the base model attend such informative UG paths so that it can correctly identify the target relations.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% table 5
\begin{table}[t]
\input{04table05.tex}
\hangcaption{Some highly focused paths by ``Sent+UG+Ranking+Pretrain/Locloss'' (Prop.) comparing with ``Sent+UG'' (Base), where \cmark (or \xmark) represents the correct (or incorrect) prediction of the target relation.}
\label{tab:casestudy}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


In contrast, Table~\ref{tab:negcasestudy} shows some UG paths which are highly attend by the base model but ignored by ours. For instance, ``Path 1'' means {\it \textbf{$e_1$} $\underrightarrow{component\_of}$ $e_3$ $\underrightarrow{my\_treat}$ \textbf{$e_2$}}, and effectively represents the \emph{may\_treat} relation between $e_1$ and $e_2$. Different from the base model, our proposed model ignores the informative simple KG path and misidentifies the target relation. This indicates that our proposed training strategies might come with a drawback of over-adjustment especially when there are only simple KG paths available. Therefore, it is necessary to further investigate this issue so as to figure out an effective way to fix it, and which will be left as our future work.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% table 6
\begin{table}[t]
\input{04table06.tex}
\hangcaption{\label{tab:negcasestudy} Some highly focused paths by ``Sent+UG'' (Base) comparing with ``Sent+UG+Ranking+\linebreak[2]Pretrain/Locloss'' (Prop.).}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Broader Impact} 

The combination of textual corpus and KG is an attractive field of reasearch because textual corpus contains tremendous amount of relational facts that are absent in KG, and a KG has a great amount of structuralized factual information that is never seen in textual corpus. Reasoning over the combination of textual corpus and KB (i.e., UG) has profound effects on many NLP applications and AI systems. This work could be seen as a very preliminary attempt towards exploiting the potential of the UG-based reasoning for a subtask of NLP. The findings described in this work can potentially be utilized to improve accuracy in any application of computer knowledge acquisition where it needs further UG based reasoning. Some such applications are beneficial for explainable AI system aiming for knowledge discovery and fact checking.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conclusion and Future Work}

We have introduced UG paths as extra evidences for the task of DS-RE from text. In order to fully take advantage of the rich UG paths, we have proposed three training (or debiasing) strategies: Path Type Adaptive Pretraining, Path Type-wise Local Loss training and Complexity Ranking Guided Attention mechanism. We have conducted extensive experiments on both Biomedical and NYT10 datasets. The results show that the proposed methods are effective for exploiting the potential of UG paths for improving the performance of DS-RE. In addition, we have developed and released a DS-RE toolkit based on this work for further practical usage, such as knowledge acquisition and explanation generation.

In the future, we plan to carry out the following steps: (1) Instead of random walk, we may collect UG paths by adopting more sophisticated mechanisms such as training a path searching agent via reinforcement learning to prevent redundant and noisy paths; (2) We may improve the flexibility of the proposed model so as to prevent the over-adjustment issue; (3) Since BERT \cite{devlin2018bert} pretrained Language Model (LM) has been proved effective in many NLP tasks, we will utilize the pretrained LM as our encoder of UG paths for DS-RE; and (4) We will learn UG embedding as an alternative of KG embedding for attention calculation.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\acknowledgment
This paper is an extended version of our work presented in EACL2021 \cite{dai2021two}. This work was supported by JST CREST Grant Number JPMJCR20D2, Japan. We are grateful to the reviewers for their detailed, insightful and constructive comments on the submissions.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliographystyle{jnlpbbl_1.6}
\bibliography{04refs}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\appendix
\section{Appendix}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{CNN-Max}\label{ap:cnnmax}

Convolutional Neural Network with Max pooling layer (CNN-Max) is adopted to derive the sentence representation $\mathbf{s}$ and path representation $\mathbf{p}$. Specifically, vector representation $\mathbf{v}_t$ for each word $w_t$ is calculated via Equation~\ref{eq:cnnemb1}, where $\mathbf{W}_{emb}^w$ is a word embedding projection matrix \cite{mikolov2013distributed}, $\mathbf{W}_{emb}^{wp}$ is a word position embedding projection matrix \cite{zeng2014relation}, $\mathbf{x}_t^w$ is a one-hot word representation and $\mathbf{x}_t^{wp}$ is a one-hot word position representation, which indicates the relative distance between the current word and the target entity pair. 
\begin{gather}\label{eq:cnnemb1}
\mathbf{v}_t=[\mathbf{v}_t^w; \mathbf{v}_t^{wp1}; \mathbf{v}_t^{wp2}], \\
\mathbf{v}_t^w=\mathbf{W}_{emb}^w\mathbf{x}_t^w, \nonumber\\
\mathbf{v}_t^{wp1}=\mathbf{W}_{emb}^{wp}\mathbf{x}_t^{wp1}, \nonumber\\
\mathbf{v}_t^{wp2}=\mathbf{W}_{emb}^{wp}\mathbf{x}_t^{wp2}\nonumber
\end{gather}
The sentence representation $\mathbf{s}$ and path representation $\mathbf{p}$ are formulated via the Equation~\ref{eq:cnnmax}, where $\mathbf{W}^{sent}$ (or $\mathbf{W}^{path}$) is the convolution kernal, $\mathbf{b}^{sent}$ (or $\mathbf{b}^{path}$) is the corresponding bias vector, $\mathbf{v}^{sent}_t$ (or $\mathbf{v}^{path}_t$) is the vector for each word $w_t$ in a sentence (or path), $[vec]_i$ is the $i$-th value of $vec$, $\nu$ is the dimensionality of $\mathbf{s}$ and $\mathbf{p}$, and $k$ is the convolutional window size.
\begin{gather}
\begin{gathered}
[\mathbf{s}]_i = \max\limits_{t}\{[\mathbf{h}^{sent}_{t}]_{i}\},\ \forall i=1, ..., \nu \\
[\mathbf{p}]_i = \max\limits_{t}\{[\mathbf{h}^{path}_{t}]_{i}\},\ \forall i=1, ..., \nu 
\label{eq:cnnmax}
\end{gathered}\\[0.5\Cvs]
\mathbf{h}^{sent}_t=\tanh(\mathbf{W}^{sent}\mathbf{z}^{sent}_t + \mathbf{b}^{sent}),\nonumber\\
\mathbf{h}^{path}_t=\tanh(\mathbf{W}^{path}\mathbf{z}^{path}_t + \mathbf{b}^{path}),\nonumber\\
\mathbf{z}^{sent}_t=[\mathbf{v}^{sent}_{t-(k-1)/2}; ... ; \mathbf{v}^{sent}_{t+(k-1)/2}],\nonumber\\
\mathbf{z}^{path}_t=[\mathbf{v}^{path}_{t-(k-1)/2}; ... ; \mathbf{v}^{path}_{t+(k-1)/2}]\nonumber
\end{gather}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Parameter Settings}\label{ap:para}

All of the hyperparameters used in our experiments are listed in Table~\ref{tab:hypara}. Most of them follow the hyperparameter setting in \cite{dai2019incorporating} and \cite{han2018neural}. We select $j$ for Complexity Ranking Guided Attention described in \S\ref{sec:rank} among $\{30, 40, 50\}$ via grid search. We use a Word2Vec model\footnote{Gensim word2vec implementation: \url{https://radimrehurek.com/gensim/models/word2vec.html}} to train the word embeddings on the UMLS entity linked corpus for the biomedical dataset, and adopt the word embeddings released by \cite{lin2016neural} for NYT10 dataset. We apply Stochastic Gradient Descent (SGD) to optimize the proposed DS-RE model.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% table 7 and 8
\begin{table}[t]
\noindent\begin{minipage}{230pt}
\input{04table07.tex}
\caption{Hyperparameters used in our experiments.}
\label{tab:hypara}
\end{minipage}
%%%%\hfill
\begin{minipage}{190pt}
\input{04table08.tex}
\caption{List of selected UMLS entity types.}
\label{tab:umls_tp}
\end{minipage}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Subset of UMLS}\label{ap:sub}

Besides the 7 entity types mentioned in \S\ref{sec:data}, we also use other 22 entity types, as listed in Table~\ref{tab:umls_tp}, to collect the UMLS triplets that are connected by RO relationship, ensuring there is no data leakage problem. The main reasons to manually restrict the entity type is because (1) we observe that most of the Medline abstracts discuss the relationship among these entity types; (2) these concrete entities could prevent semantic drift while searching UG paths.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{biography}

\bioauthor[:]{Qin Dai}{%
He received his Ph.D. degree in Information Sciences from Tohoku University, Sendai, Japan, in 2020. He is a Postdoctoral Researcher at the Graduate School of Information Sciences, Tohoku University. His research interests include knowledge acquisition (especially scientific knowledge discovery), Universal Graph (the combination of Textual corpus and Knowledge Graph) based reasoning, explanation generation and natural language grounding.
}

\bioauthor[:]{Benjamin Heinzerling}{%
He received his Ph.D. degree in Computational Linguistics from Heidelberg University, Germany, in 2018. He is a Postdoctoral Researcher at RIKEN AIP and Tohoku University in Sendai, Japan. His research interests include analysis of entities mentioned in text, linking texts and knowledge bases, and multilingual subword methods.
}

\bioauthor[:]{Naoya Inoue}{%
He received the M.S. degree in engineering from the Nara Institute of Science and Technology, Ikoma, Japan, in 2010 and the Ph.D. degree in information science from Tohoku University, Sendai, Japan, in 2013. In 2013, he joined DENSO Corporation as a Researcher and since 2015, has been an Assistant Professor with Tohoku University. Since 2020, he has been a Postdoctoral Associate with Stony Brook University, Stony Brook, NY, USA. His research interests include explainable QA systems and neuro-symbolic reasoning.
}

\bioauthor[:]{Kentaro Inui}{%
He is a Professor of the Graduate School of Information Sciences at Tohoku University, where he is head of the Natural Language Processing Lab. He also leads the Natural Language Understanding Team at the RIKEN Center
for the Advanced Intelligence Project. He currently serves as Vice-chairperson of Association for Natural Language Processing, Member of Science Council of
Japan, and Director of NPO FactCheck Initiative Japan.
}

\end{biography}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\biodate






\end{document}

