# A Proposal for Intelligent Agents
with Episodic Memory

David Murphy
HP Labs – HP Inc.
Palo Alto, CA, USA
<EMAIL_ADDRESS>
Thomas Paula
HP Labs – HP Inc.
Porto Alegre, RS, Brazil
<EMAIL_ADDRESS>
Wagston Staehler
HP Labs – HP Inc.
Porto Alegre, RS, Brazil
<EMAIL_ADDRESS>
Juliano Vacaro
HP Labs – HP Inc.
Porto Alegre, RS, Brazil
<EMAIL_ADDRESS>
Gabriel Paz
HP Labs – HP Inc.
Porto Alegre, RS, Brazil
<EMAIL_ADDRESS>
Guilherme Marques
HP Labs – HP Inc.
Porto Alegre, RS, Brazil
<EMAIL_ADDRESS>
Bruna Oliveira
HP Labs – HP Inc.
Porto Alegre, RS, Brazil
<EMAIL_ADDRESS>

###### Abstract

In the future we can expect that artificial intelligent agents, once deployed,
will be required to learn continually from their experience during their
operational lifetime. Such agents will also need to communicate with humans
and other agents regarding the content of their experience, in the context of
passing along their learnings, for the purpose of explaining their actions in
specific circumstances or simply to relate more naturally to humans concerning
experiences the agent acquires that are not necessarily related to their
assigned tasks. We argue that, to support these goals, an agent would benefit
from an episodic memory; that is, a memory that encodes the agent’s experience
in such a way that the agent can relive the experience, communicate about it
and use its past experience, inclusive of the agents own past actions, to
learn more effective models and policies. In this short paper, we propose one
potential approach to provide an AI agent with such capabilities. We draw upon
the ever growing body of work examining the function and operation of the
Medial Temporal Lobe (MTL) in mammals to guide us in adding an episodic memory
capability to an AI agent composed of artificial neural networks (ANNs). Based
on that, we highlight important aspects to be considered in the memory
organization and we propose an architecture combining ANNs and standard
Computer Science techniques for supporting storage and retrieval of episodic
memories. Despite being initial work, we hope this short paper can spark
discussions around the creation of intelligent agents with memory or, at
least, provide a different point of view on the subject.

##  1 Introduction

The value of an episodic memory to aid learning in an artificial agent is
gaining acceptance. This is reflected in the increasing number of Deep
Reinforcement Learning (DRL) papers in recent years that include an episodic
memory in the agent architecture. In a DRL based agent, this often takes the
form of adding an external memory system, similar in architecture to the
Differentiable Neural Computer (DNC) [6], to the agents policy network that
decides which action or actions to take given the agents’ observations of the
current environment state [24]. The addition of these memories have both
extended the horizon over which such agents can learn by mitigating the long
horizon problem [12] and have decreased the number of episodes of experience
an agent needs to learn an effective policy over agents that lack a memory.

The use of the term episodic memory in the DRL literature however, seems to
differ from that of the cognitive sciences. In DRL, the term often refers to
the storage and retrieval of the hidden state of the neural network (often an
LSTM [9] variant) implementing the policy of an agent [17]. That is, an
embedding of the recent past experience in the network’s hidden layers that is
preserved for later retrieval, allowing the agent to pick up from where it
left off learning in the past. In contrast to the usage in psychology and the
cognitive sciences, the stored state is not decodable to recover the
experience of an agent for a specific past episode. On the other hand, Tulving
[22, 21] referred to episodic memory as a kind of mental time travel – a way
for an agent (in this case a human one) to recall an experience and move
forward or backward in time within that experience to communicate about it or
to reflect on it in service to another goal. How could we construct a system
that provides this class of memory capability to an AI agent?

##  2 An Architecture supporting Storage and Retrieval of Episodic Memory

A step towards answering this question might be found in examining mammalian
episodic memory and extracting a set of properties to guide us in building an
artificial analog.

The hippocampal formation (a part of the MTL) is thought by many to be
involved in memory in general and episodic memory in particular [16, 15]. An
examination of the pathways in and out of the hippocampal formation show
connections between it and both the Anterior-temporal (AT) network and the
Posterior-medial (PM) network. The former system is believed to extract and
keep track of the objects and entities present in the world and their
properties. The PM network on the other hand keeps track of the relationships
between the objects and entities. The hippocampal formation records experience
as reflected in activity of the AT and PM networks in such a way that when
presented with a partial set of cues from either the relationships or the
objects and entities, the complete set of objects, entities and relations from
past experience are recalled, and this is accompanied by restoration of
activity in the AT and PM networks. In essence (perhaps oversimplifying), the
activities of these networks is restored in such a way that the sensory
experience of the memory is available.

We can extract some useful properties from this body of work that might
inspire a similar capability in an artificial system. First, the system is
“generative". That is, from the encoding of the memory we can generate the
representations that were present when the memory was stored. Second, we can
recall the complete memory (the objects, entities, and relationship present at
the time of encoding) from a partial cue. Third, while not explicitly called
out above, we can say, with some certainty, that mammals maintain a belief
about their current environment [3]. If we take these three characteristics
together, we can begin to envision an artificial system that is both feasible
and that would contain an episodic memory system.

Figure 1: Simplified diagram of the proposed architecture.

In Figure 1, we see a simplified diagram upon which we explore how adhering to
these principles we can construct such a system. For simplification, we assume
for the moment we proceed from visual input, but the ideas extend to any
sensory modality. Visual information comes into the sense block, which
extracts features vectors, $\phi$ from the image. These feature vectors are
consumed by an object block and scene block. The object block is responsible
for determining what entities are present in the environment from the feature
vectors supplied by the sense block. The object block is composed of two
elements, an ANN that constructs a pose invariant feature vector $\phi_{inv}$
for each object represented in the feature vectors, and a working memory. The
working memory maintains the current set of invariant feature vectors
$\phi_{inv}$ representing the objects present in the agent’s environment.
$\phi_{inv}$ are placed in working memory as they are produced, and decay from
the memory if they are not refreshed by the future presentations of the
$\phi_{inv}$. The working memory provides temporal consistency that the
sensory element does not. The scene block construction is analogous to the
object block. It comprises an ANN that extracts relationships among objects,
and stores those relationships in a working memory.

Together, the working memories of the object and scene blocks maintain the
agent’s belief about the world. The set of objects and entities present and
their relationships. Once we have this belief, we can formulate the episodic
memory as a system that tracks the agent’s change in its belief. That belief
should change much more slowly than the feature vectors at the output of the
sensory block for two reasons:

  * •

The invariant feature vectors change more slowly than the sensory feature
vectors, as they are unaffected by pose; the object’s or the agent’s.

  * •

The working memories provide some temporal consistency to the invariant
feature vectors, even as the objects in view of the sense block that caused
them appear and disappear from view temporarily from change in agent pose.

This slowly varying belief reduces the amount of storage required to capture
experience over storing raw feature vectors.

It was stated earlier that the biological system is generative. If we place
this constraint on the ANNs that make up the sense, object and scene blocks,
then we can view recall as reinstating the working memory from the changes in
belief stored in the episodic memory and relive, so to speak, the sensory
experience by regenerating the feature vectors of the sense block from those
of the working memory. An agent then has the option of moving through these
stored beliefs, forward or backward in time providing a facility akin to
Tulving’s. Note that the degree of reconstruction required would depend on the
intended use. A DRL agent might just require the highest level abstract
features as input to policy updates whereas a response to presenting the query
“Show me where you were…" to an agent might be a pixel level reconstruction of
the experience that would be suitable for a person to consume.

The executive block in Figure 1 represents the policy network of an artificial
agent. The policy network receives input from the object and scene blocks as
its perceptual inputs but also queries the episodic memory in service to the
policy.

##  3 Memory Organization

We have stated that the episodic memory system tracks the changes in the
agent’s belief but we have not articulated how such a memory is organized and
how information is stored and retrieved. For the memory system to be
effective, we must satisfy three properties. First, we must be able to store
an accurate memory from a single exposure to the environment; second, to
retrieve the memory from a partial cue; and third, we must be able to store
and recall a large amount of experience.

There is considerable recent work on augmenting deep neural networks with
external memory [20, 24, 25, 11, 14, 19, 1]. In common formulations, access to
the memory requires a scan over the entire memory while applying some function
to the contents that ultimately computes a weighting that identifies which
memories are of most value [5]. Sweeping over the entire memory may not be
unreasonable biologically, perhaps, as all the computing elements and memory
can operate (theoretically) in parallel, but it is unreasonable for our
current computer systems as either the energy, computation or time required
would become untenable. Therefore, organizing the storage of memory and the
representations stored there in such a way that past memory is retrievable
with bounded computation and that similar memories are nearby as defined by
the search mechanism is required.

We can achieve these three properties if we impose an additional constraint on
the representations produced and placed in the working memory. That constraint
is that the representation is composable, or disentangled [2]. With this
constraint, value of a dimension of the disentangled feature vector of a set
of objects or relationships for which a property is common will be similar. In
other words similar objects and relationships would lie near each other in the
feature vector space.

Figure 2: High-level diagram of the proposed system, showing the subset for
objects. The Sensory block produces a disentagled feature vector which passed
on to the Model block which produces a feature vector invariant to the agents
viewpoint $\phi_{inv}$. The $\phi_{inv}$ is maintained in working memory
providing an agents belief about the state of the world. Changes to the
working memory are stored in the Episodic Memory block

With this additional property, we can cast the memory into an assembly of
classic computer science approaches to storage (see Figure 2). We define a
memory occurance data structure to store each instance of an object or
relationship class. This data structure maintains a copy of the invariant
feature vector $\phi_{inv}$, and a list of timestamps when the object or
relation was entered or removed from working memory. We view each $\phi_{inv}$
as a point in the feature space corresponding to a particular object or
relation class. Within a class, in order to quickly determine if a particular
instance of a class has been seen, an index into the feature space is
constructed by assigning an ordered tree structure to each dimension of the
feature vector where each leaf node corresponds to a value of a dimension. The
collection of trees corresponding to the dimensions of the feature vector we
refer to as a tree set. When storing a change in the agents belief, for each
new or deleted feature vector, we search the tree set for a match. If we find
one we know this class instance has been seen before and we construct a hash
from the IDs of the leaf nodes (each node in the tree having a unique ID) and
use it to index the data structure that maintains the history of this specific
object or relationship instance. If we do not find one then we have not seen
this instance before. Consequently, we create a new entry in the tree set and
in the hashtable.

While the above mechanism solves storage and retrieval of an individual object
or relationship, it is does not solve recovery of the complete memory. To
achieve this, we maintain a running list of changes to the working memory.
This running list of working memory changes is ordered in time and we can rely
on this property to build efficient indexing into the memory. Hence, once we
recovery a partial memory by a search in the tree set, we can recover the time
index for that memory and retrieve and reconstruct the entire working memory
corresponding to the agent’s belief at that time.

Earlier we stated that we must be able to retrieve a memory from a partial
cue. Partial cues take two forms. An object or relationship that is part of a
complete memory or an under-specified description of an object or relationship
(e.g. a cat vs a cat with black fur and a white underbelly with yellow eyes).
The former is addressed in the description above. To address the latter we can
consider one form of a partial cue as neglecting some of the dimensions of the
feature vector when searching the tree set. For example, we might neglect
color, and in so doing retrieve all objects of all possible colors that match
the rest of the specification.

Furthermore, since the tree set structure is ordered, we can bound searches in
the tree set for elements that have similar properties. That is, since we know
that increasing (or decreasing) a particular value in a particular dimension
corresponds to decreasing similarity we can bound similarity search by
limiting how much change in value of a particular dimension is appropriate for
our search.

##  4 Discussion

We have described an approach to adding episodic memory to artificial agents
that we arrived at by drawing inspiration from the large body of work on the
Medial Temporal Lobe (MTL) and how the MTL interacts with other brain areas.
The properties enabled by the MTL guide us in formulating an analog for an
system composed of ANNs. We show that, by carefully restricting the properties
of the ANNs involved and adding a working memory representing an agent’s
belief about the world – temporal consistency of representation – that we can
cast episodic memory as augmenting an ANN system with well know computer
science approaches to memory.

The systems level approach taken here means that no individual component
stands in isolation. Rather, the properties of each component are shaped by
the system architecture and operation. In our case this lead us to make
important assumptions regarding the features the individual components
provide: disentanglement and invariance. Bengio et al.[2] state, as is often
the case in the context of deep learning methods, that the feature set
produced in training may be destined for use in multiple tasks that may each
rely on distinct subsets of relevant features. The authors conclude that the
most robust approach to feature learning is to disentangle as many factors as
possible, discarding as little information about the data as is practical.
Disentanglement has been the subject of study of recent work and various
approaches to learning disentangled features have been developed [7, 23]. The
property is useful for memory as it allows for matching on subsets of the
features but also because it allows for composable representations. Models
that extract disentangled features remains an open research topic, as are
methods for evaluating the quality of the representations. In Locatello et al.
[13], the authors argue that unsupervised learning of disentangled
representations might only be possible with inductive biases on both the
models and the data. While methods for producing disentangled features is an
open research problem, we nonetheless believe this property of features is
useful as it allows for search by partially specified queries.

Feature invariance is another important assumption we make. The working memory
proposed relies on invariant features produced by a given model such that
objects or relationships can be matched to their feature vectors in working
memory across gaps in their appearance. The proposed system should be able to
extract invariant features from the disentangled representations which are
saved ultimately to episodic memory. The generative nature of the system when
recalling memories means such a system should be able to map invariant
features back to a representation that allows the decoder portion of the VAE
in the sensory block to recreate the input. The authors acknowledge that the
imposition of these system level constrains of obtaining both disentanglement
and invariance is challenging and not to be underestimated, but believe the
constraints greatly simplify the memory architecture.

We built a preliminary system and have working components for a subset of the
system: sensory, model, and episodic memory blocks (Figure 2). We are able to
store and retrieve memories, and early results seem promising, but we have
work to do on improving the representations the ANNs produce. In our initial
experiments, we used a generative model based on variational autoencoders
(VAEs) [10] and explored the use of techniques to improve disentanglement such
as the spatial broadcast decoder [23]. For the model block, we conducted
experiments using contrastive learning [4] to train an ANN to produce the
invariant representations. The loss function encourages similar entities to
have similar representations and different entities to have different
representations [18]. Of course, considering all of the elements together is
challenging, but our initial results are encouraging.

As a final thought, previous work in human subjects show the relationship of
episodic memory to imagination [8]. Subjects with damage to the hippocampus,
and hence impaired episodic memory capabilities also produce less rich
imagined scenes. The type of system described here may also admit a form of
imagination. That is, as we have organized memory so that similar objects and
relations appear close to one another in feature space, and that the
representations are composable. We can construct an imagined memory by
sampling the memory space with some amount of induced noise. This imagined
memory will be composed of elements similar to the agents previous experience.

We hope the ideas expressed here can spark discussion on memory and its place
in artificial systems and bring us closer to agents that learn over their
lifetime. We plan to conduct additional experiments using the proposed
architecture and share results with the research community.

## References

  * Badia et al. [2020] A. P. Badia, B. Piot, S. Kapturowski, P. Sprechmann, A. Vitvitskyi, D. Guo, and C. Blundell.  Agent57: Outperforming the atari human benchmark.  _arXiv preprint arXiv:2003.13350_ , 2020.
  * Bengio et al. [2013] Y. Bengio, A. Courville, and P. Vincent.  Representation learning: A review and new perspectives.  _IEEE transactions on pattern analysis and machine intelligence_ , 35(8):1798–1828, 2013.
  * Chan et al. [2016] S. C. Y. Chan, Y. Niv, and K. A. Norman.  A probability distribution over latent causes, in the orbitofrontal cortex.  _Journal of Neuroscience_ , 36(30):7817–7828, 2016.  doi: 10.1523/JNEUROSCI.0659-16.2016.  URL https://nivlab.princeton.edu/sites/default/files/nivlab/files/channivnorman2016.pdf.
  * Chopra et al. [2005] S. Chopra, R. Hadsell, and Y. LeCun.  Learning a similarity metric discriminatively, with application to face verification.  In _2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05)_ , volume 1, pages 539–546. IEEE, 2005.
  * Graves et al. [2014] A. Graves, G. Wayne, and I. Danihelka.  Neural turing machines.  _CoRR_ , abs/1410.5401, 2014.  URL http://arxiv.org/abs/1410.5401.
  * Graves et al. [2016] A. Graves, G. Wayne, M. Reynolds, T. Harley, I. Danihelka, A. Grabska-Barwińska, S. G. Colmenarejo, E. Grefenstette, T. Ramalho, J. Agapiou, et al.  Hybrid computing using a neural network with dynamic external memory.  _Nature_ , 538(7626):471–476, 2016.
  * Greff et al. [2019] K. Greff, R. L. Kaufmann, R. Kabra, N. Watters, C. Burgess, D. Zoran, L. Matthey, M. Botvinick, and A. Lerchner.  Multi-object representation learning with iterative variational inference.  _arXiv preprint arXiv:1903.00450_ , 2019.
  * Hassabis et al. [2007] D. Hassabis, D. Kumaran, S. Vann, and E. A. Maguire.  Patients with hippocampal amnesia cannot imagine new experiences.  _Proceedings of the National Academy of Sciences_ , 104(5):1726–1731, 2007.  ISSN 0027-8424.  doi: 10.1073/pnas.0610561104.  URL https://www.pnas.org/content/104/5/1726.
  * Hochreiter and Schmidhuber [1997] S. Hochreiter and J. Schmidhuber.  Long short-term memory.  _Neural Comput._ , 9(8):1735–1780, Nov. 1997\.  ISSN 0899-7667.  doi: 10.1162/neco.1997.9.8.1735.  URL http://dx.doi.org/10.1162/neco.1997.9.8.1735.
  * Kingma et al. [2016] D. P. Kingma, T. Salimans, R. Jozefowicz, X. Chen, I. Sutskever, and M. Welling.  Improved variational inference with inverse autoregressive flow.  In _Advances in neural information processing systems_ , pages 4743–4751, 2016.
  * Kumar et al. [2015] A. Kumar, O. Irsoy, P. Ondruska, M. Iyyer, J. Bradbury, I. Gulrajani, V. Zhong, R. Paulus, and R. Socher.  Ask Me Anything: Dynamic Memory Networks for Natural Language Processing.  _arXiv preprint arXiv:1506.07285_ , 2015.  URL https://arxiv.org/abs/1506.07285.
  * Lillicrap and Santoro [2019] T. P. Lillicrap and A. Santoro.  Backpropagation through time and the brain.  _Current opinion in neurobiology_ , 55:82–89, 2019.
  * Locatello et al. [2018] F. Locatello, S. Bauer, M. Lucic, G. Rätsch, S. Gelly, B. Schölkopf, and O. Bachem.  Challenging common assumptions in the unsupervised learning of disentangled representations.  _arXiv preprint arXiv:1811.12359_ , 2018.
  * Pritzel et al. [2017] A. Pritzel, B. Uria, S. Srinivasan, A. P. Badia, O. Vinyals, D. Hassabis, D. Wierstra, and C. Blundell.  Neural episodic control.  In _Proceedings of the 34th International Conference on Machine Learning-Volume 70_ , pages 2827–2836. JMLR. org, 2017.
  * Ranganath and Ritchey [2012] C. Ranganath and M. Ritchey.  Two cortical systems for memory-guided behaviour.  _Nature Reviews Neuroscience_ , 13(10):713–726, 2012.  ISSN 1471-0048.  doi: 10.1038/nrn3338.  URL https://doi.org/10.1038/nrn3338.
  * Reagh and Ranganath [2018] Z. M. Reagh and C. Ranganath.  What does the functional organization of cortico-hippocampal networks tell us about the functional organization of memory?  _Neuroscience Letters_ , 680:69 – 76, 2018.  ISSN 0304-3940.  doi: https://doi.org/10.1016/j.neulet.2018.04.050.  URL http://www.sciencedirect.com/science/article/pii/S0304394018303136.  New Perspectives on the Hippocampus and Memory.
  * Ritter et al. [2018] S. Ritter, J. Wang, Z. Kurth-Nelson, S. Jayakumar, C. Blundell, R. Pascanu, and M. Botvinick.  Been there, done that: Meta-learning with episodic recall.  In J. Dy and A. Krause, editors, _Proceedings of the 35th International Conference on Machine Learning_ , volume 80 of _Proceedings of Machine Learning Research_ , pages 4354–4363, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR.  URL http://proceedings.mlr.press/v80/ritter18a.html.
  * Schroff et al. [2015] F. Schroff, D. Kalenichenko, and J. Philbin.  Facenet: A unified embedding for face recognition and clustering.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , pages 815–823, 2015.
  * Sodhani et al. [2020] S. Sodhani, S. Chandar, and Y. Bengio.  Toward training recurrent neural networks for lifelong learning.  _Neural computation_ , 32(1):1–35, 2020.
  * Sukhbaatar et al. [2015] S. Sukhbaatar, A. Szlam, J. Weston, and R. Fergus.  End-to-end memory networks.  In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, _Advances in Neural Information Processing Systems 28_ , pages 2440–2448. Curran Associates, Inc., 2015.  URL http://papers.nips.cc/paper/5846-end-to-end-memory-networks.pdf.
  * Tulving [2002] E. Tulving.  EPISODIC MEMORY : From Mind to Brain.  _Annual re_ , 53:1–25, 2002.
  * Tulving and Markowitsch [1998] E. Tulving and H. J. Markowitsch.  Episodic and declarative memory: role of the hippocampus.  _Hippocampus_ , 8(3):198–204, 1998.
  * Watters et al. [2019] N. Watters, L. Matthey, C. P. Burgess, and A. Lerchner.  Spatial broadcast decoder: A simple architecture for learning disentangled representations in vaes.  _arXiv preprint arXiv:1901.07017_ , 2019.
  * Wayne et al. [2018] G. Wayne, C.-C. Hung, D. Amos, M. Mirza, A. Ahuja, A. Grabska-Barwinska, J. Rae, P. Mirowski, J. Z. Leibo, A. Santoro, et al.  Unsupervised predictive memory in a goal-directed agent.  _arXiv preprint arXiv:1803.10760_ , 2018.
  * Weston et al. [2014] J. Weston, S. Chopra, and A. Bordes.  Memory networks.  _arXiv preprint arXiv:1410.3916_ , 2014.


# Towards Explaining STEM Document Classification using Mathematical Entity
Linking

1st Philipp Scharpf  University of Konstanz
Konstanz, Germany
<EMAIL_ADDRESS>2nd Moritz Schubotz  FIZ Karlsruhe
Karlsruhe, Germany
<EMAIL_ADDRESS>3rd Bela Gipp  University of Wuppertal
Wuppertal, Germany
<EMAIL_ADDRESS>
###### Abstract

Document subject classification is essential for structuring (digital)
libraries and allowing readers to search within a specific field. Currently,
the classification is typically made by human domain experts. Semi-supervised
Machine Learning algorithms can support them by exploiting the labeled data to
predict subject classes for unclassified new documents. However, while humans
partly do, machines mostly do not explain the reasons for their decisions.
Recently, explainable AI research to address the problem of Machine Learning
decisions being a black box has increasingly gained interest. Explainer models
have already been applied to the classification of natural language texts,
such as legal or medical documents. Documents from Science, Technology,
Engineering, and Mathematics (STEM) disciplines are more difficult to analyze,
since they contain both textual and mathematical formula content. In this
paper, we present first advances towards _STEM document classification
explainability_ using classical and mathematical Entity Linking. We examine
relationships between textual and mathematical subject classes and entities,
mining a collection of documents from the arXiv preprint repository (NTCIR and
zbMATH dataset). The results indicate that mathematical entities have the
potential to provide high explainability as they are a crucial part of a STEM
document.

###### Index Terms:

Information Systems, Information Retrieval, Classification Explainability,
Entity Linking

##  I Introduction

Since the earliest known scheme by the Greek Callimachus, a librarian of the
Library of Alexandria, there have been many different efforts to classify
subject categories in document collections. Libraries need to be sorted such
that readers can search for literature in specified areas or on specific
topics of interest. With the rise of digital libraries, machine-readable
documents, and Machine Learning methods, human expert classifiers are
supported by computers. However, while humans partly do, machines typically do
not explain their classification decisions. Document classification is often a
black box and needs more transparency and explainability. The topic of
explainable AI (XAI) has recently gained increasing interest in Machine
Learning applications, e.g., in jurisdiction and medicine where the fate of
individual humans depends on AI decisions. In addition to global decision tree
interpretation, methods to explain the impact of input features on individual
predictions, i.e., locally on single data samples, have been developed.

Mathematical documents from Science, Technology, Engineering, and Mathematics
(STEM) fields usually contain a large number of mathematical formulae
alongside the text. Thus, some of the documents key concepts can be encoded in
symbolic, no-textual form. To explain a mathematical document classification,
such entities need to be mapped to natural language concept names first.
Mathematical Entity Linking (MathEL) is very challenging since the ambiguity
of symbols and multitude of equivalent concept representations is even more
tremendous than for text.

Until now, there have been only explainable classification approaches for
natural language textual documents, which do not contain mathematical
(formula) content. To address this shortcoming, we develop MathEL for STEM
document explainability. We examine relations between subject classes and
entities statistically and using state-of-the-art classification
explainability approaches. We also examine formula identifier symbol-name
distributions (relationships between natural and mathematical language in a
STEM document) and their entropy. Identifiers are formula variables with no
fixed value111https://www.w3.org/TR/MathML3/chapter4.html#contm.ci, e.g., some
of the quantities (energy, mass, etc.) in physics formulae.

Our key findings are 1) the ambiguity of identifier symbols is distributed
across document category classes while their semantic names are more
predictable with smaller categorical cross-entropy; 2) an increasing number of
unsupervised identifier name augmentation deteriorates the classification
accuracy; 3) removing identifier names from the textual document features
significantly reduces classification performance; 4) for 80% of the examined
formulae a concept name could be found within a surrounding text window of
$\pm 10$ words; and 5) math features are more explainable than text features
and a discriminative ranking is more explainable than a frequency ranking in
terms of entropy.

The results show that linking mathematical elements (formulae, identifiers) to
their concept names and URIs can enhance the document classification
explainability. Besides, MathIR systems, such as search engines, recommender,
and question answering systems, can employ and profit from machine-
interpretable labeled formula data, which is generated by MathEL.

##  II Related Work

The fastly growing and largely available amount of digital documents has led
to the development and employment of methods for Automatic Document
Classification (ADC) [1]. Documents need to be rapidly categorized, and human
domain expert labeling is tedious and time-consuming. ADC approaches are
faster and thus less expensive. Furthermore, the algorithms are portable and
can be applied to a variety of other applications, such as spam filtering,
sentiment analysis, product categorization, speech categorization, author and
text genre identification, essay grading, word sense disambiguation, and
hierarchical categorization of web pages [2].

###  II-A Explainable Text Classification

Although more effective, machine learning classifiers are less interpretable
than classical fuzzy logic methods. This led to efforts to develop more
explainable classification models.

In 2014, Martens and Provost present methods to address the problem of high
corpus dimensionality [3]. They extend prior models by defining explanation as
a minimal set of words or terms without which the predicted class of interest
would change. Subsequently, an algorithm to seek such explainer sets is
introduced and evaluated in real-world case studies. In the first, web pages
are employed for which advertisement decisions depend on the classification.
In the second, news-story topic classification is examined and discussed.

Mahoney et al. present a framework for explainable text classification in
legal document review [4]. They address the problem of the ADC being a ‘black
box’ preventing attorneys from understanding why documents are classified as
responsive depending on text snippets. The goal is to reduce reviewers’ time
and increase their classification confidence. Experiments are carried out on a
dataset consisting of 688,294 manually labeled by attorneys. The framework
could achieve a ‘rationale recall’ of up to 86.68% for identifying snippets
that would explain the classification decision.

Liu et al. develop a new approach that included fine-grained information
(textual explanations for the labels) to explicitly generate the human-
readable explanations [5]. They construct two new datasets containing
summaries, rating scores, and fine-grained classification reasons.
Subsequently, they conduct experiments on both datasets, claiming that their
model outperformed several high-performing neural network baseline systems.

In 2016, Ribeiro et al. present ‘LIME’ - a method for ‘Local Interpretable
Model-agnostic Explanations’ to improve human trust in a classifier [6]. They
train an interpretable model locally around individual prediction examples to
be explained. The task is framed as a submodular optimization problem. They
demonstrate the model performance and flexibility on both classical Machine
and neural Deep Learning models for text and images.

In 2019, Lundberg et al. present ‘SHAP’ - an approach to improve the
interpretability of tree-based models using game-theoretic Shapley values [7].
They claim to contribute (1) a polynomial-time algorithm to compute optimal
explanations, (2) a new type of explanation that directly measures local
feature interaction effects, and (3) a new set of tools for understanding
global model structure based on combining many local explanations of each
prediction. The tools are evaluated to three applied medical Machine Learning
problems (classification of risk factors). The open-source SHAP
model222https://github.com/slundberg/shap is heavily employed by currently
around 2,400 users.

###  II-B Mathematical (STEM) Document Classification

There are single-label and multi-label, as well as coarse-grained and fine-
grained (hierarchical) classification problems. In the case of mathematical
documents, the zbMATH library333https://zbmath.org is sorted and labeled using
the fine-grained hierarchical ‘Mathematics Subject Classification
(MSC)’444https://zbmath.org/static/msc2020.pdf, which has a long
history555http://www.mi.uni-koeln.de/c/mirror/www.ams.org/msc/msc-changes.html
with major version publications every ten years (e.g., 2000, 2010, 2020).
While the MSC is three-level, the arXiv preprint
repository666https://arxiv.org has only a more coarse-grained two-level
taxonomy777https://arxiv.org/category_taxonomy.

Classification approaches can be divided into supervised and semi-supervised.
The latter type requires to manually label less data. It can be further
divided into few-shot learning (FSL), one-shot learning (OSL), and zero-shot
learning (ZSL) [8], where the number of ‘shots’ signifies the number of
examples, for which the model needs to predict new labels. Due to the large
number of classes in fine-grained classification schemes, there are often only
zero, one, or a few examples available for each class. This motivates the use
of ZSL, OSL, and FSL in this scenario.

In 2008, Watt examined the use of relative symbols and expression frequencies
to classify a mathematical document according to the MSC scheme [9]. It was
found that the particular use of symbols and expressions, i.e., their
frequency ranking, vary from area to area between different top-level subjects
of the MSC 2000. However, the shape of the relative frequency curve was noted
to remain the same. It was claimed that the symbol frequency ‘fingerprints’
for the different MSC areas could be used to classify given mathematical
documents.

Kuśmierczyk et al. compared hierarchical mathematical document clustering
against the hierarchical MSC classification tree [10]. They postulated that
the hierarchy was highly correlated with the document content. Using
publications from the zbMATH database, they aimed at reconstructing the
original MSC tree based on document metadata. For the comparison, they
developed novel tree similarity measures. The best results were obtained for
3-level hierarchical clustering using bigram encodings.

In 2014, Schoeneberg et al. discussed part-of-speech (POS) Tagging and its
applications for mathematics [11]. Their goal was to adapt NLP methods to the
special requirements for STEM document content analysis. They presented a
mathematics-aware POS tagger for mathematical publications. It was trained
using keyphrase extraction and classification of documents from the zbMATH
database. The results showed that while the precision was sufficient (for 26
of the 63 top-level classes higher than 0.75 and only for 4 classes smaller
than 0.5), the recall was very low.

In 2017, Suzuki and Fujii presented a structure-based method for Mathematical
Document Classification [12]. They include structures of mathematical
expressions (ME) as classification features combined with the text. They
hypothesize that ME would hold important information about mathematical
concepts, being a central part of communication STEM fields. Employing 3,339
Q&A threads from MathOverflow888https://mathoverflow.net and 37,735 papers
from the arXiv, they achieve classification F-measures of 0.68 on text and
0.71 on combined text and math encodings.

In 2019, Ginev and Miller performed a supervised Scientific Statement
Classification over arXiv.org[13]. Exploring 50 author-annotated categories,
they group 10.5 million annotated paragraphs into 13 classes. Using a BiLSTM
encoder-decoder model, a maximum F1-score of 0.91 is achieved. Further, they
introduce a lexeme serialization for mathematical formulae and discuss the
limitations of both data and task design, complaining the lack of capacity to
provide a real human evaluation of the classification results.

In 2020, Scharpf et al. presented large-scale experiments for classification
and clustering of arXiv documents, sections, and abstracts comparing encodings
of natural and mathematical language [1]. They evaluate the performance and
runtimes of selected algorithms, achieving classification accuracies up to
82.8% and cluster purities up to 69.4%. Further, they observe a relatively low
correlation between text and math similarity, indicating a potential
independence of text and formula document features. Moreover, they demonstrate
the computer outperforming a human expert in classification performance.
Lastly, they discuss the inter-class variance of the math encodings and the
need for identifier semantics disambiguation by unsupervised enrichment or
supervised annotation.

Most recently, Schbotz et al. presented ‘AutoMSC’ - a system for the automatic
assignment of Mathematics Subject Classification (MSC) labels [14]. Evaluating
the performance of automatic methods in comparison to a human baseline, they
find that their best performing method achieving an F1-score of 77.2%. They
claim that using their models, the manual classification effort could be
reduced by 86.2% without losing classification quality.

###  II-C Mathematical Entity Linking

Entity Linking (EL) is the task of linking textual entities, such as concepts,
persons, etc. to unique identifiers (URLs) [15]. EL has a variety of
Information Retrieval (IR) and Natural Language Processing (NLP) applications,
such as semantic search and question answering, text enrichment, relationship
extraction, entity summarization, etc. [16]. On the other hand, Mathematical
Entity Linking (MathEL) links formulae and their constituting entities
(identifiers, operators, etc.) to concept names or Wikimedia URLs [17]. Among
other applications, MathEL allows for formula referencing (math citations) and
Mathematical Question Answering (MathQA) [18].

In 2016, Kristianto et al. propose a learning-based approach to link
mathematical expressions to Wikipedia articles by exploiting textual and
mathematical document features [19, 20]. They introduce a dataset for
benchmarking training and testing, achieving a precision of 83.40%, compared
to the 6.22% baseline performance. One of their findings is that important
math expressions can often be found at the top of articles and are highlighted
as boxed block-level.

In 2019, ‘Formula Concepts’ (FC) are introduced as collections of equivalent
formulae with different notational representations that can be bundled under
the same name (and linked to a Wiki resource) [21]. Their goal is to
generalize and extend classical textual citation methods to include
mathematical formula citations. They call out for a Formula Concept Retrieval
challenge with two subtasks: Formula Concept Discovery (FCD) and Formula
Concept Recognition (FCR). While the goal of FCD is to analytically or
empirically discover a definition of an FC, the purpose of FCR is to match and
link math expressions occurring in documents to unique resources (e.g.,
Wikidata item ID). The authors develop and evaluate first Machine Learning
based approaches to tackle the FCD and FCR tasks.

Apart from unsupervised methods for FC retrieval, also supervised approaches
were presented. The ‘AnnoMathTeX’ formula and identifier annotation
recommender system is designed to disambiguate and match mathematical
expressions in Wikipedia articles to Wikidata items [22]. The system suggests
annotation name and item candidates provided from several sources, such as the
arXiv, Wikipedia, Wikidata, or the text that surrounds the formula. A first
evaluation showed that in total, 78% of the identifier name recommendations
were accepted by the user.

The study was subsequently extended to an assessment of the community
acceptance of the Wikipedia article link and Wikidata item seed edits [17].
The contributions were accepted in 88% of the edited Wikipedia articles and
67% of the Wikidata items. Furthermore, a speedup of the annotation process by
a factor of 1.4 for formulae and 2.4 for identifiers was achieved. The
recommender system is intended to be soon integrated seamlessly into the
Wikimedia user interfaces via a ‘MathWikiLink’ API.

Having reviewed the state of the art in explainable text classification,
mathematical (STEM) document classification and mathematical Entity Linking,
our goal is to bridge the topics. In this paper, we would like to address the
research gap and need for explainable mathematical document classification
systems that employ mathematical Entity Linking and assess the relations
between document categories and entities.

##  III Methods

In this paper, we address the information need of document subject category
classification interpretability and explainability. Therefore, we analyze the
relationships between categories (labels) and entities (features) of a
document.

###  III-A Research Questions

Our research is driven by the following questions:

  1. 1.

How can we quantity and tackle the ambiguity of formula identifier symbols?

  2. 2.

Does unsupervised enrichment of identifier names enhance document
classification accuracy?

  3. 3.

Does unsupervised removal of identifier names from the text deteriorate
document classification accuracy?

  4. 4.

How well does unsupervised entity linking perform both on text and math
elements of a STEM document?

  5. 5.

Do text or math document features provide more interpretability or
explainability?

Specifically, we would like to know whether it is possible to predict the
subject class using formula concept and identifier entities as features. Can
formula and identifier entity labels be used to improve classification?
Further, we would like to find out whether there are namespace clusters for
identifier annotations per subject class. Is it possible to predict the
identifier annotation disambiguation using the subject class and vice versa?
Can we employ subject class labels to improve identifier and formula entity
link disambiguation? Moreover, we will explore the quality of inferring
relations between arXiv subject classes and MSCs labels. Lastly, we aim to
investigate whether all formula concept entity names appear somewhere in the
surrounding text or are hidden in the context, requiring domain knowledge to
infer them.

Our long-term goal is to establish a framework to employ entity links as
features for document classification and category labels as namespaces for
identifier disambiguation.

###  III-B Research Tasks

To answer our research questions, we set up the following tasks:

  1. 1.

Select documents from arXiv corpus with both arXiv subject class and MSC
available (physics domains).

  2. 2.

Evaluate the MSC-arXiv category correspondence predictability.

  3. 3.

Analyze the class distributions of identifier symbols and names (semantics)
and their entropies.

  4. 4.

Evaluate the impact of unsupervised semantic identifier enrichment on document
classification.

  5. 5.

Evaluate the impact of category-concept augmentations on document
classification.

  6. 6.

Build an Entity Linker (Wikifier) for both natural language (classical EL) and
mathematical language (MathEL) entities.

  7. 7.

Evaluate different retrieval methods and sources in comparison.

  8. 8.

Evaluate the class-entity explainability using different class limits,
features, samplings, encodings, classifiers, explainers, and prediction modes.

In our experiments, we vary numerous evaluation parameters, such as included
subject classes and granularity, ranking size, distribution type, n-gram
length, text cleaning, word windows, etc. We evaluate our experimental results
using several different evaluation metrics, such as class prediction accuracy,
entity prediction relevance and ranking, precision, recall, F1-measure, and
distribution entropy.

##  IV Evaluation

In this section, we will present and discuss our evaluation results. Data,
code and result tables are publicly available at
https://github.com/AnonymousCSResearcher/STEMdocClassEntityExplainability.
Figure 1 shows the workflow of our experiments to examine Entity Linking for
both textual and mathematical entities and entity-category correspondence as a
prerequisite for classification entity explainability.

Figure 1: Evaluation workflow. Entity Linking for both textual and
mathematical entities and entity-category correspondence is examined as a
prerequisite for classification entity explainability.

We first introduce the NTCIR-11/12 arXiv dataset, which we employ.
Subsequently, we examine the correspondence of arXiv and MSC categories. Next,
we perform an identifier class semantics distribution analysis. We then test
the impact of unsupervised semantic identifier enrichment and category concept
augmentations on document classification. Finally, we present Wikification
Entity Linking for both natural and mathematical language entities (text and
formulae) and explore class-entity correlations to achieve classification
explainability.

###  IV-A NTCIR arXiv Dataset

In our experiments, we employ documents (research task 1) from the arXiv
NTCIR-11/12 dataset [23]. The dataset is available at http://ntcir-
math.nii.ac.jp/data. It was provided by the National Institute of Informatics
Testbeds and Community for Information Access Research Project (NTCIR) and
contains 105,120 document section files from scientific articles in English.
Each arXiv document in the corpus was divided into paragraphs to make it more
digestible for math retrieval tasks. The documents were converted from LaTeXto
an HTML + MathML based TEI999https://tei-c.org format by the
KWARC101010http://kwarc.info project. The articles were selected from the
arXiv categories math, computer science, and physics disciplines. The
documents contain about 60 million mathematical formulae, including monomial
expressions, e.g., $x$ or $t^{2}$. The disc size of the dataset is about 174
GB uncompressed and is intended to be used for Information Retrieval research
tasks, such as Natural Language Processing, text analysis, and mathematical
expression tree structure search111111http://ntcir-
math.nii.ac.jp/ntcir11-math/task-overview.

###  IV-B MSC-arXiv Category Correspondence

In our first experiment, we analyze the correspondence of arXiv and MSC
subject class categories (research task 2) since the two different schemas
need to be consolidated. Document classification explainability can refer to
either one of those schemas (and others if available). We approach this task
two-fold: 1) inferring relations from a constructed co-occurrence matrix, 2)
using TF-IDF encodings and a Logistic Regression classifier. For 258,830
documents, both arXiv category and MSC classification labels were available,
which could so be matched per document. We created a correspondence table with
arXiv ID, zbMATH ID, MSC categories, and arXiv categories. The first two
columns contain identification numbers to locate the documents in the arXiv
and zbMATH databases, respectively. The last two columns contain the
classification categories in the arXiv and MSC schemes, respectively. The MSC
number has 5 digits (three-level taxonomy, e.g., ‘85-A-05’ for ‘galactic and
stellar dynamics astrophysics’) while the arXiv subject contains subject and
subcategory (two-level taxonomy, e.g., ‘astro-ph.SR’ for ‘solar and stellar
astrophysics’).

From the co-occurrence matrix, we derive two uncertainty measures. For each
distribution, we first calculate the (Shannon) entropy uncertainty as

$\displaystyle S=-\sum_{i}p_{i}\cdot\log_{2}\left(p_{i}\right)$

Secondly, we calculate the margin uncertainty as the probability difference
between the first and second highest class count. With increasing margin, the
(mixup) uncertainty decreases and classification accuracy increases. For the
arXiv subject class distributions the results are 1) entropies: (mean, max) =
(1.86, 3.11), and 2) margins: (mean, max) = (1.00, 1.00). For the MSC category
distributions the results are 1) entropies: (mean, max) = (1.67, 3.59), and 2)
margins: (mean, max) = (0.02, 0.99). It is evident that from the co-occurrence
frequency statistics, arXiv categories can be predicted more accurately than
MSCs, as the significantly larger mean margin indicates.

Next, we investigate whether this result is qualitatively reproduced by a
trained classifier. We tackle the multi-label data as multiple repeated
single-label instances. This means that if for one document there are, e.g.,
two-class labels to predict, we add them as two separate data points. We
employ a Logistic Regression classifier on TF-IDF encodings to compare
different prediction directions (from MSC to arXiv and vice versa), label
modes (single-label vs. multi-label), and levels of granularity (coarse,
fine). Table I) shows the results of this experiment. The result from the
first experiment that the prediction of arXiv categories from MSCs is more
accurate is qualitatively reproduced. It can be explained by the fact that at
the deepest taxonomic level, the total number of MSCs (6202) is much larger
than the number of arXiv categories (156). Due to this large number of MSCs,
we focus on arXiv categories in subsequent explainability experiments, since
for the latter, we have more data for each class.

TABLE I: Prediction accuracy of arXiv subject classes from MSC labels and vice versa using a Logistic Regression classifier on TF-IDF encodings, while comparing different label modes and levels of granularity. Prediction/granularity | Coarse | Fine
---|---|---
single-label |
arXiv from MSC | 0.87 | 0.69
MSC from arXiv | 0.61 | 0.31
multi-label |
arXiv from MSC | 0.72 | 0.44
MSC from arXiv | 0.52 | 0.42

Comparing the classifier predictions to Argmax predictions (most frequent
class is predicted) from the co-occurrence matrix, we find only 3 matches and
153 mismatches for the 156 arXiv categories. This can potentially be explained
by the difference that cross-correlations are taken into account by the
encodings and the classifier but not included in the occurrence frequency
statistics. One could also perform multi-label classification with different
weights for the first, second, third, etc., most probable prediction. However,
it is a priori unclear how many labels are necessary for each individual
document (it can vary), and even a confidence threshold would not reasonably
mitigate the problem since it is difficult or impossible to determine.

###  IV-C Identifier Class Semantics Distributions

A mathematical formula typically consists of ‘identifiers’, such as $E$, $m$,
and $c$ for $E=mc^{2}$. In addition to the formula concept, these identifiers
are also linkable mathematical entities. Unfortunately, the symbols are highly
ambiguous. For example, the variable $x$ is used in a variety of different
contexts besides the most common meanings of ‘unknown’, ‘coordinate’, and
‘vector’. For document classification explainability, it is essential to know
how the meanings (in the following named ‘semantics’) are distributed over
subject classes or categories. To examine this, we address research question 1
by research task 3.

(a)

(b)

Figure 2: Class distribution for identifier symbol ‘t’ in comparison to
semantics ‘time’, which has a lower information entropy.

Figure 2 shows a comparison of the class distribution of the identifier symbol
$t$ (left) to the semantic name ‘time’ (right), which was found to be the most
used in physics on the employed NTCIR test dataset. The uniform normalized
occurrence frequency indicates that for the symbol (left), there are more
equal values for several classes. This means that the use of the symbol is not
a good predictor of the class to provide explainability. On the other hand,
for the semantic name (right), there are sharper peaks (at the right end).
Calculating the Shannon information distribution entropies, we can support
this finding by a smaller value (3.25 < 3.98).

TABLE II: Comparison of identifier symbol (e.g., ‘m’) and name (e.g., ‘mass’)
distribution entropies.

Feature/measure | Min (entropies) | Mean (entropies) | Max (entropies)
---|---|---|---
Identifier symbols | 2.01 | 3.77 | 4.07
Identifer names | 0.00 | 0.56 | 4.24

To generalize this example observation, we calculate the entropies for the
whole corpus (Table II). The mean of the entropies of the identifier symbols
is almost 7 times larger than the mean of the entropies of the identifier
names. This means that the identifier semantics can more ’sharply’ be
determined by or explain the subject class, whereas identifier symbols widely
spread over all subject classes. This is not surprising considering that word
sets are much larger than identifier symbol sets (Latin and Greek alphabet),
reflecting symbol ambiguity and the need for semantic enrichment, MathEL, and
an identifier semantics vocabulary.

TABLE III: Scheme of the identifier semantics class statistics library. For each distribution, the number of documents containing the respective combination - e.g., identifier-class - is displayed. Order Scheme | Example
---|---
Class distribution | {’quant-ph’: 6082, ’math’: 3997, ’physics’: 438, …}
Class-identifier distribution | {’math’: {’e’: 61, ’T’: 45, ’M’: 35, …}, …}
Class-semantics distribution | {’physics’: {’field’: 50, ’function’: 30, ’constant’: 25, …}, …}
Identifier-class distribution | {’t’: {’quant-ph’: 100, ’math’: 33, ’physics’: 10, …}, …}
Identifier-semantics distribution | {’t’: {’time’: 831, ’coordinate’: 215, ’function’: 182, …}, …}
Identifier-class-semantics distribution | {’t’: {’quant-ph’: {’time’: 55, ’system’: 9, ’function’: 9, …}, …}, …}
Semantics-class distribution | {’time’: {’quant-ph’: 314, ’nlin’: 30, ’physics’: 25, …}, …}
Semantics-identifier distribution | {’time’: {’t’: 95, ’tau’: 61, ’T’: 32, …}, …}
Semantics-class-identifier distribution | {’time’: {’quant-ph’: {’t’: 55, ’tau’: 26, ’T’: 24, …}, …}, …}

Table III summarizes our identifier statistics library catalog containing
attributions between classes, identifier symbols (‘identifier’), and names
(‘semantics’). For example, the ‘semantics-identifier distribution’ shows that
the semantics ‘time’ denotes 95 times the identifier symbol ‘t’, 61 times
‘tau’, etc. Conversely, the identifier symbol ‘t’ is denoted 831 times with
the semantics ‘time’, 215 times with ‘coordinate’, etc.

###  IV-D Unsupervised Semantic Identifier Enrichment for Document
Classification

As a prerequisite for evaluating the classification impact of formula MathEL,
we assess the effect of identifier MathEL (research task 4) first. In this
subsection, we perform experiments to answer research questions 2 and 3.
First, we would like to know whether the unsupervised (since supervised is
costly and not scalable) enrichment of identifier names improves or
deteriorates document classification accuracy. After parsing the documents
from the NTCIR dataset, identifier symbols are extracted from their formula
MathML markup. Subsequently, the (Latin and Greek letters) are mapped to their
textual meaning, e.g., ’energy’ for the $E$ in $E=mc^{2}$. For the identifier
augmentation, we employ the following sources:

  * •

Wikipedia: identifier symbol-value relations retrieved from surrounding text
statistics of Wikipedia
articles121212https://en.wikipedia.org/w/index.php?title=User:Physikerwelt&oldid=738857609;

  * •

arXiv: identifier symbol-value relations retrieved from occurrence frequency
statistics in arXiv documents;

  * •

Wikidata: identifier symbol-value relations retrieved from mathematical
Wikidata items via SPARQL queries131313https://query.wikidata.org/.

We employ the following subject class selection: ‘cs’ (computer science),
‘physics’, ‘astro-ph’, ‘cond-mat’, ‘gr-qc’, ‘hep-lat’, ‘hep-ph’, ‘hep-th’,
‘quant-ph’ (physics), ‘math-ph’, ‘math’, ‘nlin’, ‘alg-geom’, ‘q-alg’
(mathematics).

Using a Logistic Regression classifier on TF-IDF encodings, we find out that
the 80.6 accuracy of text-only is drastically reduced to 23.0 when including
identifier symbols. However, identifier name augmentations almost double the
latter result to accuracy values around 0.5, as shown in Table IV.

TABLE IV: Classification accuracy using Logistic Regression on TF-IDF encodings of NTCIR arXiv document texts that were extended by unsupervised identifier semantification names provided by the AnnoMathTeX API [22, 17]. Source/Cutoff | Top 3 | Top 5
---|---|---
arXiv | 0.53 | 0.50
Wikipedia | 0.49 | 0.46
Wikidata | 0.51 | 0.49

We compare enriching with top 3 to top 5 candidates and conclude from the
observation that the former slightly outperforms the latter that it is better
to have less but more meaningful augmentations. We also note that the arXiv
slightly outperforms the other sources. However, the differences between all
measured values are very small. We conclude that MathEL for identifiers maybe
not necessary for explainability as it deteriorates the classification
accuracy.

###  IV-E Category-Concept Augmentations

Having investigated the effect of identifier name augmentations (research task
4), we continue exploring the impact of formula concept name augmentations
(research task 5). Specifically, we employ labelled concept-(sub)category
mappings provided by Wikipedia
authors141414https://en.wikipedia.org/w/index.php?title=Outline_of_physics&oldid=997028605#General_concepts_of_physics.

As there is no cross-discipline data available, in this experiment we employ a
smaller subject class selection only from physics: ‘astro-ph’, ‘cond-mat’,
‘gr-qc’, ‘hep-lat’, ‘hep-ph’, ‘hep-th’, ‘quant-ph’.

TABLE V: Classification accuracy of Logistic Regression on TF-IDF encodings of different document content types (text, math) and combinations thereof (plus, minus). Encoded | Text | Math | Text + Math | Text - Math
---|---|---|---|---
Accuracy | 0.73 | 0.60 | 0.60 | 0.19
Duration | 1.0 | 0.21 | 0.20 | 0.04

Adding the concept-category augmentations does deteriorate the full text
classification accuracy of 73.3 to 60.0 of employing the concept-category
augmentations as features alone (see Table V). Interestingly, removing the
augmentations from the full text reduces the classification performance to
19.0 only. This means that the augmentations seem to have some explanatory
value. Further investigations show that all of the augmented categories are
present in at least one of the documents per class.

###  IV-F Wikisource Entity Linking (Wikification)

The next step in our experiments to examine classification explainability by
entity linking is to evaluate natural and mathematical Wikisource entity
linker for STEM document Wikification. We, therefore, investigate research
question 4 by carrying out research tasks 6 and 7. From the NTCIR dataset, we
select a random document with both arXiv category and MSC available.

#### Natural Language Entities

First, we evaluate different entity linking methods or sources, such as a
Wikipedia article name
dump151515http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-all-titles-
in-ns0.gz, and Wikidata Pywikibot161616https://github.com/wikimedia/pywikibot
or SPARQL retrieval. The unsupervised approaches predict Wikipedia article
names and URLs or Wikidata item names and QIDs.

TABLE VI: Excerpt (7 out of 198 tuple lines) from the evaluation of Natural
Language Entity Linking to Wikipedia and Wikidata for concepts in a selected
abstract from the NTCIR arXiv dataset. A binary classification is made for
Wikidump name (eval1) and URL (eval2), Pywikibot retrieved item (eval3) and
QID (eval4), and SPARQL retrieved item (eval5) and QID (eval6). The respective
values for precision, recall, and F1 measure are displayed in bottom lines
(unlemmatized / lemmatized).

Tuple | Relevance | Wikipedia URL | Wikidata QID | eval1 | eval2 | eval3 | eval4 | eval5 | eval6
---|---|---|---|---|---|---|---|---|---
find that | 0 | - | - | FP | FP | FP | TN | TN | TN
that the | 0 | - | - | TN | TN | TN | TN | TN | TN
the required | 0 | - | - | TN | TN | TN | TN | TN | TN
required velocity | 1/2 | …wiki/Velocity | Q11465 | FN | FN | FN | FN | FN | FN
velocity dispersion | 1 | …wiki/Velocity_dispersion | Q637450 | TP | TP | TP | TP | TP | TP
dispersion is | 1 | …wiki/Dispersion_relation | Q590051 | FN | FN | FN | FN | FN | FN
is of | 0 | - | - | TN | TN | TN | TN | TN | TN
of the | 0 | - | - | TN | TN | TN | TN | TN | TN
l | l | l | Precision | 0.63 / 0.67 | 0.70 / 0.67 | 1.00 / 0.44 | 1.00 / 0.44 | 1.00 / 0.30 | 1.00 / 0.30
l | l | l | Recall | 0.15 / 0.08 | 0.21 / 0.08 | 0.01 / 0.56 | 0.19 / 0.56 | 0.04 / 0.26 | 0.21 / 0.26
l | l | l | F1-measure | 0.24 / 0.14 | 0.32 / 0.14 | 0.02 / 0.49 | 0.32 / 0.49 | 0.08 / 0.28 | 0.35 / 0.28

For each tuple in the abstract of the selected document, its relevance (0 or
1, 1/2 if only one of the two words was relevant) as a candidate entity to be
linked was manually assessed by a domain expert. Table VI shows some example
lines from our evaluation of the EL predictions. The binary classification
(true positive: TP, false positive: FP, false negative: FN, true negative: TN)
is shown for Wikidump name (eval1) and URL (eval2), Pywikibot retrieved item
(eval3), and QID (eval4), and SPARQL retrieved item (eval5) and QID (eval6).
The comparison is made with the manual relevance assessment to evaluate the
quality of the EL predictions. It is classified FN if the content (page, item,
URL, QID) is wrong. While FP and TN can be assessed automatically, TP and FN
need to be controlled using human supervision. The links can potentially be
used as Wikipedia article enrichment candidates. At the bottom, precision,
recall, and F1-measures are displayed for each eval mode (with a distinction
between unlemmatized / lemmatized), calculated as

precision $\displaystyle=\frac{TP}{TP+FP},$ recall
$\displaystyle=\frac{TP}{TP+FN},\ \text{and}$ $\displaystyle F1$
$\displaystyle=2\cdot\frac{\mathrm{precision}\cdot\mathrm{recall}}{\mathrm{precision}+\mathrm{recall}}.$

Stopwords like ‘the’, ‘of’, ‘is’, ‘are’, etc. are not counted in the
classification of relevance (especially if 1/2). Stopword removal and
lemmatization (e.g., mapping ‘vortices’ to ‘vortex’) is made using the
nltk171717https://www.nltk.org python library. We introduce stopword removal
and lemmatization because without the precision is high and the recall is low.
The number of FP being low indicates that not many non physics-related
entities were retrieved, while a high number of FN means that many entities
were missed out because of conjugation.

Table VI reveals that unlemmatized, the SPARQL retrieval from Wikidata (eval6)
performs best (highest mean among measures) and Wikidump retrieval (eval1)
worst. For the lemmatized case, we find that the mean precision and recall are
very similar. The pywikibot item name and QID retrieval (eval 3 and 4) perform
best. At the transition from unlemmatized to lemmatized, the precision
decreases (mean: 0.47 < 0.88) but recall increases (0.30 > 0.14). The
lemmatized mode has a better F1 than unlemmatized in both mean (0.30 > 0.22)
and max (0.49 > 0.35). The full lists of results can be found in the
repository.

#### Mathematical Language Entities

Having evaluated natural language entity linking, we now examine the
feasibility of mathematical Entity Linking on the selected STEM document from
the NTCIR arXiv dataset. Here, the evaluation procedure using manual
examinations by our domain expert is three-fold. We first identify relevant
formula concept entities as linking candidates in the introduction of the
analyzed physics paper. Second, we name them and retrieve the corresponding
Wikidata item and QID linking (if available). Third, we spot relevant name
candidates in a window of 10 words in the surrounding text before and after
the given formula. We define a score as 0 if ‘irrelevant’, 1 if ‘partly
relevant’, and 2 if ‘highly relevant’.

TABLE VII: Excerpt from the evaluation of mathematical Entity Linking to
Wikipedia and Wikidata for Formula Concepts in a selected article from the
NTCIR arXiv dataset. N-grams are taken up to N=3, and a score is given as 0
for ‘irrelevant’, 1 for ‘partly relevant’, and 2 for ‘highly relevant’. The
rank is positive if the concept name appears before the formula and negative
if after in the text word window.

Formula Concept ID | Formula Concept Name | N-gram | (Score, Rank) | Wikipedia article | Wikidata item
---|---|---|---|---|---
1 | Gross-Pitaevski equation | 3 | (2,-8) | Gross–Pitaevskii_equation | Q910667
2 | Circulation in condensate | 3 | (0,-) | - | -
2 | Circulation | 1 | (1,-6) | Circulation_(physics) | Q205880
2 | Condensate | 1 | (1,-4) | Bose–Einstein_condensate | Q46202
3 | Axion mass | 2 | (1,-7) | Axion | Q792548
3 | Axion | 1 | (1,-7) | Axion | Q792548
3 | Mass | 1 | (1,-6) | Mass | Q11423
4 | Gross-Pitaevski equation | 3 | (2,-6) | Gross–Pitaevskii_equation | Q910667
5 | General solution | 2 | (2,-9) | Gross–Pitaevskii_equation | Q910667
6 | Spherical Bessel function | 3 | (2,-9) | Bessel_function#Spherical_Bessel_functions | -
6 | Spherical | 1 | (1,-9) | Sphere | Q12507
6 | Bessel function | 2 | (1,-8) | Bessel_function | Q219637
6 | Bessel | 1 | (1,-8) | Friedrich_Bessel | Q75845
6 | Function | 1 | (1,-7) | Function_(mathematics) | Q11348
7 | Energy density of the axion condensate | 4 | (1,-10) | Energy_density | Q828402
7 | Energy density | 2 | (0,-) | Energy_density | Q828402
7 | Energy | 1 | (0,-) | Energy#Cosmology | Q11379
7 | Density | 1 | (0,-) | Density | Q29539
7 | Axion | 1 | (1,-10) | Axion | Q792548
7 | Condensate | 1 | (1,-9) | Bose–Einstein_condensate | Q46202

Table VII contains an excerpt of the results of our assessment. It shows 20 of
the 56 spotted entity link candidates (for 23 identified formula concepts).
For each, the availability of a corresponding Wikipedia article and Wikidata
item was checked. We found 51/56 = 91% for the items and 53/56 = 95% for the
articles. Further, in 43/56 = 77% of the cases, the surrounding text contained
name candidates that can be selected by the entity linker and connected to
Wikipedia and/or Wikidata. Among them, 12 were ‘highly relevant’. For 13
formula concepts, the name was ‘hidden’ in the context, requiring domain
knowledge to infer them, which is impossible to do automatically by an entity
linker.

###  IV-G Class-Entity Explainability

Finally, we will examine the potential for class-entity explainability. We
investigate whether text or math features provide more interpretability
(research question 5) using different class limits, features, samplings,
encodings, classifiers, explainers, and prediction modes (research task 8).

In our analysis, we employ the following experimental parameter variations:

  1. 1.

Batch: Class limit.

  2. 2.

Features: Text, math.

  3. 3.

Sampling: Most frequent, most discriminative.

  4. 4.

Encoding: TF-IDF, Doc2Vec.

  5. 5.

Classifier: LogReg, SVC.

  6. 6.

Explainer: LIME, SHAP.

  7. 7.

Prediction: Classes from entities (ClsEnt), entities from classes (EntCls).

We achieve the best results using a LIME explainer applied to a LogReg
classifier on TF-IDF encodings (default scikit-learn181818https://scikit-
learn.org configurations). To assess the potential of entity-category
explainability, we examine the following four distributions:

  1. 1.

‘MFreqText’: Most frequent entities in the textual content.

  2. 2.

‘MFreqMath’: Most frequent entities in the mathematical content.

  3. 3.

‘MDiscText’: Most discriminative entities in the textual content.

  4. 4.

‘MDiscMath’: Most discriminative entities in the mathematical content.

From the NTCIR corpus, we select the following classes: ‘astro-ph’, ‘cond-
mat’, ‘gr-qc’, ‘hep-lat’, ‘hep-ph’, ‘hep-th’, ‘math-ph’, ‘nlin’, ‘quant-ph’,
‘physics’]. We then calculate entropies for class entity distributions to find
out which setting has the most predictive power and can be employed for
document explainability.

TABLE VIII: Entropies for class and entity distributions using documents from 10 different arXiv subject classes. The most frequent (MFreq) and most discriminative (MDisc) predictions of classes from entities (ClsEnt) or vice versa (EntCls) are evaluated for textual (Text) and mathematical (Math) entities. Mode | Entropy
---|---
MDiscTextClsEnt | 4.22
MDiscTextEntCls | 0.54
MFreqTextClsEnt | 7.71
MFreqTextEntCLs | 0.72
MDiscMathClsEnt | 4.16
MDiscMathEntCls | 0.33
MFreqMathClsEnt | 7.22
MFreqMathEntCLs | 0.74

Table VIII shows the results of our examination. For the MDisc assessment, a
LogReg classifier on TF-IDF encodings and LIME explainer is employed being
chosen as best results. We interpret higher entropy as lower explainability
because a low entropy leads to ‘sharp’ class predictions. The results indicate
that with text having a higher entropy than math, math features have a better
explainability potential than text features. Moreover, with the entropy of
MFreq being larger than for MDisc, the discriminative ranking seems to be more
explainable than frequency ranking, underlining the power of the LIME model
compared to a simple text frequency statistic. Finally, the observation that
the entropy of classes-entities is higher than for entities-classes suggests
that a prediction of classes from entities is more explainable than for
classes from entities. This seems to be consistent with the fact that there
are more entities than classes.

##  V Outlook

In this final section, we recall our findings and outline future directions.

###  V-A Conclusion

In this paper, we show that 1) the ambiguity of identifier symbols is
distributed across document category classes while their semantic names are
more predictable with smaller categorical cross-entropy; 2) an increasing
number of unsupervised identifier name augmentation deteriorates the
classification accuracy; 3) removing identifier names from the textual
document features significantly reduces classification performance; 4) 95% of
the examined text entity N-grams could be linked to a Wikipedia article, and
for 80% of the examined formulae a concept name could be found within a
surrounding text window of $\pm 10$ words; and 5) math features are
potentially more explainable than text features and a discriminative ranking
is more explainable than a frequency ranking in terms of entropy.

We answer our research question 1 by the entropy distribution for finding 1).
Moreover, we answer research questions 2 and 3 by findings 2) and 3). Note
that this means that identifier name augmentations seem to have some
explanatory value, but MathEL for identifiers maybe not necessary for
explainability as it deteriorates the classification accuracy. Finally, we
answer research question 4 by findings 4) and research question 5 by findings
5). We conclude that while mathematical Entity Linking has some difficulties,
i.e., some of the concept names are ‘hidden’ in the context and maybe
impossible to automatically detect, it can be a promising candidate for
providing explainability in the case of ‘math-heavy’ STEM documents.

###  V-B Future Work

In the future, we will investigate how the definition of the math entity
formula concept may affect MathEL results. More generally, we aim to further
elaborate on a distinction between natural and mathematical language entities.
We will try to cluster formula identifier category namespaces and assess
cluster purity.

Moreover, we plan to develop Wikidata knowledge base encodings (‘Bag-of-QIDs’)
for the textual and mathematical entities. We will then seed the relations
between arXiv and MSC categories to the Wikidata knowledge graph and persist
entity-category linkings to evaluate the quality of knowledge graph labeling.
For fine-granular classification, there are often not enough training examples
per class, as each is very small. Hence, a classification using knowledge-
graph relations (linking entity keywords to subject classes) may be very
beneficial to label small classes with little training data. If expedient, we
will also employ costly supervised entity and category annotation in an active
learning framework, a process for which we first need to develop guidelines.

Besides for classification explainability and unsupervised labeling, Entity
Linking can also be use for Semantic Search and Question Answering as well as
document representation and ontology learning and summarization. Our long-term
goal is to increase automation by unsupervised linking of textual and
mathematical entities to serve these applications.

## References

  * [1] Philipp Scharpf, Moritz Schubotz, Abdou Youssef, Felix Hamborg, Norman Meuschke, and Bela Gipp.  Classification and clustering of arxiv documents, sections, and abstracts, comparing encodings of natural and mathematical language.  In JCDL, pages 137–146. ACM, 2020.
  * [2] Marcin Mironczuk and Jaroslaw Protasiewicz.  A recent overview of the state-of-the-art elements of text classification.  Expert Syst. Appl., 106:36–54, 2018.
  * [3] David Martens and Foster J. Provost.  Explaining data-driven document classifications.  MIS Q., 38(1):73–99, 2014.
  * [4] Christian J. Mahoney, Jianping Zhang, Nathaniel Huber-Fliflet, Peter Gronvall, and Haozhen Zhao.  A framework for explainable text classification in legal document review.  In IEEE BigData, pages 1858–1867. IEEE, 2019.
  * [5] Hui Liu, Qingyu Yin, and William Yang Wang.  Towards explainable NLP: A generative explanation framework for text classification.  In ACL (1), pages 5570–5581. Association for Computational Linguistics, 2019.
  * [6] Marco Túlio Ribeiro, Sameer Singh, and Carlos Guestrin.  ”why should I trust you?”: Explaining the predictions of any classifier.  In KDD, pages 1135–1144. ACM, 2016.
  * [7] Scott M. Lundberg, Gabriel G. Erion, Hugh Chen, Alex DeGrave, Jordan M. Prutkin, Bala Nair, Ronit Katz, Jonathan Himmelfarb, Nisha Bansal, and Su-In Lee.  Explainable AI for trees: From local explanations to global understanding.  CoRR, abs/1905.04610, 2019.
  * [8] Farid Ghareh Mohammadi, M. Hadi Amini, and Hamid R. Arabnia.  An introduction to advanced machine learning : Meta learning algorithms, applications and promises.  CoRR, abs/1908.09788, 2019.
  * [9] Stephen M Watt.  Mathematical document classification via symbol frequency analysis.  Towards Digital Mathematics Library. Birmingham, United Kingdom, July 27th, 2008, pages 29–40, 2008.
  * [10] Tomasz Kusmierczyk, Michal Lukasik, Lukasz Bolikowski, and Hung Son Nguyen.  Comparing hierarchical mathematical document clustering against the mathematics subject classification tree.  In Intelligent Tools for Building a Scientific Information Platform, volume 467 of Studies in Computational Intelligence, pages 365–392. Springer, 2013.
  * [11] Ulf Schöneberg and Wolfram Sperber.  POS tagging and its applications for mathematics - text analysis in mathematics.  In CICM, volume 8543 of Lecture Notes in Computer Science, pages 213–223. Springer, 2014.
  * [12] Tokinori Suzuki and Atsushi Fujii.  Mathematical document categorization with structure of mathematical expressions.  In JCDL, pages 119–128. IEEE Computer Society, 2017.
  * [13] Deyan Ginev and Bruce R. Miller.  Scientific statement classification over arxiv.org.  In LREC, pages 1219–1226. European Language Resources Association, 2020.
  * [14] Moritz Schubotz, Philipp Scharpf, Olaf Teschke, Andreas Kühnemund, Corinna Breitinger, and Bela Gipp.  Automsc: Automatic assignment of mathematics subject classification labels.  In CICM, volume 12236 of Lecture Notes in Computer Science, pages 237–250. Springer, 2020.
  * [15] Ben Hachey, Will Radford, Joel Nothman, Matthew Honnibal, and James R. Curran.  Evaluating entity linking with wikipedia.  Artif. Intell., 194:130–150, 2013.
  * [16] Henry Rosales-Méndez, Barbara Poblete, and Aidan Hogan.  What should entity linking link?  In AMW, volume 2100 of CEUR Workshop Proceedings. CEUR-WS.org, 2018.
  * [17] Philipp Scharpf, Moritz Schubotz, and Bela Gipp.  Fast linking of mathematical wikidata entities in wikipedia articles using annotation recommendation.  In Proceedings of the Web Conference (WWW) 2021. ACM / IW3C2, April 2021.
  * [18] Moritz Schubotz, Philipp Scharpf, Kaushal Dudhat, Yash Nagar, Felix Hamborg, and Bela Gipp.  Introducing mathqa: a math-aware question answering system.  Information Discovery and Delivery, 2018.
  * [19] Giovanni Yoko Kristianto, Goran Topic, and Akiko Aizawa.  Entity linking for mathematical expressions in scientific documents.  In ICADL, volume 10075 of Lecture Notes in Computer Science, pages 144–149. Springer, 2016.
  * [20] Giovanni Yoko Kristianto and Akiko Aizawa.  Linking mathematical expressions to wikipedia.  In SWM@WSDM, pages 57–64. ACM, 2017.
  * [21] Philipp Scharpf, Moritz Schubotz, Howard S. Cohl, and Bela Gipp.  Towards formula concept discovery and recognition.  In BIRNDL@SIGIR, volume 2414 of CEUR Workshop Proceedings, pages 108–115. CEUR-WS.org, 2019.
  * [22] Philipp Scharpf, Ian Mackerracher, Moritz Schubotz, Jöran Beel, Corinna Breitinger, and Bela Gipp.  _AnnoMath TeX_ \- a formula identifier annotation recommender system for STEM documents.  In RecSys, pages 532–533. ACM, 2019.
  * [23] Akiko Aizawa, Michael Kohlhase, Iadh Ounis, and Moritz Schubotz.  NTCIR-11 math-2 task overview.  In NTCIR. National Institute of Informatics (NII), 2014.