# Antiferromagnetic ordering and glassy nature in NASICON type NaFe2PO4(SO4)2

Manish Kr. Singh  Department of Physics, Indian Institute of Technology Delhi,
Hauz Khas, New Delhi-110016, India  A. K. Bera  Solid State Physics Division,
Bhabha Atomic Research Centre, Mumbai 400085, India  Homi Bhabha National
Institute, Anushaktinagar, Mumbai 400094, India  Ajay Kumar  Department of
Physics, Indian Institute of Technology Delhi, Hauz Khas, New Delhi-110016,
India  S. M. Yusuf  Solid State Physics Division, Bhabha Atomic Research
Centre, Mumbai 400085, India  Homi Bhabha National Institute, Anushaktinagar,
Mumbai 400094, India  R. S. Dhaka<EMAIL_ADDRESS>Department of
Physics, Indian Institute of Technology Delhi, Hauz Khas, New Delhi-110016,
India

###### Abstract

We investigate crystal structure and magnetic properties including spin
relaxation and magnetocaloric effect in NASICON type NaFe2PO4(SO4)2 sample.
The Rietveld refinement of x-ray and neutron diffraction patterns show a
rhombohedral crystal structure with the R$\bar{3}$c space group. The core-
level spectra confirm the desired oxidation state of constituent elements. The
dc–magnetic susceptibility ($\chi$) behavior in zero field-cooled (ZFC) and
field-cooled (FC) modes show the ordering temperature $\approx$50 K.
Interestingly, the analysis of temperature dependent neutron diffraction
patterns reveal an A-type antiferromagnetic (AFM) structure with the ordered
moment of 3.8 $\mu_{B}$/Fe3+ at 5 K, and a magnetostriction below $T_{\rm N}=$
50 K. Further, the peak position in the ac–$\chi$ is found to be invariant
with the excitation frequency supporting the notion of dominating AFM
transition. Also, the unsaturated isothermal magnetization curve supports the
AFM ordering of the moments; however, the observed coercivity suggests the
presence of weak ferromagnetic (FM) correlations at 5 K. On the other hand, a
clear bifurcation between ZFC and FC curves of dc–$\chi$ and the observed
decrease in peak height of ac–$\chi$ with frequency suggest for the complex
magnetic interactions. The spin relaxation behavior in thermo-remanent
magnetization and aging measurements indicate the glassy states at 5 K.
Moreover, the Arrott plots and magnetocaloric analysis reveal the AFM–FM
interactions in the sample at lower temperatures.

##  I  Introduction

In recent years, the search for novel sodium based oxide materials with
exceptional magnetic and structural properties has been a driving force behind
advancements in scientific and technological domains [1, 2, 3]. Within this
context, the NASICON (sodium superionic conductor) materials have emerged as
captivating field of research, offering intriguing crystal structures and
multifunctional properties [4]. Also, these materials have garnered
significant attention due to their unique ability to conduct sodium ions,
which paves the way for applications in energy storage, solid-state
electrolytes, and electrochemical devices [5, 6]. The NASICON structure is
characterized by a general formula of $A_{x}$$M_{2}$(XO4)3, where $A$
represents monovalent cations (e.g., Na, Li) with $x=$ 1–4, $M$ stands for
transition metal cations which are octahedrally connected with ligands, and X
represents tetrahedral network-forming anion (e.g., P, S) [4]. The distinctive
crystal structure of these materials comprises 3D frameworks built from
corner-sharing polyhedra. The $A$ and $M$ ions occupy interstitial sites, and
the XO4 groups form tetrahedral coordination environments for the $X$ atoms.
The interstitial space created by this arrangement enable the migration of $A$
ions through two types of interstitial sites: $A$1 (one per formula unit) and
$A$2 (three per formula unit), resulting in their excellent ionic conductivity
[7]. These materials typically crystallize in rhombohedral ($R\bar{3}c$) [8]
or monoclinic ($C2/c$) phase [9] depending on the synthesis conditions and $A$
site occupancy. Moreover, their fascinating magnetic properties and structural
versatility make them promising candidates for developing next-generation
battery materials for cost effective energy storage applications [10, 11].

Note that the magnetic properties of NASICON materials are intricately linked
to the specific arrangement of the $M$ cations and their interactions with
neighboring ligands. The coordination geometry of spin-active $M$ ions
influences the magnetic behavior, including the presence of paramagnetic (PM),
antiferromagnetic (AFM), or ferromagnetic (FM) ordering [12, 10].
Additionally, the structural flexibility of NASICON materials allows the
incorporation of various magnetic dopants, thereby tailoring their magnetic
properties and expanding their potential applications [13]. The magnetic
interaction between the $M$ cations present in neighboring octahedra is
facilitated via super-super exchanges between the $M$ cations via O-X-O bonds
as reported by Fanjat and Soubeyroux for Na3Fe2(PO4)3 using neutron
diffraction study and found a long-range AFM ordering in monoclinic phase
below 47 K [14]. The similar magnetic behavior of Fe3+ was reported by
Beltrán-Porter $et~{}al.$ using M$\ddot{\rm o}$ssbauer spectroscopy and
magnetic susceptibility measurements, in which the antiferromagnetic
transition occurred at 45.7 K with some weak ferromagnetism in Na3Fe2(PO4)3
sample [15]. Moreover, Greaves $et~{}al.$ performed the magnetization and
neutron powder diffraction studies to demonstrate the magnetic behavior of
Fe3+ in Na3Fe2(PO4)3, but with a rhombohedral structure and found an anti-
ferromagnetic transition below 47 K with a canted AFM ground state and a weak
FM phase [16].

Interestingly, the magnetic properties of Ti3+ based NASICON material are
explored within the scope of Figgis model and found that the Na3Ti2(PO4)3
exhibits a large deviation from the Curie-Weiss law below 100 K and undergoes
a paramagnetic to antiferromagnetic transition below 50 K [12]. Within the
same material class, the structural and magnetic behavior of Mn substituted
Na3Fe2-xMnx(PO4)3 ($x=$ 0–0.4) was investigated through x-ray diffraction, dc
and ac susceptibility, and Mössbauer spectroscopy [13]. These samples
crystallize in the monoclinic (C2/c) phase where both the Fe3+
($t_{2g}^{3}$$e_{g}^{2}$) and Mn3+ ($t_{2g}^{3}$$e_{g}^{1}$) ions in the high
spin state are located in octahedral coordination, and an antiferromagnetic
transition was observed below 50 K. As the Mn content increases, the
(Fe1-xMnx)O6 octahedra undergo distortion due to the Jahn–Teller effect of the
Mn ions, which leads to another antiferromagnetic transition at TN2 = 43 K,
with magnetic Fe ions having canted antiferromagnetic moments responsible for
the transition at TN1=46.5 K [13]. Also, the magnetic properties of alluaudite
Na2Fe2(SO4)3, having monoclinic ($C2/c$) phase, exhibits long-range
antiferromagnetic ordering below 12 K and the magnetic structure was explained
by super-superexchange between Fe2+ via SO4 units using neutron diffraction
analysis [17]. Moreover, the monoclinic phase of Na3Fe3(PO4)4 having Fe3+ ions
exhibit the long-range AFM ordering at $T_{\rm N}=$ 27 K [18]. The authors
claim the absence of ferromagnetic interactions in the sample using the
isothermal magnetization behavior and found no significant offset between FC
and ZFC curves in magnetic susceptibility data [18]. Interestingly, in recent
years the NASICON type mixed polyanionic NaFe2PO4(SO4)2 material, due to its
structural tunability, is being considered a potential candidate as cathode
for sodium-ion batteries [19, 21, 20]. However, the magnetic properties of
NaFe2PO4(SO4)2 are vital to understand the complex magnetic interactions and
have not been explored yet to the best of our knowledge.

Therefore, in this paper we use the temperature dependent neutron diffraction
(ND) and magnetization data analysis to probe the structural and magnetic
ordering in NASICON structured polyanionic NaFe2PO4(SO4)2 sample. The crystal
structure, vibrational and electronic properties are investigated using
x-ray/neutron diffraction, Raman spectroscopy and x-ray photoemission
spectroscopy, respectively. The detailed analysis of the ND patterns recorded
in the temperature range of 5 to 300 K reveal an antiferromagnetic (AFM)
ordering below 50 K, which found to be consistent with the dc and ac magnetic
susceptibility behavior. We find a magnetostriction below $T_{\rm N}=$ 50 K.
The non-saturating trend in the M–H curve suggests the AFM ordering of the
moments; however, the existence of low coercivity ($\sim$450 Oe) at 5 K
suggests the presence of weak ferromagnetic (FM) correlations. The appearance
of clear bifurcation in the magnetic susceptibility, measured between field-
cooled (FC) and zero-field-cooled (ZFC) modes, indicates a glassy state at low
temperatures. This found to be consistent with the behavior of aging and
thermo-remanent magnetization (TRM) measured at 5 K. Also, the magnetic
isotherm data are analyzed to examine the magnetic interactions and
magnetocaloric properties of the sample.

##  II  Experimental

The solution-assisted solid-state method is used to synthesize the
NaFe2PO4(SO4)2 polycrystalline sample. The stochiometric amounts of NaNO3
(0.605g, Merck, 99%), Fe (NO3)3 9H2O (5.747g, Sigma-Aldrich, $>$98%), and
(NH4)2 SO4 (1.8798g, Fisher Scientific, 99%) were taken in 20 ml of DI water,
and NH4H2PO4 was taken in 10 ml DI water separately. After the uniform mixing,
the resulting solution was further mixed drop wise, and then heated at 80°C
for 12 hrs to evaporate the water and got the yellow powder. The as-prepared
yellow powder/pallet was annealed in the air for 12 hrs at 550°C.

The neutron diffraction (ND) patterns are measured at different temperatures
(5–300 K) at the powder diffractometer PD-1 ($\lambda$= 1.094 Å) at Dhruva
reactor, Trombay, India [22, 23]. For the ND measurements, the sample was
filled in vanadium can of diameter 5 mm and attached with the cold head of a
closed cycle helium refrigerator. The details of x-ray diffraction (XRD)
measurements are given in [24]. The XRD and ND patterns are analyzed by the
Rietveld refinement method using the Fullprof program package [25]. The Raman
spectrum is measured at room temperature using the Renishaw inVia confocal
microscope equipped with 532 nm, 2400 lines/mm grating, and 10mW power. The
x-ray photoelectron spectroscopy (XPS) measurements are performed using the
Kratos Analytical Ltd (AXIS SUPRA model) spectrometer with monichromatic Al Kα
($\lambda$= 1486.6 eV) source. The dc and ac magnetic susceptibility
($\chi-$T), the field dependent magnetization measurements (M–H), thermo-
remanent magnetization (TRM), aging, and virgin magnetization curves are
recorded using the MPMS-3 SQUID magnetometer from Quantum Design, USA.

##  III  Results and discussion

Figure 1: (a) The experimentally observed (circles) and calculated (solid
line) ND pattern for the NaFe2PO4(SO4)2 at 300 K. The solid line at the bottom
represents the difference between observed and calculated patterns. The
vertical bars indicate the positions of allowed nuclear Bragg peaks. (b) The
Raman spectrum measured between 150–1500 cm-1 and fitted with the Lorentzian
profile. The room temperature core-level photoemission spectra of (c) Fe 2$p$,
(d) P 2$p$, (e) Na 1$s$, (f) O 1$s$ and (g) S 2$p$.

The Rietveld analysis of the ND pattern measured at 300 K reveals the crystal
structure for NaFe2PO4(SO4)2 to be rhombohedral with space group R$\bar{3}$c,
as shown in Fig. 1(a). The refined crystal structural parameters are given in
Table I and the extracted lattice parameters $a=b=$ 8.4450(2) ${\rm\AA}$, $c=$
22.0060(4) ${\rm\AA}$, $\alpha$= $\beta$=90°, $\gamma$=120° and a unit volume
of 1359.2(8) ${\rm\AA}^{3}$ are in good agreement with Refs. [21, 19, 20].
Also, the Rietveld refinement of the XRD pattern is presented in Fig. S1(a) of
Ref. [24], which also confirms the formation of a single phase rhombohedral
structure having R$\bar{3}$c space group. As neutrons are more sensitive for
low atomic number elements in the structure as compared to the x-rays, the ND
refinement indicates a slight deficiency of Na ($\sim$16%) and oxygen ions
($\sim$9%) in the sample. An unindexed peak at $\sim$ 2.7 Å-1 is observed,
which may appear from a small secondary phase or sample environment. Further,
we find that the Raman active modes observed between 900–1300 cm-1 wave
numbers, as shown in Fig. 1(b), are resulting from the intramolecular
stretching (both symmetric and antisymmetric) of the PO4 and SO4 units [26,
27, 28, 29, 30]. More specifically, the peaks around 1250 and 1060 cm-1 can be
assigned to the antisymmetric ($\nu_{3}$) and symmetric stretched vibrations
($\nu_{1}$) of SO${}^{2-}_{4}$, respectively, [26, 27]; whereas, those
observed at $\sim$1110 and 1010 cm-1 can be ascribed to the antisymmetric
($\nu_{3}$) and symmetric stretched ($\nu_{1}$) modes of PO${}^{3-}_{4}$,
respectively [28]. Further, several Raman active modes between 400–700 cm-1
represent the symmetric and antisymmetric bending mode of PO${}^{3-}_{4}$ and
SO${}^{2-}_{4}$ units. For example, the peak observed at $\approx$470 cm-1
corresponds to the symmetric bending vibration ($\nu_{2}$) of SO${}^{2-}_{4}$,
while the peaks at $\sim$610 and 650 cm-1 corresponds to the antisymmetric
bending vibration ($\nu_{4}$) of SO${}^{2-}_{4}$ [26, 27]. Moreover, the
asymmetric bending modes ($\nu_{4}$) corresponding to PO${}^{3-}_{4}$ are
obtained at 560 and 570 cm-1, and symmetric bending mode ($\nu_{2}$) is
observed at 445 cm-1 [28]. Also, the Raman modes at the low wave number
between 100–400 cm-1 are ascribed to the translational/coupled-transitional
motion of Fe3+ ion and with its neighboring atoms [31].

Table 1: The atomic positions and the site occupancies of NaFe2PO4(SO4)2 sample, as extracted from the Rietvield analysis of the neutron diffraction pattern at 300 K. Atom |  Wyckoff |  x |  y |  z |  Occup.
---|---|---|---|---|---
Na1 |  6b |  0.00000 |  0.00000 |  0.0000 |  0.84(3)
Fe1 |  12c |  0.00000 |  0.00000 |  0.1479(2) |  1.00
S1 |  18e |  0.2938(11) |  0.00000 |  0.2500 |  0.67
P1 |  18e |  0.2938(11) |  0.00000 |  0.2500 |  0.33
O1 |  36f |  0.0264(9) |  0.2113(8) |  0.1946(2) |  0.93(1)
O2 |  36f |  0.1912(8) |  0.1686(8) |  0.0884(2) |  0.89(1)

To understand the electronic properties of the NaFe2PO4(SO4)2 sample, in Figs.
1(c–g), we show the core-level photoemission spectra of constituent elements.
The calibration of all the spectra is done with respect to the C 1$s$ peak at
284.6 eV. After subtracting the inelastic background using Tougaard method,
the Na 1$s$, P 2$p$, Fe 3$d$, O 1$s$, and S 2$p$ core-levels are fitted using
the Voigt function (in IGOR Pro software), which is the convolution of the
Gaussian and Lorentzian profiles, with a shape factor of 0.6. The Fe 2$p$
spectrum, in Fig. 1(c), consists of 2$p_{3/2}$ and 2$p_{1/2}$ peaks along with
their respective satellite peaks. These core-level peaks are observed at 712.5
eV and 725.5 eV with their corresponding satellite features at 718.1 eV and
729.6 eV, which indicate the presence of Fe solely in the trivalent state [32,
33]. In Fig. 1(d), the peaks centered at 133.0 eV and 133.9 eV are attributed
to the spin-orbit splitting of P 2$p$, i.e., the 2$p_{3/2}$ and 2$p_{1/2}$
levels, respectively, which correspond to the +5 oxidation state of phosphorus
in the tetrahedral environment [32]. Fig. 1(e) displays the Na 1$s$ core level
centered at 1071.1 eV, which indicate the monovalent state of sodium [34]. The
deconvoluted O 1$s$ spectrum is depicted in Fig. 1(f), revealing the presence
of three components located at (i) 531.7 eV (OL), which can be assigned to the
lattice O2-, (ii) 533.2 eV (OV) is attributed to the oxygen vacancies
(estimated $\sim$8% by taking area under the respective peaks), which are
consistent with the neutron analysis, and (iii) 536.3 eV (OS) corresponding to
a surface hydroxyl group (-OH) [34, 35]. Fig. 1(g) exhibits two characteristic
peaks at 168.5 eV and 169.6 eV corresponding to the S 2p3/2 and S 2p1/2 energy
levels, respectively associated with the SO${}_{4}^{2-}$, which are attributed
to 5+ oxidation state of sulfur in the tetrahedral coordination [33].

Figure 2: The dc magnetic susceptibility of NaFe2PO4(SO4)2 sample in ZFC and
FC modes from 2 to 300 K measured at (a) 500 Oe and (b) 10 kOe. (c) The
inverse magnetic susceptibility of the FC curve where the black solid lines
represent the Curie-Weiss fitting from 60–300 K. (d) The M–H curve in ZFC mode
measured at 5 K where the inset shows the enlarged view in the low field
region.

In order to investigate the magnetic interactions in the NaFe2PO4(SO4)2
sample, we measure the temperature dependent dc magnetic susceptibility
($\chi=M/H$) from 2 to 300 K in both ZFC and FC modes at 500 Oe and 10 kOe, as
depicted in the Figs. 2(a, b), respectively. We find an abrupt increase in the
$\chi$ values below 50 K (indicated by the vertical dashed line).
Interestingly, there is a large bifurcation between ZFC and FC curves below
$\approx$45 K, with a significant suppression and shift in bifurcation at 10
kOe [see Figs. 2(a, b)] providing an evidence of the presence of glassy nature
of the magnetic phase in this sample at low temperatures [37, 36]. The FC
curve reaches a maximum around 30 K and then show a downturn till $\approx$20
K, which are characteristics of the AFM ordering [3]; however, a slight
upsurge at very low temperature is probably due to paramagnetic impurities [3,
38, 39]. In Fig. 2(c), the inverse of magnetic susceptibility (measured in FC
mode at 10 kOe field) is plotted, and the high-temperature range (60–300 K) is
fitted using the Curie-Weiss (C-W) law $\chi=C/(T-T_{\theta}$) to find the
effective magnetic moment ($\mu_{\rm eff}$), where C is the C-W constant and
$T_{\theta}$ is the C–W temperature. The extracted values of $T_{\theta}$ and
the $\mu_{\rm eff}$ are found to be about -98 K and 3.93 $\mu_{B}$/Fe3+. The
value of $\mu_{\rm eff}$ is found to be close to the spin-only magnetic moment
(3.87 $\mu_{\rm B}$) for the intermediate spin (IS) state of Fe3+ ions
($t_{2g}^{4}$$e_{g}^{1}$; S=3/2), calculated using the formula
$\mu_{S}=2\sqrt{S(S+1)}~{}\mu_{B}$, which suggests the existence of Fe3+ ions
fully in the IS state or in mixed of high ($t_{2g}^{3}$$e_{g}^{2}$; S=5/2) and
low ($t_{2g}^{5}$$e_{g}^{0}$; S=1/2) spin states in 52 to 48 ratio [40, 41,
42]. The negative value of $T_{\theta}$ obtained from the C–W fit suggests the
existence of antiferromagnetic interactions in the system [38]. Also, a
collinear AFM ordering below $T_{\rm N}$= 10.4 K is reported in an isotropic
triangular lattice of Na3Fe(PO4)2 in monoclinic phase ($C2/c$) and having the
high spin Fe3+ ions [43, 44]. Moreover, the unsaturated behavior in the field-
dependent magnetization, M-H loops, even up to $\pm$70 kOe indicates the
AFM/uncompensated spins at 5 K, as shown in the Fig. 2(d). However, a
symmetric M–H loop is observed with small coercivity (HC) of around 450 Oe, as
displayed more clearly in the inset of Fig. 2(d), which suggests the presence
of weak FM type interactions at 5 K. These observations motivated us to
further investigate the magnetic correlations in the sample by detailed
analysis of neutron diffraction and magnetizaton in different protocols at low
temperatures.

Figure 3: (a) The ND patterns measured in the temperature range of 5–300 K.
(b) The magnetic diffraction pattern at 5 K after subtraction of the nuclear
background at 60 K. Figure 4: The experimentally observed (circles) and
calculated (solid line) ND patterns for the NaFe2PO4(SO4)2 at (a) 60 K and (b)
5 K. The solid lines at the bottom of each panel represent the difference
between observed and calculated patterns. The vertical bars indicate the
positions of allowed nuclear and magnetic Bragg peaks. (c) A schematic of the
magnetic structure of NaFe2PO4(SO4)2 sample. (d) The ordered magnetic moment
(order parameter) of Fe3+ ion as a function of temperature. (e) The
temperature dependent lattice parameters $a$ and $c$, and the unit cell volume
$V$, and (f) the lattice parameters $a$ and $c$, and the unit cell volume $V$
normalized with their respective value at 300 K.

To further investigate the magnetic ordering at low temperatures, in Fig. 3(a)
we present the as measured ND patterns in the large temperature range of 5–300
K. Interestingly, the nature of ND patterns remains the same with an
appearance of additional magnetic Bragg peaks at $\sim$0.85, 0.9, and 2.16 Å-1
along with an increase of the intensity of the nuclear Bragg peaks at
$\sim$1.72, 2.72, 3.0, and 3.1 Å-1 below the T${}_{\rm N}=$ 50 K. The pure
magnetic ND pattern at 5 K is estimated by subtracting the nuclear background
measured at 60 K (PM state). The appearance of new magnetic Bragg peaks, as
shown in Fig. 3(b), confirms an AFM ordering.

Note that all the magnetic Bragg peaks could be indexed with a propagation
vector $k=$ (0 0 0) with respect to the rhombohedral nuclear unit cell. The
symmetry-allowed magnetic structure is determined by a representation analysis
using the computer program SARAh-Representational Analysis [45]. The
representational analysis [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56] allows
the determination of the symmetry-allowed magnetic structures that can result
from a second-order magnetic phase transition, given the crystal structure
(R$\bar{3}$c) before the transition and the propagation vector [$k=$ (0 0 0)]
of the magnetic ordering. They involve first the determination of the space
group symmetry elements, $g$, that leave the propagation vector $k$ invariant:
these form the little group Gk. The space group R$\bar{3}$c involves three
centering operations and twelve symmetry operations and out of them, twelve
leave the propagation $k$ invariant or transform it into an equivalent vector.
The symmetry analysis reveals that there are six irreducible representations
(IR), i.e., six possible symmetry-allowed magnetic structures. Out of the six
IRs, four IRs ($\Gamma_{1}-\Gamma_{4}$) are 1D and the two IRs
($\Gamma_{5}-\Gamma_{6}$) are 2D. All the six IRs are nonzero for the magnetic
site (12$c$) of the present compound and therefore, the magnetic
representation of a crystallographic site can then be decomposed in terms of
the IRs as below:

$\Gamma_{Mag}=\sum_{v}n_{v}\Gamma_{v}^{\mu}=\Gamma_{1}^{1}+\Gamma_{2}^{1}+\Gamma_{3}^{1}+\Gamma_{4}^{1}+\Gamma_{5}^{2}+\Gamma_{6}^{2}$
(1)

The basis vectors of six IRs (the Fourier components of the magnetization) for
the magnetic site are given in Ref. [24]. The labeling of the propagation
vector and the IRs follows the scheme used by Kovalev [57].

Interestingly, out of the above IRs, the best refinement of the magnetic
diffraction pattern is obtained for the $\Gamma_{5}$. The ND pattern measured
at 60 K and the corresponding calculated pattern with the nuclear phase alone
is shown in Fig. 4(a), whereas the as-measured ND pattern at 5 K and the
calculated pattern with the nuclear and magnetic phases are shown in Fig.
4(b). A good agreement between the observed and calculated patterns is evident
(the reliable factors are Rp=4.29%, Rwp=5.31%, Rexp= 2.07%, $\chi^{2}$=6.58%,
and the RMag= 1.84%]. The corresponding magnetic structure is shown in Fig.
4(c), which is found to be pure antiferromagnetic in nature without having any
net magnetization per unit cell. The magnetic moments are lying in the $ab$
plane with moment components along the $b-$axis. The magnetic structure is
A-type, where all the moments in a given $ab$ plane are aligned parallel,
whereas they are antiparallel to the moments in the next plane. The
temperature variation of the ordered moment of Fe ions is shown in Fig. 4(d)
where its value is estimated to be $m=$ 3.80(3) $\mu_{B}$/Fe3+ at 5 K.
Notably, we found an excellent agreement in the temperature value at which the
moment start increasing with the magnetic susceptibility data (discussed above
in Fig. 2). The temperature-dependent lattice parameters and unit cell volume
are shown in Figs. 4(e, f) where it is clearly evident that the unit cell
experiences a slight magnetostriction on cooling through the TN$\approx$50 K
where an expansion of the lattice constants $a$ and $c$, consequently, an
expansion of unit cell volume ($V$) is also observed. Here, we find a
relatively stronger magnetostriction along the $a-$axis.

Figure 5: (a) The real and (b) imaginary part of ac magnetic susceptibility,
recorded at various frequencies in the temperature range of 30–51.5 K with 2.5
Oe excitation magnetic field. (c) The FC thermoremanent magnetization (TRM)
data recorded at 5 K for various waiting times (tw = 102 sec, 103 sec, and 104
sec) with a magnetic field of 1000 Oe. The solid lines depict the best data
fitting using stretched exponential behavior. The semilogarithmic plot of the
data for tw=1000 sec is shown in the inset of (c), and the solid black line
indicates the fit using the logarithmic relaxation model. (d) The ZFC time-
dependent isothermal magnetization of NaFe2PO4(SO4)2 sample measured at 5 K
for different waiting times (tw = 102 sec, 103 sec, and 104 sec) with a
magnetic field of 1000 Oe, and the black line is depicting the best-fit curve
using a stretched exponential function.

Moreover, in Figs 5(a, b), the temperature dependent ac susceptibility
($\chi_{ac}=M(T)/H_{ac}$) data, measured at 2.5 Oe excitation field and at
different frequencies 1, 9, 49, 99, and 499 Hz, show a clear peak centered
around $\sim$46 K in both $\chi^{\prime}$–T and $\chi^{\prime\prime}$-T plots.
Interestingly, a systematic reduction in the peak height is observed for both
$\chi^{\prime}$ and $\chi^{\prime\prime}$ with increasing the excitation
frequency, suggesting the presence of a glassy nature in the sample. However,
the change in the peak position is too small to be detected with reasonable
accuracy, possibly due to dominating AFM interactions as compared to the
glassy nature. More importantly, the observed $\chi^{\prime\prime}$ peak, the
out-of-phase component of the susceptibility, is a distinctive characteristic
of glassy materials as the $\chi^{\prime\prime}$ signal is normally absent in
the pure AFM systems [58, 59]. To unravel the complex spin dynamics at low
temperatures, we perform the field-cooled thermo-remanent magnetization (TRM)
measurement at 5 K for the different waiting times (tw). In the TRM
measurements, the sample was first cooled from 300 K to 5 K in the presence of
1000 Oe dc magnetic field, then after a waiting time of tw, the magnetic field
was turned off, and immediately started recording the magnetization as a
function of time. The sample was heated up to 300 K before recording the data
for another waiting time to avoid any remanence. The slow decay of the
remanent magnetization with time is clearly observed in Fig. 5(c) and notably
the magnetization increases with an increase in the waiting time. These are
typical signatures of the spin glass behavior, i.e., blocking in the spins due
to low temperature competing magnetic interactions in the NaFe2PO4(SO4)2. To
fit the data and extract the parameters, we use the well-known stretched
exponential model (with + sign) [60]:

$M(t)=M_{0}\pm
M_{\mathrm{SG}}\times\exp\left[-\left(\frac{t}{t_{r}}\right)^{(1-\eta)}\right]$
(2)

where, M0 and MSG are the magnetic moments of FM and spin glass components,
respectively, tr is the mean relaxation time, and $\eta$ is the dispersion
parameter, which depends on the relaxation rate of the spins in the glassy
state. The value of the dispersion parameter is determined by the type of
energy barriers encountered in the relaxation. For a system with uniform
energy barriers, $\eta$=1, whereas with non-uniform energy barriers, as is
usual for spin glasses, $\eta$ lies between 0 and 1. The solid black lines in
Fig. 5(c) show the best fit using the stretched exponential model, and the
fitting parameters are given in Table S2 of [24]. The extracted values of tr
indicate the slow relaxation of the spins, which is an evidence of the
frustrated system, and the values of $\eta$ are obtained in the range of
0$<\eta<$1 for all the three different waiting times, which show the glassy
magnetic phase in the sample [36, 61]. The glassy behavior in the
NaFe2PO4(SO4)2 sample is further confirmed by the aging effect (ZFC
relaxation), as shown in Fig. 5(d). For these measurements, the sample was
first cooled down to 5 K in the zero magnetic field, then wait for a certain
time (tw) in the zero field. After that, a magnetic field of 1000 Oe was
applied and immediately started recording the magnetization data as a function
of time. The time evolution of magnetization can be nicely modeled by a
stretched exponential equation 2 (with – sign) [61]. The solid black lines in
Fig. 5(d) represent the best fit and the fitting parameters are listed in
Table S3 of [24]. The values of tr and $\eta$ at 5 K are within the typical
range for spin-glass systems similar to the TRM data analysis. The existence
of non-zero values of both M0 and MSG confirm a mixed state of ferromagnetic
and spin glass components in the NaFe2PO4(SO4)2 sample at 5 K.

Figure 6: (a) The virgin magnetization isotherms recorded from 2 to 100 K. (b)
The magnetic susceptibility at different external magnetic fields extracted
from the virgin isotherms. Figure 7: (a) The Arrott plots extracted from the
virgin data measured between 2–100 K, and the change in the magnetic entropy
($\Delta$S) versus temperature at different magnetic fields from (b) 70 kOe to
45 kOe, (c) 45 kOe to 10 kOe, (d) 10 kOe to 1 kOe, and (e) 1 kOe to 300 Oe.

Now it is vital to investigate the nature of magnetic correlations and
magnetocaloric properties, therefore, the virgin magnetization isotherms are
recorded (under ZFC mode) from 0 to 70 kOe between 2 to 100 K, as shown in
Fig. 6(a). Note that in order to erase any magnetic history the sample was
heated to room temperature prior to each subsequent magnetic isotherm
masurement. The value of magnetization at 2 K and 70 kOe is around 0.85
$\mu_{B}$/f.u, which is found to be significantly lower than the theoretical
value of the saturation moment of the system Ms= 3 $\mu_{B}$/Fe3+ (gsS
$\mu_{B}$ for IS state) suggesting the AFM and/or canted spins at the low
temperatures. Interestingly, we find that the isotherm curves are non-linear
below the transition temperature and at lower magnetic field values, which
suggest for the complex magnetic interactions in the AFM dominating glassy
system [62]. For example, the non-linearity in these isotherms is clearly
visible when we plot the $dM/dH$ versus $H$ curves, see Figs. S2(a–d) and
discussion in [24]. To get more insights at low temperatures, in Fig. 6(b), we
plot the field-dependent susceptibility versus temperature ($\chi$–T) curves,
which are retrieved from the virgin magnetization isotherms. The
susceptibility curves at all fields nearly overlap in paramagnetic region
above 50 K. We find that the $\chi$ values increase below 50 K and a
distinctive peak emerges at $\sim$45 K, signifying the transition to AFM state
[38]. As the field strength increases, the peak height decreases and shifts
towards lower temperatures along with the broadening and almost disappearing
above 20 kOe. This behavior is attributed to the gradual decay of coupling at
higher fields, confirming the AFM interaction/transition in the sample [39].
Also, a broad dip is observed at around 20 K for low field values, which is
found to shift towards lower temperatures and then disappears above 20 kOe. At
lowest measured temperature 2 K, the $\chi$ value increases with the field up
to 20 kOe and then start decreasing slowly, indicating a typical behavior of
AFM interactions at low temperature and low field region [63]. Here, the
magnetic moment increases at a relatively high rate with the applied field on
the cost of AFM decoupling for the low field value [63].

Finally, the nature of the magnetic interactions is studied with the help of
Arrott plots (M2 versus H/M), extracted from the isotherms across the
transition [64]. In Fig. 7(a), the Arrot curves exhibit vertical lines in the
paramagnetic phase; however, we find positive slope in the curves below
$\approx$50 K in low field region, as depicted by pink and yellow shaded
areas, respectively. This indicates a second order transition from AFM to PM
state. More interestingly, the slope of the Arrott plot changes to negative at
temperatures below $\sim$20 K within the low magnetic field range, as
displayed by the blue shaded area. To further understand the magnetic behavior
of the sample in low temperatures, the change in magnetic entropy ($\Delta$S)
due to the application of magnetic field is extracted from the virgin
isotherms using the classical Maxwell’s thermodynamic relation, given below
[65, 66]

$\Delta S(T,H)=\mu_{0}\int_{0}^{H}\left(\frac{\partial M(T,H)}{\partial
T}\right)_{H}dH.$ (3)

The $\Delta$S versus temperature (2–80 K) plot, extracted using the above
equation, is shown in Figs. 7(b–d) between 300 Oe and 70 kOe. The $\Delta$S
values are consistently negative for $>$45 kOe fields and exhibit a prominent
peak around 48 K having the maximum value $\sim$0.34 J/kg-K at 70 kOe, see
Fig. 7(b), thereby verifying the presence of the conventional magnetocaloric
effect (MCE). The $\Delta$S peaks become very sharp and undergo a cross-over
from negative to positive around 48 K for 300 Oe field [see Fig. 7(e)]
revealing the occurrence of the inverse magnetocaloric effect (IMCE) [67].
This cross-over temperature is found to be close to the ordering temperature
obtained from magnetic susceptibility and ND analysis. Interestingly, we find
that the cross-over temperature decreases with further increase in the
magnetic field, as displayed in Figs. 7(c–e) due to quenching of the AFM
coupling with the magnetic field. Moreover, we find another cross-over in
$\Delta$S values from positive to negative at around 20 K for $<$40 kOe field
values, see Figs. 7(c–e), curves This change in the entropy curve at 20 K
seems consistent with the switching slope of the Arrott curves with
temperature, as shown in Figs. 7(a), indicating the competing magnetic
interactions at low temperatures.

##  IV  Conclusions

In summary, we have investigated the structural and magnetic properties of
NASICON type NaFe2PO4(SO4)2 sample. The Rietveld refinement of x-ray and
neutron diffraction patterns confirm the rhombohedral crystal structure, and
the core-level XPS spectra and calculated effective magnetic moment confirm
the presence of Fe3+ oxidation state. The detailed analysis of temperature
dependent neutron diffraction patterns reveal an AFM ordering (having zero net
magnetization per unit cell) along with a magnetostriction below 50 K. Also,
the unsaturated isothermal magnetization upto $\pm$70 kOe suggests for the AFM
interactions; however, the observed small hysteresis in M–H loop measured at 5
K indicates the presence of weak ferromagnetic coupling at low temperatures.
Interestingly, the ZFC and FC d.c.-magnetic susceptibility exhibit a distinct
bifurcation at low temperatures indicating the presence of the glassy magnetic
state. Also, the a.c.–magnetic susceptibility ($\chi^{\prime}$ and
$\chi^{\prime\prime}$) measurements, and the analysis of magnetization data at
5 K in aging and thermo-remanent modes support the existence of the glassy
nature at low temperatures. The coexistence of these magnetic states may be
due to the partial vacancies of Na and O ions as found in the ND and XPS
studies. Interestingly, we find the complex AFM–FM interactions through the
analysis of Arrott plots and magnetocaloric bahevior at low temperatures.

##  V  Acknowledgments

M.K.S and A.K. acknowledge the MHRD and UGC, respectively, for the fellowship.
We acknowledge the Department of Physics of IIT Delhi for providing XRD, Raman
(DST-FIST UFO Scheme) and MPMS facilities, and central research facility (CRF)
of IIT Delhi for providing XPS and PPMS facilities. This work is financially
supported by SERB–DST through a core research grant (project reference no.
CRG/2020/003436).

## References

  * [1] V. K. Singh, J. Link, K. Kargeti, M. Barik, B. Lenz, N. Saraswat, U. Jena, I. Heinmaa, P. Khuntia, K. Boya, S. K. Panda, R. Stern, Y. Bitla, T. Chakrabarty, and B. Koteswararao, Magnetic properties of $S=\frac{1}{2}$ distorted ${J}_{1}-{J}_{2}$ honeycomb lattice compound $\mathrm{NaCuIn}{({\mathrm{PO}}_{4})}_{2}$, Phys. Rev. B 5107, 214430 (2023).
  * [2] R. Shukla, C. Ulrich, and R. S. Dhaka, Investigation of lattice dynamics, magnetism, and electronic transport in $\beta-$Na0.33V2O5, Phys. Rev. B 5106, 125148 (2022).
  * [3] B. Saha, A. K. Bera, S. M. Yusuf, and A. Hoser, Two-dimensional short-range spin-spin correlations in the layered spin-$\frac{3}{2}$ maple leaf lattice antiferromagnet ${\mathrm{Na}}_{2}{\mathrm{Mn}}_{3}{\mathrm{O}}_{7}$ with crystal stacking disorder, Phys. Rev. B 107, 064419 (2023).
  * [4] B. Ouyang, J. Wang, T. He, C. J. Bartel, H. Huo, Y. Wang, V. Lacivita, H. Kim, and G. Ceder, Synthetic accessibility and stability rules of NASICONs, Nat Commun 12, 5752 (2021).
  * [5] S. K. Sapra, J. Pati, P. K. Dwivedi, S. Basu, J. Chang, and R. S. Dhaka, A comprehensive review on recent advances of polyanionic cathode materials in Na‐ion batteries for cost effective energy storage applications, WIREs Energy Environ. 10, (2021).
  * [6] Z. Jian, Y. Hu, X. Ji, and W. Chen, NASICON‐structured materials for energy storage, Adv. Mater. 29, 1601925 (2017).
  * [7] L.-O. Hagman, P. Kierkegaard, P. Karvonen, A. I. Virtanen, and J. Paasivirta, The crystal structure of NaMe2IV(PO4)3; MeIV = Ge, Ti, Zr, Acta Chem. Scand. 22, 1822 (1968).
  * [8] Z. Deng, G. Sai Gautam, S. K. Kolli, J.-N. Chotard, A. K. Cheetham, C. Masquelier, and P. Canepa, Phase behavior in rhombohedral NaSiCON electrolytes and electrodes, Chem. Mater. 32, 7908 (2020).
  * [9] Z. Zou et al., Identifying migration channels and bottlenecks in monoclinic NASICON‐type solid electrolytes with hierarchical ion‐transport algorithms, Adv. Funct. Mater. 31, 2107747 (2021).
  * [10] N. A. Chernova, G. M. Nolis, F. O. Omenya, H. Zhou, Z. Li, and M. S. Whittingham, What can we learn about battery materials from their magnetic properties?, J. Mater. Chem. 21, 9865 (2011).
  * [11] S. Lochab, S. Rayaprol, M. Avdeev, L. Sharma, and P. Barpanda, Magnetic structure of fluorophosphate Na2MnPO4F sodium battery material, J. of Solid State Chemistry 308, 122926 (2022).
  * [12] A. El Jazouli, A. Nadiri, J. M. Dance, C. Delmas, and G. Le Flem, Relationships between structure and magnetic properties of titanium(III) nasicon-type phosphates, J. Phys. Chem. Solids 49, 779 (1988).
  * [13] R. Idczak, V. H. Tran, B. Swiatek-Tran, K. Walczak, W. Zajac, and J. Molenda, The effects of Mn substitution on the structural and magnetic properties of the NASICON-type Na3Fe2-xMnx(PO4)3 solid solution, J. Magn. Magn. Mater. 491, 165602 (2019).
  * [14] N. Fanjat and J. L. Soubeyroux, Powder neutron diffraction study of Fe2Na3(PO4)3 in the low temperature phase, J. Magn. Magn. Mater. 104–107, 933 (1992).
  * [15] D. Beltrán-Porter, R. Olazcuaga, L. Fournes, F. Menil, and G. Le Flem, Etude magnétique et par résonance mössbauer de l’orthophosphate Na3Fe2(PO4)3α et d’une phase vitreuse dérivée, Rev. Phys. Appl. (Paris) 15, 1155 (1980).
  * [16] C. Greaves, P. R. Slater, M. Slaski, and C. M. Muirhead, The nature of magnetic ordering at 47 K in Na3Fe2(PO4)3, Phys. B: Condens. Matter 194–196, 199 (1994).
  * [17] D. Dwibedi, C. D. Ling, R. B. Araujo, S. Chakraborty, S. Duraisamy, N. Munichandraiah, R. Ahuja, and P. Barpanda, Ionothermal synthesis of high-voltage alluaudite Na2+2xFe2-x(SO4)3 sodium insertion compound: structural, electronic, and magnetic insights, ACS Appl. Mater. Interfaces 8, 6982 (2016).
  * [18] G. S. Shinde, R. Gond, M. Avdeev, C. D. Ling, R. P. Rao, S. Adams, and P. Barpanda, Revisiting the layered Na3Fe3(PO4)4 phosphate sodium insertion compound: structure, magnetic and electrochemical study, Mater. Res. Express 7, 014001 (2020).
  * [19] K. Shiva, P. Singh, W. Zhou, and J. B. Goodenough, NaFe2PO4(SO4)2: a potential cathode for a Na-ion battery, Energy Environ. Sci. 9, 3103 (2016).
  * [20] R. Essehli, A. Alkhateeb, A. Mahmoud, F. Boschini, H. Ben Yahia, R. Amin, and I. Belharouak, Optimization of the compositions of polyanionic sodium-ion battery cathode NaFe2-xVxPO4(SO4)2, J. Power Sources 469, 228417 (2020).
  * [21] H. Ben Yahia, R. Essehli, R. Amin, K. Boulahya, T. Okumura, and I. Belharouak, Sodium intercalation in the phosphosulfate cathode NaFe2(PO4)(SO4)2, J. Power Sources 382, 144 (2018).
  * [22] S. K. Paranjpe and Y. D. Dande, A neutron diffractometer with a linear position sensitive detector, Pramana - J. Phys., 32, 793 (1989).
  * [23] S. K. Paranjpe and S. M. Yusuf, Neutron powder diffraction studies at BARC, Neutron News 13, 36 (2002).
  * [24] See supplemental material for further information about x-ray Rietveld analysis, basis vectors extracted from neutron data analysis, parameters extracted from thermoremanent magnetization and aging data analysis and the dM/dH versus H plots.
  * [25] J. Rodríguez-Carvajal, Recent advances in magnetic structure determination by neutron powder diffraction, Phys. B: Condens. Matter 192, 55 (1993).
  * [26] G. Ventruti, G. Della Ventura, M. A. Gomez, G. Capitani, M. Sbroscia, and A. Sodo, High-temperature study of basic ferric sulfate, FeOHSO4, Phys. Chem. Miner. 47, 43 (2020).
  * [27] J. T. Kloprogge, D. Wharton, L. Hickey, and R. L. Frost, Infrared and raman study of interlayer anions CO${}_{3}^{2-}$ , NO3- , SO${}_{4}^{2-}$ and ClO4- in Mg/Al-hydrotalcite, Am. Mineral. 87, 623 (2002).
  * [28] H. Bih, L. Bih, B. Manoun, M. Azdouz, S. Benmokhtar, and P. Lazor, Raman spectroscopic study of the phase transitions sequence in Li3Fe2(PO4)3 and Na3Fe2(PO4)3 at high temperature, J. Mol. Struct. 936, 147 (2009).
  * [29] G. M. Bhalerao, P. Hermet, J. Haines, O. Cambon, D. A. Keen, M. G. Tucker, E. Buixaderas, and P. Simon, Dynamic disorder and the $\alpha$-$\beta$ phase transition in quartz-type FePO4 at high temperature investigated by total neutron scattering, Raman spectroscopy, and density functional theory, Phys. Rev. B 86, 134104 (2012).
  * [30] J. A. Moreira, A. Almeida, M. R. Chaves, M. L. Santos, P. P. Alferes, and I. Gregora, Raman spectroscopic study of the phase transitions and pseudospin phonon coupling in sodium ammonium sulphate dihydrate, Phys. Rev. B 76, 174102 (2007).
  * [31] M. Karthik, S. Sathishkumar, R. BoopathiRaja, K. L. Meganathan, and T. Sumathi, Design and fabrication of NaFePO4/MWCNTs hybrid electrode material for sodium-ion battery, J. Mater. Sci.: Mater. Electron. 31, 21792 (2020).
  * [32] L. Castro, R. Dedryvére, M. El Khalifi, P.-E. Lippens, J. Bréger, C. Tessier, and D. Gonbeau, The spin-polarized electronic structure of LiFePO4 and FePO4 evidenced by in-lab XPS, J. Phys. Chem. C 114, 17995 (2010).
  * [33] J. Yao, T. Jin, Y. Li, S. Xiao, B. Huang, and J. Jiang, Electrochemical performance of Fe2(SO4)3 as a novel anode material for lithium-ion batteries, J. Alloys Compd. 886, 161238 (2021).
  * [34] P. H. Citrin, High-resolution x-ray photoemission from sodium metal and its hydroxide, Phys. Rev. B 8, 5545 (1973).
  * [35] A. Kumar, R. Shukla, A. Pandey, S. Dalal, M. Miryala, K. Ueno, M. Murakami, and R. S. Dhaka, Structural, transport, optical, and electronic properties of Sr2CoNbO6 thin films, J. Appl. Phys. 128, 025303 (2020).
  * [36] A. Kumar, B. Schwarz, H. Ehrenberg, and R. S. Dhaka, Evidence of discrete energy states and cluster-glass behavior in Sr2–xLaxCoNbO6, Phys. Rev. B 102, 184414 (2020).
  * [37] E. V. Sampathkumaran and A. Niazi, Superparamagnetic-like ac susceptibility behavior in the partially disordered antiferromagnetic compound ${\mathrm{Ca}}_{3}{\mathrm{CoRhO}}_{6}$, Phys. Rev. B 65, 180401 (2002).
  * [38] S. Guchhait, D. V. Ambika, Q.-P. Ding, M. Uhlarz, Y. Furukawa, A. A. Tsirlin, and R. Nath, Deformed spin- 1/2 square lattice in antiferromagnetic NaZnVOPO4(HPO4), Phys. Rev. B 106, 024426 (2022).
  * [39] A. Yogi, A. K. Bera, A. Maurya, R. Kulkarni, S. M. Yusuf, A. Hoser, A. A. Tsirlin, and A. Thamizhavel, Stripe order on the spin-1 stacked honeycomb lattice in ${\mathrm{Ba}}_{2}\mathrm{Ni}{({\mathrm{PO}}_{4})}_{2}$, Phys. Rev. B 95, 024401 (2017).
  * [40] S. Shankar, M. Peters, K. Steinborn, B. Krahwinkel, F. D. Sönnichsen, D. Grote, W. Sander, T. Lohmiller, O. Rüdiger, and R. Herges, Light-controlled switching of the spin state of iron(III), Nat Commun 9, 4750 (2018).
  * [41] G. E. Toney, L. W. TerHaar, J. E. Savrin, A. Gold, W. E. Hatfield, and R. Sangaiah, Characterization of a true intermediate-spin (porphinato)iron(III) complex, Inorg. Chem. 23, 2561 (1984).
  * [42] X. Ming, X.-L. Wang, F. Du, B. Han, C.-Z. Wang, and G. Chen, Unusual intermediate spin Fe3+ ion in antiferromagnetic Li3FeN2, J. Appl. Phys. 111, 063704 (2012).
  * [43] S. J. Sebastian, S. S. Islam, A. Jain, S. M. Yusuf, M. Uhlarz, and R. Nath, Collinear order in the spin-$\frac{5}{2}$ triangular-lattice antiferromagnet Na3Fe(PO4)2, Phys. Rev. B 105, 104425 (2022).
  * [44] D. Ambika, Q. Ding, S. J. Sebastian, R. Nath, and Y. Furukawa, Static and dynamic magnetic properties of the spin-$\frac{5}{2}$ triangle lattice antiferromagnet Na3Fe(PO4)2 studied by 31P NMR, J. Phys.: Condens. Matter 35, 015803 (2023).
  * [45] A. S. Wills, Physica B 276, 680 (2000), program available from www.ccp14.ac.uk
  * [46] E. F. Bertaut, Lattice theory of spin configuration, J. Appl. Phys. 33, 1138 (1962).
  * [47] E. F. Bertaut, Representation analysis of magnetic structures, Acta Cryst A 24, 217 (1968).
  * [48] E. F. Bertaut, Magnetic structure analysis and group theory, J. Phys. Colloques 32, C1-462, (1971).
  * [49] E. F. Bertaut, On group theoretical techniques in magnetic structure analysis, J. Magn. Magn. Mater. 24, 267 (1981)
  * [50] Yu. A. Izyumov, V. E. Naish, and R. P. Ozerov, Neutron diffraction of magnetic materials (Consultants Bureau, New York, 1991).
  * [51] C.J. Bradley and A.P. Cracknell, The mathematical theory of symmetry in solids, Clarendon Press (Oxford, 1972).
  * [52] A. K. Bera, S. M. Yusuf, L. Keller, F. Yokaichiya, and J. R. Stewart, Magnetism of two-dimensional honeycomb layered ${\mathrm{Na}}_{2}{\mathrm{Ni}}_{2}\mathrm{Te}{\mathrm{O}}_{6}$ driven by intermediate Na-layer crystal structure, Phys. Rev. B 105, 014410 (2022).
  * [53] A. K. Bera, S. M. Yusuf, A. Kumar, and C. Ritter, Zigzag antiferromagnetic ground state with anisotropic correlation lengths in the quasi-two-dimensional honeycomb lattice compound ${\mathrm{Na}}_{2}{\mathrm{Co}}_{2}\mathrm{Te}{\mathrm{O}}_{6}$, Phys. Rev. B 95, 094424 (2017).
  * [54] A. K. Bera, S. M. Yusuf, A. Kumar, M. Majumder, K. Ghoshray, and L. Keller, Long-range and short-range magnetic correlations, and microscopic origin of net magnetization in the spin-1 trimer chain compound ${\mathrm{CaNi}}_{3}{\mathrm{P}}_{4}{\mathrm{O}}_{14}$, Phys. Rev. B 93, 184409 (2016).
  * [55] A. Dutta, D. Swain, A. K. Bera, R. Raghunathan, D. Samal, S. M. Yusuf, S. Ramasesha, T. N. Guru Row, Magnetic structure and properties of the vanthoffite mineral ${\mathrm{Na}}_{6}\mathrm{Mn}{({\mathrm{SO}}_{4})}_{4}$, Phys. Rev. B 106, 094419 (2022).
  * [56] P. Suresh, K. V. Laxmi, A. K. Bera, S. M. Yusuf, B. L. Chittari, J. Jung, and P. S. A. Kumar, Magnetic ground state of the multiferroic hexagonal $\mathrm{LuFe}{\mathrm{O}}_{3}$, Phys. Rev. B 97, 184419 (2018).
  * [57] O. V. Kovalev, Representations of the crystallographic space groups edition 2 (Gordon and Breach Science Publishers, Switzerland, 1993).
  * [58] C. V. Topping and S. J. Blundell, A.C. susceptibility as a probe of low-frequency magnetic dynamics, J. Phys.: Condens. Matter 31, 013001 (2019).
  * [59] M. Balanda, AC susceptibility studies of phase transitions and magnetic relaxation: Conventional, molecular and low-dimensional magnets, Acta Phys. Pol. A 124, 964 (2013).
  * [60] R. C. Sahoo, Y. Takeuchi, A. Ohtomo, and Z. Hossain, Exchange bias and spin glass states driven by antisite disorder in the double perovskite compound LaSrCoFeO6, Phys. Rev. B 100, 214436 (2019).
  * [61] V. Markovich, I. Fita, A. Wisniewski, G. Jung, D. Mogilyansky, R. Puzniak, L. Titelman, and G. Gorodetsky, Spin-glass-like properties of La0.8Ca0.2MnO3 nanoparticles ensembles, Phys. Rev. B 81, 134440 (2010).
  * [62] A. Kumar and R. S. Dhaka, Unraveling magnetic interactions and the spin state in insulating Sr2-xLaxCoNbO6, Phys. Rev. B 101, 094434 (2020).
  * [63] E. Vavilova, T. Vasilchikova, A. Vasiliev, D. Mikhailova, V. Nalbandyan, E. Zvereva, and S. V. Streltsov, Magnetic phase diagram and possible Kitaev-like behavior of the honeycomb-lattice antimonate Na3Co2SbO6, Phys. Rev. B 107, 054411 (2023).
  * [64] A. Arrott, Criterion for ferromagnetism from observations of magnetic isotherms, Phys. Rev. 108, 1394 (1957).
  * [65] A. Magar, S. K, V. Singh, J. J. Abraham, Y. Senyk, A. Alfonsov, B. Büchner, V. Kataev, A. A. Tsirlin, and R. Nath, Large magnetocaloric effect in the kagome ferromagnet Li9Cr3(P2O7)3(PO4)2, Phys. Rev. Applied 18, 054076 (2022).
  * [66] G. S. Murugan, C. Lee, R. Kalaivanan, I. P. Muthuselvam, Y. Oshima, K.-Y. Choi, and R. Sankar, Anomalous spin dynamics of the S = 3/2 kagome ferromagnet Li9Cr3(P2O7)3(PO4)2, Phys. Rev. B 107, 214411 (2023).
  * [67] A. Midya, S. N. Das, P. Mandal, S. Pandya, and V. Ganesan, Anisotropic magnetic properties and giant magnetocaloric effect in antiferromagnetic RMnO3 crystals (R = Dy, Tb, Ho, and Yb), Phys. Rev. B 84, 235127 (2011).


# Zshot: An Open-source Framework for Zero-Shot Named Entity Recognition and
Relation Extraction

Gabriele Picco
IBM Research Europe
<EMAIL_ADDRESS>
Marcos Martinez Galindo
IBM Research Europe
<EMAIL_ADDRESS>
Alberto Purpura
IBM Research Europe
<EMAIL_ADDRESS>
Leopold Fuchs
IBM Research Europe
<EMAIL_ADDRESS>
Vanessa Lopez
IBM Research Europe
<EMAIL_ADDRESS>
Hoang Thanh Lam
IBM Research Europe
<EMAIL_ADDRESS>
###### Abstract

The Zero-Shot Learning (ZSL) task pertains to the identification of entities
or relations in texts that were not seen during training. ZSL has emerged as a
critical research area due to the scarcity of labeled data in specific
domains, and its applications have grown significantly in recent years. With
the advent of large pretrained language models, several novel methods have
been proposed, resulting in substantial improvements in ZSL performance. There
is a growing demand, both in the research community and industry, for a
comprehensive ZSL framework that facilitates the development and accessibility
of the latest methods and pretrained models. In this study, we propose a novel
ZSL framework called Zshot that aims to address the aforementioned challenges.
Our primary objective is to provide a platform that allows researchers to
compare different state-of-the-art ZSL methods with standard benchmark
datasets. Additionally, we have designed our framework to support the industry
with readily available APIs for production under the standard SpaCy NLP
pipeline. Our API is extendible and evaluable, moreover, we include numerous
enhancements such as boosting the accuracy with pipeline ensembling and
visualization utilities available as a SpaCy extension.
https://youtu.be/Mhc1zJXKEJQ

##  1 Introduction

Zero-Shot Learning (ZSL) is a machine learning field focused on the study of
models able to classify objects or perform tasks that they have not
experienced during training. This is achieved by leveraging additional
information about the output classes, such as their attributes or
descriptions.

ZSL has a wide range of potential applications, since it allows a model to
generalize and adapt to new situations without requiring retraining or large
amounts of labeled data. This can be particularly useful in real world
applications where new classes or categories may be constantly emerging and it
would be infeasible to retrain the model every time. ZSL can also be used to
classify and predict rare or minority classes that may not have a significant
amount of labeled data available for training.

If we consider Named Entity Recognition (NER) – including classification and
linking (NEL) – and Relation Extraction (RE) problems, recent ZSL methods Aly
et al. (2021); Wu et al. (2020); Chen and Li (2021) leverage textual
descriptions of entities or relations as additional information to perform
their tasks. This additional input allows models to recognize previously
unseen entities (or relations) in text, based on the provided descriptions. Wu
et al. (2020) and Aly et al. (2021) provide examples of the effectiveness of
descriptions in the zero-shot NER task. The same mechanism can also be applied
to the RE task Chen and Li (2021) by providing descriptions of the relation
between entity pairs. Figure 1 shows the input and output of a zero-shot NER
and classification model such as SMXM Aly et al. (2021). Leveraging entity
descriptions, the model is able to disambiguate between mentions of the term
"apple" – which could indicate a mention of the homonymous company, or the
fruit – despite having been trained only on OntoNotes Weischedel et al. (2017)
classes. By projecting each token in the latent space of a pre-trained
Language Model (LM), the semantic distance between the label/description of a
class and each token in a sentence can be used as a method assign tokens to a
certain entity.

Figure 1:  An example of a zero-shot NER prediction. Using textual
descriptions, the model is able to differentiate between the two unseen
classes.

There are several variations to ZSL approaches, both for NER and RE. For
example, De Cao et al. (2021) show how it is possible to frame the zero-shot
NER task as an end-to-end autoregressive generation problem that exploits the
probability distribution learned by the LM, while Wu et al. (2020) uses a
combination of a bi-encoder and a cross-encoder for entity linking. In
addition to the different configurations of NER and RE models – i.e. model
architectures, training strategies and datasets – these components often
depend on other NLP tools to process texts and on each other, e.g. RE models
often are not end-to-end and require entity spans in a text as part of their
input.

##  2 Motivations and Contributions

The hidden complexity in running NER or RE experiments in the ZSL context and
the lack of a shared framework and API to describe the inputs and outputs of
such models hampers the reproducibility of many approaches, as well as the
ability of the research community to evaluate new models against strong
baselines under the same experimental conditions. More specifically, we
identified the following major shortcomings for what concerns the ability to
evaluate existing NER and RE approaches under the same experimental
conditions.

#### Different assumptions about the task.

Some NER and Entity Linking methods assume that the mentions to link to are
given, while others are end-to-end. Similar considerations apply also to RE,
where some approaches tackle the task as an end-to-end problem and others as a
classification one. Furthermore, some approaches may be limited in terms of
performance or scalability and might therefore provide an evaluation only on a
restricted subset of a dataset or on a simplified version of their task. For
example, entity linking models are often unable to link entities to a dataset
the size of Wikipedia or Wikidata in the same way as many RE approaches cannot
scale to hundreds of relation classes. These differences in the input-output
configuration of NER and RE models impact the ability of researchers to
evaluate new approaches against existing ones, either for the lack of clarity
when describing their evaluation strategy or for the investment required to
make the appropriate changes to the models configurations, in order to make
them comparable under the same experimental conditions.

#### Lack of standard datasets.

As the performance of ZSL approaches increases, better and more specific
datasets are developed to help researchers evaluate increasingly challenging
problems. The release of the FewRel and FewRel 2.0 datasets is an example of
this refinement process Gao et al. (2019). In the first version of FewRel, a
RE model was expected to assign to each entity pair in a sentence a relation
from a list. In other words, there was always a correct class for the model to
pick to describe the relation between an entity pair. However, the most
frequently occurring scenario in the real world is when two entities are not
related or when the correct relation between the entities is missing among the
options given by the model. This prompted the release of an updated version of
the dataset, which includes the no relation class as an option for RE models
to choose from. Similar considerations can be made for the evaluation of NER
models and domain-specific ones. Another aspect which is often overlooked in
many research papers is the lack of a shared implementation of a training,
validation and test split for a dataset. This is especially important in the
ZSL setting where entities or relation classes should not overlap between
training/validation and test dataset splits. Often, zero-shot datasets are
obtained from a random split of existing datasets, which were not originally
designed to be used for the evaluation of zero-shot approaches and contain
overlapping output classes in the respective training/validation and test set.
In the process of transforming these datasets the exact split of classes is
often not reported and this hampers the reproducibility of the evaluation
results presented in a research work.

#### Different evaluation metrics.

To compare a group of models under the same experimental conditions, different
researchers will have to agree on a set of evaluation metrics to employ. This
often happens when a new NLP task is introduced, together with a reference
dataset and baselines. For NER and RE, the reference metric is often the Macro
F1 Score, but there might be models which have a better precision/recall
balance depending on the task or that have been evaluated on different, more
domain-specific metrics when first described to the research community. These
differences make it harder for researchers to benchmark models across
different datasets or domains and to evaluate the actual improvements of newly
proposed approaches.

To tackle the above-described problems concerning the evaluation and
benchmarking of zero-shot NER and RE models, we present Zshot. Zshot is an
open-source, easy-to-use, and extensible framework for ZSL in NLP.

The main contributions of the Zshot framework are the following:

  * •

Standardization and modularization: Zshot standardizes and modularizes the NER
and RE tasks providing an easy to use and customize API for these models.

  * •

Unification of NER and RE: these tasks are often considered separately in
existing literature, however this is not the case in real world scenarios
where the models are strongly interconnected. In Zshot, users can define
unified pipelines for both tasks.

  * •

Compatible with SpaCy Honnibal and Montani (2017) and the HuggingFace library
Wolf et al. (2019): users define pipelines following SpaCy style NLP pipelines
and models are hosted by HuggingFace.

  * •

Evaluation: provides an easy to use and extend evaluation framework for
different models and pipelines on standard benchmark datasets for NER and RE.

  * •

Visualization: Zshot builds on displaCy capabilities as a visualization tool
to display results of NER annotations and RE models.

  * •

Ensemble pipeline: Zshot provides simple API for ensembling of NER or RE
pipelines using different entity or relation descriptions or models, yielding
more accurate results than standalone systems.

  * •

Open source: the open source community can customise and extend Zshot adding
new models, evaluation metrics and datasets.

⬇

1nlp_config = PipelineConfig(

2 entities=[

3 Entity(

4 name="Company",

5 description="Names of company or organisation"

6 ),

7 Entity(

8 name="Fruits",

9 description="Names of fruits such as pear, banana and orange"

10 ),

11 ],

12 linker=LinkerSMXM(),

13)

Listing 1: Python example of a Zshot pipeline configuration.

The Zshot library implements a pipeline defined by 3 components i.e., Mention
Detection, Entity Linking and Relation Extraction and is compatible with SpaCy
Honnibal and Montani (2017). It extends the popular displaCy tool for zero-
shot entity and relation visualization, and defines an evaluation pipeline
that validates the performance of all components, making it compatible with
the popular HuggingFace library Wolf et al. (2019). Zshot aims to provide an
easy-to-use solution that can be integrated in production pipelines, while at
the same time providing researchers with a framework to easily contribute,
validate and compare new state-of-the-art approaches. We open source all the
code, models, metrics and datasets used. 111Zshot:
https://github.com/IBM/zshot

##  3 Design and Implementation

Figure 2 shows a high-level overview of the Zshot pipeline composed by three
main modules i.e., Mention Detection, Entity Linking and Relation Extraction.
The pipeline accepts a configuration object that allows to select the output
classes of mentions, entities and relationships of interest and the models to
use to perform each task (see Listing 1). Then, each of the library modules
adds annotations that can be used at a later stage, extending a SpaCy NLP
pipeline. Components like the Entity Linker and the Relation Extractor can
also be end-to-end, in which case the pipeline automatically skips the
unnecessary previous steps. Zshot also automatically manages batching,
parallelization and the device on which to perform the computation. All
options are configurable and modules are customizable.

Figure 2:  High-level architecture of Zshot. The Entity Linker and the
Relation Extractor can use the predictions of previous components. For end-to-
end models, the pipeline will skip the previous steps.

Listing 1 contains a sample pipeline configuration for NER, the same used to
produce the example shown in Figure 1. The configuration defines the two
entity classes to be identified, providing a title and a textual description
for each of them. It is also specified to use the SMXM end-to-end linker (see
Section 3.2 for more details).

In the remainder of this section, we will dive deeper into the details of each
of the building blocks of Zshot.

###  3.1 Mention Detection

Mention detection is the task that consists in identifying spans of text that
may contain entities in a defined set of classes of interest. In our
framework, mention detection is used as a pre-processing step for entity
linkers (see 3.2) that require mentions as input, such as Wu et al. (2020) and
Cao (2021).

Zshot currently supports six mentions extractors. Four reuse existing generic
annotators (i.e., Flair Akbik et al. (2019) and SpaCy) while the other two are
sensitive to the defined mentions/entities classes (i.e., TARS Halder et al.
(2020) and SMXMs).

###  3.2 Entity Linking and Classification

Entity classification is the process of identifying the type of a given
mention in the text. For example, if a text mentions "Barack Obama", entity
classification would determine that this refers to a person, but would not
specify which person. Entity linking, also known as named entity
disambiguation, is the process of identifying and disambiguating mentions of
entities in a text, linking them to their corresponding entries in a knowledge
base or a dictionary. For example, given "Barack Obama", entity linking would
determine that this refers to the specific person with that name (one of the
presidents of the United States) and not any other person or concept with the
same name. In Zshot we introduce the Linkers. Linkers can perform both entity
classification and entity linking, depending on the entities being used. For
simplicity, we use entity linking as the name of the task, but this comprises
both entity classification and entity linking. Entity linking can be useful
for a variety of natural language processing tasks, such as information
extraction, question answering, and text summarization. It helps to provide
context and background information about the entities mentioned in the text,
which can facilitate a deeper understanding of the content. There are several
techniques that can be used for entity linking, including dictionary-based
methods, rule-based methods, and machine learning-based methods.

Zshot currently supports four Entity linking and classification methods
(Linkers): Blink Wu et al. (2020), GENRE De Cao et al. (2021), TARS and SMXM
Aly et al. (2021).

###  3.3 Wikification

Two of the entity linkers, Blink and GENRE, can scale to very large knowledge
bases and in Zshot they can be used to perform Wikification out-of-the-box.
Wikification is the process of adding wikilinks to a piece of text, which
allows readers to easily navigate to related articles or pages within a wiki
or other online encyclopedia. A wikilink is a hyperlink that is used within
Wikipedia – or another online encyclopedia – to link to other pages within the
same resource. Wikification is often used to provide context and background
information about the concepts and entities mentioned in a piece of text. It
can also be used to create a network of interconnected articles within
Wikipedia or another online encyclopedia, which makes it easier for readers to
explore related topics and gain a deeper understanding of the content.

###  3.4 Relation Extraction

Relaction extraction (or classification) is the task inferring the relation
between an entity pair within a portion of text. This task is often framed as
a classification problem where a text with entity mentions are given in input
to a classifier which is trained to recognize the correct relation type
connecting the entities. In the literature, we can also find variants of this
approach such as Ni et al. (2022) which operate in an end-to-end fashion,
without requiring entity mentions. ZSL approaches for RE often receive in
input a set of candidate of relation descriptions and match them with each
entity pair in a text.

Currently, Zshot supports one relation classification model i.e., ZS-BERT Chen
and Li (2021). This model performs relation classification by first embedding
relation descriptions using a sentence embedding model and then comparing it
with an entity pair embedding computed with a LM fine-tuned for this task.
Entity pairs are finally associated to the closest relation class in the
embedding space in terms of cosine similarity.

###  3.5 Ensembling

There are different pretrained linkers and mention extractors. These models
are pretrained with different data, using different training methods and
neural architectures. We provide an easy way to combine the predictions from
these models so that we can achieve a more robust result by leveraging the
strengths of the diverse set of models.

Besides the ensembling of linkers, we also support an API for making an
ensemble of pipelines with different entity/relation descriptions. We
discovered that the accuracy of ZSL models is very sensitive to provided
entity/relation descriptions. Combining prediction from pipelines with
different descriptions potentially provides significant improvement. An
example of the API to make an ensemble of linkers, and mention extractors with
various descriptions is demonstrated in the listing 5 in the Appendix.

###  3.6 Customization

One of the most important parts of a framework is to allow the community to
create and share new components, which results in improving the models’
performance and the appearance of new ones. Zshot allows users to create new
components easily, by extending one of the abstract classes (depending on the
type of component: mentions extractor, linker or relation extractor). The user
just has to implement the predict method to create a new component, and Zshot
will take care of the rest, including adding the result to the _SpaCy_
document or adding it to the pipeline. Listing 3 shows a simple example of how
to implement a custom mentions extractor that will extract as mentions all the
words that contain the letter _s_. The predict method takes as input a list of
_SpaCy_ documents and return, for each document, a list of Zshot Span, with
the boundaries of the mention in the text. We encourage the users to develop
new components, models, and datasets and share them with the community.

##  4 Visualization

NER and RE models are broadly used in multiple and diverse NLP pipelines, from
Knowledge Graph generation and population to Information Extraction systems.
However, for development or research, NER and RE models are sometimes the
final output of the process. For these reasons, an appealing visualization of
the entities and relations extracted by a model is important. Visualization
helps users to rapidly assess what entities and relations have been extracted,
and allows them make changes to improve their models. In Zshot, we extend
displaCy, a SpaCy tool for visualization. When using displaCy for NER with
custom entities, the visualization shows the entities, but all of them have
the same color, so it’s not easy for the user to see the entities detected. We
expanded the capabilities of the library to support distinct colors for
different entities (see Figure 3).

Figure 3: Visualization using Zshot version of displaCy.

At the time of writing, we could not find a visualization tool for RE in
displaCy, 222https://spacy.io/usage/visualizers as RE is not supported in
SpaCy. In Zshot, we extend displaCy to support the visualization of edges
between entity pairs in a sentence as shown in Figure 4.

Figure 4:  An example of RE visualization in Zshot.

##  5 Evaluation

Evaluation is key to improve the performance of a system. To assess the
performance of NER and RE models, Zshot provides an evaluation module. This
module includes an interface to different datasets i.e., OntoNotesZS Pradhan
et al. (2013), MedMentionsZS Mohan and Li (2019) for NER and FewRel Han et al.
(2018) for RE. All the datasets included have been preprocessed to assure that
they can be used in the ZSL setting i.e., the entities/relations in the
training or validation splits of these datasets are not overlapping with each
other and are not included in the respective test sets to ensure a correct
evaluation. These datasets are managed using the Huggingface datasets library,
333https://github.com/huggingface/datasets which makes it easier to add new
datasets using the Huggingface Hub 444https://huggingface.co/datasets. In
Zshot, we use the evaluate package 555https://github.com/huggingface/evaluate,
implementing evaluators for the Mentions Extraction, Entity Linking and RE
tasks. On top of the evaluators, we added a function that receives a SpaCy NLP
model with a Zshot configuration and the splits of the predefined datasets,
and it evaluates the model on all datasets configurations. This function
returns the evaluation results both as a table with the results as a string
object or as a Python dictionary. As a default option, we use the SeqEval
package Nakayama (2018) to compute the evaluation metrics, including Accuracy,
Precision, Recall, F1-Score Macro and F1-Score Micro. However, using the
evaluate package, it is also easy to define and use custom metrics extending
the same package. Table 1 shows an example of the evaluation results format
for the OntoNotes validation set, as it is returned by Zshot.

Metric | ontonotes-test
---|---
overall_precision_macro | 20.96%
overall_recall_macro | 48.15%
overall_f1_macro | 29.12%
Table 1:  Example of result in Zshot for SMXM linker over the validation set
of OntoNotesZS. These are only some metrics reported for one model, to see the
whole result please check Table 2 in the Appendix, with a comparison between
two different linkers.

##  6 Conclusion and Future Work

In this paper, we described Zshot, a framework for zero-shot NER and RE in
NLP. ZSL is a growing area of research in NLP. The increasing number of
research works published every year and the difficulties associated to the
lack of standardization motivated us to develop this framework.

Our work aims at standardizing experimental zero-shot pipelines to improve the
reproducibility of existing approaches and facilitate the comparison with new
ones. We defined a customizable interface based on the popular SpaCy library.
This allows developers and researchers already familiar with this popular
Python library to quickly try out zero-shot NLP approaches, while more
experienced users can extend it to include new models. We also provide an
evaluation package to aid the evaluation and comparison of NER and RE models
on different datasets through standard evaluation metrics, which can be
further customized and expanded by users. Finally, we extended the displaCy
library to support visualizations of recognized entities and the relations
between them as edges between entity spans. We open source all our code,
models, metrics and datasets.

In the future, we plan to increase the number of supported models and datasets
for NER and RE. We also aim to increase the efficiency of these models so that
they could be employed by NLP practitioners in real world applications.

## Limitations

Zshot is a SpaCy extension for ZSL. It currently supports models for Mention
Detection, Entity Linking and Relation Extraction allowing users to evaluate
the supported models and to visualize their outputs. The limitations of our
framework are strongly dependent on these models trained on limited amounts of
data (in English) for research purposes. Therefore, their results might not be
reliable on certain domain-specific scenarios which were not included in the
training data and may contain biases. Some models are also more scalable and
efficient than others. The efficiency of a model will depend on its
implementation. We focus on providing a standard an API and an efficient
framework based on SpaCy to run these models. The pretrained models are
required to fine-tuned with in-domain training classes, even non-overlapping
with testing classes, generalization of these models in new domains is
considered as future work.

## Ethics Statement

Zshot is an opensource, easy-to-use, and extensible framework for ZSL. These
models may contain bias and cause ethical concerns, as it can be seen in
Figure 5 (see Appendix), where one of the models supported in Zshot assigns an
entity label in a biased way, being based on the gender of the name. Bias in
NLP models is a common issue Stanczak and Augenstein (2021), and a lot of
efforts focus on mitigating this problem, Sun et al. (2019). Zshot is a
framework that aims at standardizing and facilitating the use zero-shot NLP
models, and it does not increase nor decrease their bias. We encourage users
to assess the bias of NLP models prior to employing them in any downstream
task and to validate their results depending on the application scenario to
eliminate any potentially negative impact.

## References

  * Akbik et al. (2019) Alan Akbik, Tanja Bergmann, Duncan Blythe, Kashif Rasul, Stefan Schweter, and Roland Vollgraf. 2019.  FLAIR: An easy-to-use framework for state-of-the-art NLP.  In _NAACL 2019, 2019 Annual Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations)_ , pages 54–59.
  * Aly et al. (2021) Rami Aly, Andreas Vlachos, and Ryan McDonald. 2021.  Leveraging type descriptions for zero-shot named entity recognition and classification.  In _Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)_ , pages 1516–1528, Online. Association for Computational Linguistics.
  * Cao (2021) Rui Cao. 2021.  Holistic interpretation in locative alternation – evidence from self-paced reading.  In _Proceedings of the 35th Pacific Asia Conference on Language, Information and Computation_ , pages 543–550, Shanghai, China. Association for Computational Lingustics.
  * Chen and Li (2021) Chih-Yao Chen and Cheng-Te Li. 2021.  ZS-BERT: towards zero-shot relation extraction with attribute representation learning.  _CoRR_ , abs/2104.04697.
  * De Cao et al. (2021) Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. 2021.  Autoregressive entity retrieval.  In _9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021_. OpenReview.net.
  * Gao et al. (2019) Tianyu Gao, Xu Han, Hao Zhu, Zhiyuan Liu, Peng Li, Maosong Sun, and Jie Zhou. 2019\.  FewRel 2.0: Towards more challenging few-shot relation classification.  In _Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)_ , pages 6250–6255, Hong Kong, China. Association for Computational Linguistics.
  * Halder et al. (2020) Kishaloy Halder, Alan Akbik, Josip Krapac, and Roland Vollgraf. 2020.  Task-aware representation of sentences for generic text classification.  In _Proceedings of the 28th International Conference on Computational Linguistics_ , pages 3202–3213, Barcelona, Spain (Online). International Committee on Computational Linguistics.
  * Han et al. (2018) Xu Han, Hao Zhu, Pengfei Yu, Ziyun Wang, Yuan Yao, Zhiyuan Liu, and Maosong Sun. 2018.  FewRel: A large-scale supervised few-shot relation classification dataset with state-of-the-art evaluation.  In _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing_ , pages 4803–4809, Brussels, Belgium. Association for Computational Linguistics.
  * Honnibal and Montani (2017) Matthew Honnibal and Ines Montani. 2017.  spaCy 2: Natural language understanding with Bloom embeddings, convolutional neural networks and incremental parsing.  To appear.
  * Mohan and Li (2019) Sunil Mohan and Donghui Li. 2019.  Medmentions: A large biomedical corpus annotated with {umls} concepts.  In _Automated Knowledge Base Construction (AKBC)_.
  * Nakayama (2018) Hiroki Nakayama. 2018.  seqeval: A python framework for sequence labeling evaluation.  Software available from https://github.com/chakki-works/seqeval.
  * Ni et al. (2022) Jian Ni, Gaetano Rossiello, Alfio Gliozzo, and Radu Florian. 2022.  A generative model for relation extraction and classification.  _arXiv preprint arXiv:2202.13229_.
  * Pradhan et al. (2013) Sameer Pradhan, Alessandro Moschitti, Nianwen Xue, Hwee Tou Ng, Anders Björkelund, Olga Uryupina, Yuchen Zhang, and Zhi Zhong. 2013.  Towards robust linguistic analysis using OntoNotes.  In _Proceedings of the Seventeenth Conference on Computational Natural Language Learning_ , pages 143–152, Sofia, Bulgaria. Association for Computational Linguistics.
  * Stanczak and Augenstein (2021) Karolina Stanczak and Isabelle Augenstein. 2021.  A survey on gender bias in natural language processing.  _CoRR_ , abs/2112.14168.
  * Sun et al. (2019) Tony Sun, Andrew Gaut, Shirlyn Tang, Yuxin Huang, Mai ElSherief, Jieyu Zhao, Diba Mirza, Elizabeth Belding, Kai-Wei Chang, and William Yang Wang. 2019.  Mitigating gender bias in natural language processing: Literature review.  In _Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics_ , pages 1630–1640, Florence, Italy. Association for Computational Linguistics.
  * Weischedel et al. (2017) Ralph M. Weischedel, Eduard H. Hovy, Mitchell P. Marcus, and Martha Palmer. 2017\.  Ontonotes : A large training corpus for enhanced processing.
  * Wolf et al. (2019) Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al. 2019.  Huggingface’s transformers: State-of-the-art natural language processing.  _arXiv preprint arXiv:1910.03771_.
  * Wu et al. (2020) Ledell Wu, Fabio Petroni, Martin Josifoski, Sebastian Riedel, and Luke Zettlemoyer. 2020.  Scalable zero-shot entity linking with dense entity retrieval.  In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)_ , pages 6397–6407, Online. Association for Computational Linguistics.

##  Appendix A Appendix: Code Examples

We report below some examples of use of the Zshot framework:

  * •

Listing 2 shows an example of how to use Zshot to compute both entities and
relations and to visualize RE, as shown in Figure 4.

  * •

Listing 3 shows an example of how to create a custom mentions extractor in
Zshot.

  * •

Figure 5 reports an example of possible biases contained in NLP models for
relation classification.

  * •

Listing 5 shows an example of how to use Zshot to make an ensembles of
existing pretrained linkers and descriptions. In this specific example, two
linkers are used together with two different descriptions of the entity
_fruits_.

  * •

Listing 4 shows an example of how to use Zshot to annotate a sentence with
entities and relations. Figure 6 shows the result.

⬇

1# Import SpaCy

2import spacy

3

4# Import PipelineConfig for Zshot configuration and displacy for
visualization

5from zshot import PipelineConfig, displacy

6# Import Entity and Relation data models

7from zshot.utils.data_models import Entity, Relation

8# Import LinkerSMXM for end2end NER

9from zshot.linker import LinkerSMXM

10# Import ZSRC for RE

11from zshot.relation_extractor import RelationsExtractorZSRC

12

13# Create/Load an NLP model

14nlp = spacy.load("en_core_web_sm")

15# Create a Zshot configuration with SMXM, ZSRC and some entities and
relations

16nlp_config = PipelineConfig(

17 linker=LinkerSMXM(),

18 relations_extractor=RelationsExtractorZSRC(thr=0.1),

19 entities=[

20 Entity(name="company", description="The name of a company"),

21 Entity(name="location", description="A physical location"),

22 ],

23 relations=[

24 Relation(name=’located in’, description="If something like a person, a
building, or a company is located in a particular place, like a city, country
of any other physical location, it is present or has been built there")

25 ]

26)

27# Add Zshot to SpaCy pipeline

28nlp.add_pipe("zshot", config=nlp_config, last=True)

29

30# Run the pipeline over a text

31text = "IBM headquarters are located in Armonk."

32doc = nlp(text)

33# Visualize the result

34displacy.render(doc, style=’rel’)

Listing 2: Python example of using Zshot displacy.

⬇

1# Import SpaCy

2import spacy

3# Import types needed for typing

4from typing import Iterable

5from spacy.tokens import Doc

6# Import Zshot PipelineConfig

7from zshot import PipelineConfig

8# Import Zshot Span to save the results

9from zshot.utils.data_models import Span

10# Import abstract class

11from zshot.mentions_extractor import MentionsExtractor

12

13# Extend MentionsExtractor

14class SimpleMentionExtractor(MentionsExtractor):

15 # Implement predict function

16 def predict(self,

17 docs: Iterable[Doc],

18 batch_size=None) -> Iterable[Iterable[Span]]:

19 spans = [[Span(tok.idx, tok.idx + len(tok))

20 for tok in doc if "s" in tok.text] for doc in docs]

21 return spans

22

23# Create spacy pipeline

24nlp = spacy.load("en_core_web_sm")

25# Create config with the new custom

26config = PipelineConfig(

27 mentions_extractor=SimpleMentionExtractor()

28)

29# Add zshot with custom component to the spacy pipeline

30nlp.add_pipe("zshot", config=config, last=True)

31

32text_acetamide = "CH2O2 is a chemical compound similar to Acetamide used in
International Business Machines Corporation (IBM)."

33# Run the pipeline and print the result

34doc = nlp(text_acetamide)

35print([doc.text[mention.start:mention.end] for mention in doc._.mentions])

36# -> [’is’, ’similar’, ’used’, ’Business’, ’Machines’]

Listing 3: Example of creating a custom mentions extractor in Zshot. Figure 5:
Example of bias of the SMXM linker model integrated in Zshot.

⬇

1from zshot.utils.data_models import Entity

2from zshot.linker import LinkerSMXM

3from zshot import PipelineConfig, displacy

4import spacy

5

6nlp = spacy.blank(’en’)

7config = PipelineConfig(

8 entities=[

9 Entity(name="company", description="The name of a company"),

10 Entity(name="location", description="A physical location"),

11 Entity(name="chemical compound", description="any substance composed of
identical molecules consisting of atoms of two or more chemical elements."),

12 ],

13 linker=LinkerSMXM()

14)

15nlp.add_pipe("zshot", config=config, last=True)

16

17text_acetamide = "CH2O2 is a chemical compound similar to Acetamide used in
International Business " \

18 "Machines Corporation (IBM)"

19

20doc = nlp(text_acetamide)

21displacy.render(doc, style="ent")

Listing 4: Example of annotating a sentence in ZShot. Figure 6:  Example of
sentence annotation with Zshot. Code of Listing 4 was used to generate this
example.

⬇

1# import necessary libraries and define a spacy pipeline

2import spacy

3from zshot import PipelineConfig

4from zshot.linker import LinkerSMXM, LinkerTARS

5from zshot.linker.linker_ensemble import LinkerEnsemble

6from zshot.utils.data_models import Entity

7from zshot import displacy

8nlp = spacy.blank("en")

9

10# a list of two different descriptions of the entity "fruits"

11enhanced_descriptions = [[Entity(name="fruits", description="The sweet and
fleshy product of a tree or other plant.")],

12 [Entity(name="fruits", description="Names of fruits such as banana,
oranges")]]

13

14# a list of two different pretrained linkers

15linkers = [LinkerSMXM(), LinkerTARS()]

16

17# Define an ensemble linker with the given enhanced descriptions and
pretrained linker models.

18# The provided threshold=0.25 means that at least 1 pipeline out of 4 votes
for an output span.

19# We have overall 4 pipelines in the ensemble (2 enhanced descriptions times
2 linkers).

20ensemble=LinkerEnsemble(enhance_entities=enhanced_descriptions,
linkers=linkers, threshold=0.25)

21

22# add the ensemble to the spacy NLP pipeline

23nlp.add_pipe("zshot", config=PipelineConfig(linker=ensemble), last=True)

24

25# annotate a piece of text

26doc = nlp(’Apples or oranges have a lot of vitamin C.’)

27

28# Visualize the result

29displacy.render(doc)

Listing 5: Python example of making an ensemble of pipelines with two linkers and two different descriptions of the entity _fruits_. Metric | SMXM ontonotes-test | TARS ontonotes-test
---|---|---
overall_precision_micro | 22.12% | 34.87%
overall_recall_micro | 50.47% | 48.22%
overall_f1_micro | 30.76% | 40.47%
overall_precision_macro | 20.96% | 28.31%
overall_recall_macro | 48.15% | 33.64%
overall_f1_macro | 28.12% | 28.29%
overall_accuracy | 86.36% | 90.87%
total_time_in_seconds | 1811.5927 | 613.5401
samples_per_second | 0.2352 | 0.6943
latency_in_seconds | 4.2526 | 1.4402
Table 2:  Full result of ZShot for evaluation. This experiment was performed
on a MacBook Pro with an Intel-i7, 64Gb of RAM and no GPU. Results and
comparison are only for illustration, as models have not been trained over the
same data.