dataesr/scientific-paragraphs-categorization huggingface dataset:
Definition of Chord Alphabets There exist many qualities of musical chords (for example, maj7, min, dim) at different levels of precision. When studying a MIR task such as chord extraction or chord sequence inference, a collection of chord qualities is often defined to determine the level of precision. Thus, the chord alphabet used for this task can be increasingly complex, starting from a simple alphabet containing only major and minor chords, to one with more precisely described chords. The chord annotations of MIR datasets  [33]  often include additional notes (in parentheses) and the base note (after the slash). With this notation, reference datasets have thousand chord classes with a fairly sparse distribution. For the two studied MIR tasks, we do not use these extra notes and bass notes: F : maj7(11)/3 → F : maj7 (1) Nevertheless, even with this first reduction, the number of chord qualities remains large, and, as detailed in Section 4.
Hence, usual MIR evaluation methods are at odds with our needs: to have a high level of understanding of the musician's intent, even without a precise level of description. A 2 = {N. C} ∪ {P × maj, min, dim, aug, maj6, min6, maj7, minmaj7, min7, 7, dim7, hdim7, sus2, sus4} (4) 4 Motivated by the insights detailed in Section 4. 1, we propose to analyse chord-based models with a functional qualification of the classification outputs. Hence, we seek to observe the qualification of what are usually considered errors. In tonal music, the harmonic functions qualify the roles and the tonal significance of chords, and the possible equivalences between them within a sequence  [13, 36]. Therefore, our ACE Analyzer  [34]  is used to analyse the results. It includes two analysis modules designed in the aim of discovering musical relationships between the chords predicted by chord-based models and the target chords.
Both modules are generic, independent, and available online http://repmus. ircam. fr/ dyci2/ace_analyzer (accessed on 22 October 2021). The first module identifies errors relating to hierarchical connections or the usual rules of chord substitutions, i. e. , the use of one chord in place of another in a chord progression. Some chords may have different nature (i. e. , chord qualities) but have the same function within a chord progression. Therefore, a list of usual chord substitutions has been established based on musical knowledge (generally, the substituted chords have two pitches in common with the triad they replace). The ACE Analyzer's second module focuses on harmonic degrees. In music theory, a degree is written with a Roman character and corresponds to the position of a note inside a defined scale.
The interest of using degrees is that the notation is independent of the pitch of the tonic. A degree is also assigned for each chord obtained by the harmonization of the scale, and is defined by the position of the root note inside the scale. Hence, this module calculates the harmonic degrees of the predicted chord and the target chord using the key annotations in the dataset in addition to the chords: e. g. , in C, if the reduction of a chord on A 0 is C, it will be considered as "I", if the reduction of a chord on A 0 is D:min it will be considered as "ii", and so on. Then, it counts the harmonic degree substitutions when possible (e. g. , in C, if the reduction of a chord on A 0 is C#, it will not correspond to any degree). The aforementioned evaluation methods and the chord alphabets depicted in Figure  5  can be used for any chord-based MIR models.
Dataset Our experiments are performed on the Beatles dataset as it provides the highest confidence regarding ground truth annotations  [48]. This dataset consists of 180 handannotated songs, where each audio section is associated with a chord label. The CQT is calculated for each song using a window size of 4096 samples and a hop size of 2048. The transform is mapped to a six-octave scale with three bins per semitone, extending from C1 to C7. We augment the data by transposing everything from -6 to +6 semitones and changing the labels accordingly. Finally, we divide the data into three sets to evaluate our models: training (60 percent), validation (20 percent), and test (20 percent).
Introducing the Relations between Chords In order to train the model with the proposed distances, the original labels from the Isophonics dataset http://isophonics. net/content/reference-annotations-beatles (accessed on 22 October 2021) are reduced so that they fit one of our three alphabets A 0 , A 1 , A 2. Then, we denote y true as the one-hot vector where each bin corresponds to a chord label in the chosen alphabet A i. The model's output, noted y pred , is a vector of probabilities over all the chords in a given alphabet A i. In the case of D 0 , we train the model with a loss function that simply compares y pred to the original label y true. However, for our proposed distances (D 1 and D 2 ), a similarity matrix M that associates each couple of chords to a similarity ratio is introduced: M i,j = 1 D k (chord i , chord j ) + K (8) K is an arbitrary constant to avoid division by zero.
Proposed Methodology For the ACE task, we propose to perform an evaluation based on the functional qualification of the classification outputs (i. e. , by studying the harmonic function of the prediction errors). Therefore, we introduced the notion of weak or strong errors depending on the nature of the misclassified chords. Thus, using the two modules (explained in Section 4. 3. 2) that evaluate the results according to chord substitution rules and harmonic degrees will help to evaluate the ACE models by using a functional approach. For our experiments, we first evaluate models with the usual evaluation (a binary qualification of the classification outputs); then, we perform our proposed analysis in order to understand the functional qualification of the errors for the different models. In order to compare the results with other ACE models, the models are evaluated on three MIREX alphabets: Major/Minor, Sevenths, and Tetrads.
[53]. These alphabets correspond roughly to three alphabets defined in Section 4. 3. 1 (Major/Minor ∼ A 0 , Sevenths ∼ A 1 , Tetrads ∼ A 2 ). CNN models that have the same architecture are trained with varying chord distances (D 0 , D 1 and D 2 ) and an initial chord reduction on different alphabets (A 0 , A 1 and A 2 ). Then, the models are evaluated with the help of the MIREX evaluation library mir_eval https://craffel. github. io/mir_eval/ (accessed on 22 October 2021) on the three selected MIREX alphabets. According to the results of Table  1 , even if the classification score is very close between models, it appears to better to utilize a distance that takes into consideration the musical relationships between chords when using the Major/Minor alphabet. However, for more complex chord alphabets, the Tonnetz-based distance (D 1 ) applies a penalty of reduction to the A 0 alphabet.
Chord Sequence Continuation Tasks The goal of this article is to propose a system that interacts with a musician in real time by inferring expected chord progressions. In the previous part, we focused on the automatic chord extraction module. This section will present studies on the chord sequence continuation model. From a technical point of view, our aim is to predict the eight next beat-wise chords given eight beat-wise chords. The eight beat-wise chords that will be given to the model are those extracted with the ACE model. However, for the training of the chord sequence inference model, we will rely on datasets that are only made of symbolic chord progressions. The combination on the two systems will be detailed further in Section 7. For this task of automatic chord sequence continuation, it has been proven that using additional musical high-level information, such as the key or the downbeat position, within the learning of machine learning models would improve chord sequence continuations in terms of accuracy score.
State of the Art Most recent works on symbolic music inference and symbolic music continuation rely on machine learning and probabilistic models to infer musical information from a dataset of examples. Indeed, neural networks have shown promising results in the generation of new musical material from scratch or as the continuation of a track composed by a human  [27, 29]. However, these works operate at the note level, and not at the level of chords or chord progressions. In the field of chord sequence continuation or chord sequence generation, most works aim to infer the chord transition probabilities without accounting for the duration of each chord. This research often entails Hidden Markov Models (HMMs) and N-Gram models  [54] [55] [56]. Nevertheless, sophisticated ACE models use a combination of statistical models in order to extract chords along with other musical information such as the track segmentation  [57] , the chord duration  [58] , the downbeat position  [59]  or the key estimation  [60].
Dataset The Realbook dataset  [62]  is used for the training of chord sequence continuation models. It contains 2846 jazz songs based on band-in-a-box files http://bhs. minor9. com/ (accessed on 22 October 2021). All files come in a xlab format and contain time-aligned beat and chord information. In order to work at the beat level, the xlab files are processed to obtain a sequence of one chord per beat for each song. Our tests are made on three different alphabet reductions: A 0 , A 1 and A 2 (detailed in Section 4. 3. 1). Then, 5-fold cross-validation is performed by randomly splitting the song files into training (0. 8), validation (0. 1), and test (0. 1) sets with five different random seeds for the splits (the statistics reported in the following correspond to the average of the resulting five scores).
Since we do not want a model that predicts exactly the input chord sequence, we propose to remove from the dataset all files that contain the same A 2 chord (see Figure  5 ) repeated for more than eight bars, leading to a total of 78 discarded songs. For all the remaining songs, the beginning of the song is padded with seven beat-wise N. C symbols and we use all chord sub-sequences that contain 16 beat aligned chords, ending where the target is the last eight chords of each song.
We note that, in our training dataset, the majority of the tracks have a binary metric (often 4/4). Then, the downbeat position information of each chord in the predicted sequence is a value between 1 and 4. For our learning task, all the musical information (chord, key and downbeat position) are encoded through a one-hot vector that has the size of the corresponding alphabet. Thus, in the baseline model called the MLP-Vanilla, the inputs of the models are only the initial sequences of eight chords (see Figure  6 , input a). In order to study the impact of adding extra information for the continuation of chord sequences, we add two other pieces of musical information available in the proposed dataset. For MLP-Key, the inputs of our model is the initial chord sequence and the key (Figure  6  part a and b).
N-Grams A N-gram model is trained using the Kneser-Ney smoothing algorithm  [68] , with N = 9. This model estimates the prediction probability of the following chord given an input sequence of the previous N -1 chords. Unlike neural network models, we do not pad the dataset with N. C. symbols at the beginning of each song. Furthermore, as this method does not need a validation set, we merge the train and validation set and evaluate our model on the test set. During the decoding phase, we use a beam search, saving only the top 100 states (each state contains a sequence of nine chords with their associated probabilities) at each step. The final transition probability of a chord for each step is calculated as the sum of the normalized probabilities of each state in the beam.
Training Procedure Our neural network models are trained with the ADAM optimizer with a decreasing learning rate starting at 10 -3 and divided by a factor of two when the validation accuracy does not decrease for 10 epochs. We follow a 5-fold cross-validation training procedure, by randomly splitting the dataset into train (0. 8), valid (0. 1) and test (0. 1) sets. In order to evaluate the efficiency of our proposed methods, we also train state-of-the-art baseline models for chord sequence continuation described in the previous part.
Then, complementary predictive evaluations are performed by dividing the dataset between diatonic chords, which are built upon notes of the scale defined by the key of the track and non-diatonic chords. The division of chords into two subsets allows us to see more precisely the impact of the use of musical information. We observe that the use of the key or the position of the downbeat as input strongly constrains the network during the inference of the continuation of a chord sequence. This encourages one to consider the evaluation of the results in adequacy with the applicative purpose. Indeed, this work shows that it would not be relevant to use the same metric when the objective is to obtain an accurate transcription or a functional harmonic information. In the latter case, in the context of the development of a listening module for human musical improvisation machine, we suggest to rely on a more musically-informed evaluation.
In order to complete this study, we rely on the ACE analyser (presented in Section 4. 3. 2) in order to determine the harmonic functions of the predicted and targeted chords. Indeed, the use of this specific analyser allows a better musical understanding of the models' output than a classification score. Once again, the dataset is divided into diatonic and non-diatonic chords. Thereafter, the ACE analyser is used independently on both subsets in order to understand in depth the differences between the proposed models.
Behind the Score: Understanding the Errors In this section, we propose to analyze the chord sequence predictions through a functional qualification of the classification outputs (by taking into account the harmonic function of the chords). As aforementioned, the key of a track defines a musical scale, and diatonic chords are build upon this set of notes. Thus, in this section, we first study the evolution of the prediction score when splitting the dataset between diatonic and non-diatonic chords. Thereafter, we compare the functional relationships between the predicted and the targeted chords. Our goal is twofold: to understand what causes the errors in the first place, and to distinguish "weak" from "strong" errors with a functional approach. As detailed in Section 4. 1, the harmonic functions qualify the roles and the tonal significances of chords, and the possible equivalences between them within a sequence  [13, 36].
Distinguishing between Diatonic and Non-Diatonic Targets For the first experiment, we divide our dataset into diatonic chords and non-diatonic chords. As aforementioned, the key of a track defines a musical scale, and diatonic chords are the ones built upon this set of notes. Table  8  shows the accuracy scores and the number of correct predictions depending on the nature of the targeted chords for the different models over the different alphabets. We observe that adding information on the downbeat position (MLP-Beat) improves the prediction scores for both diatonic and non-diatonic chords. The model taking the key into account (MLP-Key) shows an important improvement for the diatonic chords; nevertheless, we observe a decrease of the classification score for the non-diatonic targets. Finally, the model using both key and downbeat position (MLP-KB) presents a better score for the diatonic targets but loses accuracy on the non-diatonic targets.
Distinguishing between Diatonic and Non-Diatonic Targets In a finer analysis, we can observe the different ways in which the subsets of diatonic and non-diatonic targets were affected by the use of high-level musical information. Table  10  presents the amount of "explainable" errors (i. e. , that correspond to usual chord substitutions) depending on this criterion on the A 0 alphabet (see Table  A1  in Appendix A for A 1 and A 2 alphabets). Table  10. For each model: the first line corresponds to the percentage of errors explained by substitution on diatonic (D. ) and non-diatonic (N-D. ) chord targets, the second line is the total percentage of correct prediction and explainable errors. The amounts of associated items in the test dataset are in parentheses. The first line of the table shows the cumulative percentage of explainable errors for the diatonic (D.
Focus on Diatonic Targets The next two experiments are a focus on harmonic degrees by splitting the dataset between diatonic targets and non-diatonic targets. Concerning diatonic targets, we observe on the left side of Table  11  that the nondiatonic predictions for diatonic targets (N-D. p. ) tend to decrease when using the information on key (MLP-Key and MLP-KB) or when we learned it (MLP-Aug), which corresponds to more correct harmonic functions when the target is diatonic. Furthermore, the ratios of errors corresponding to usual degree substitutions augment most of the time when we are using the information on key (see the right part of Table  11 ). Conversely, we see that adding the information on downbeat does not change significantly the harmonic function of the errors compared to the vanilla MLP model.
Thus, using the information on key strongly constrains the network to predict diatonic chords. We observe the same trends for the more complex chord alphabets (see Table  A2  in the Appendix A). Once again, we conclude that using the information on key improves the results only for diatonic chords, whereas using the information on downbeat always improves the results independently of the nature of the chords. Finally, the last study on the functional qualification of the classification outputs is conducted focusing on the evolution of the non-diatonic targets. We realise this analysis on the major songs only since they are most represented in the dataset. We extract the non-diatonic chords from each song (reduced to the A 0 alphabet) to study the corresponding predictions resulting from each of the sub-models.
Architecture of the Intelligent Listening and Predictive Module This section details the combination of the chord extraction and sequence continuation model, constituting our intelligent structuring and predictive listening module able to guide creative practices. The general workflow is depicted in Figure  1. The acoustic signal is first converted into a time-frequency representation. The ACE system presented in Section 5 is then used to extract local chords. This model is designed to receive 15 consecutive spectrogram frames, which leads to an input data frame of approximately 0. 7 s. However, most songs have a tempo located broadly between 60 and 220 bpm. Since we want to work at the beat level, the average time step between two local chord extractions may be less than 0. 7 s. Therefore, in our implementation, each audio section between two consecutive beats will be composed of 15 identical frames in order to achieve a tempo-independent architecture.
The advent of 4th generation synchrotrons, where BP will become available at several beamlines, should provide broader access to this microscopy method. X-ray BP makes use of a series of 3D Bragg diffraction intensity datasets, measured in the vicinity of a Bragg reflection, obtained by scanning the sample across a localised illumination beam. The sample motion is designed to ensure a significant amount of probe overlap, the redundancy in the dataset allowing retrieval of the otherwise inaccessible phase of the diffracted field from the set of diffracted intensities  34. As long as the probe is known, the phase recovery is performed with iterative algorithms, which further return the 3D sample image. An effective complex-valued crystalline electron density  35  , ρ(r), specifically designed to account for the Bragg geometry, is used to describe the sample as a function of r, the 3D spatial coordinate.
Its amplitude |ρ(r)|, provides information about the morphology (or density) of the scattering crystal domain. The spatially varying phase ϕ hkl (r) associated with a specific hkl Bragg vector Q hkl is linked to the atomic displacement field in the crystal, u(r), by ϕ hkl (r) = Q hkl • u(r). However, current BP approaches suffer from substantial limitations. They require the acquisition of an extended dataset, which relies on the stability of the experimental set-up over long measurement times (typically 6-12 h). This requires samples to be resistant to radiation damage, a particular challenge for biologically relevant materials. Moreover, BP requires the 3D probe to be known prior to the sample crystalline electron density reconstruction, a strong limitation, which has not been overcome so far.
Results Data acquisition. A tungsten, 1% rhenium alloy was manufactured by arc melting, producing a polycrystalline material with grain size of a few hundred microns as determined by scanning electron microscopy (SEM). The addition of rhenium mimics neutron-irradiation-induced transmutation alloying  37. The material was further implanted with helium ions that modified a ~3 μm thick surface layer (see Methods) and generate neutronlike collision cascade damage  20. Note that, during fusion reactor operation, helium is generated by transmutation and also diffuses from the plasma. Our use of helium ion implantation effectively mimics these two effects. Finally, using focussed ion beam (FIB) milling, a cross-section sample containing a grain boundary was extracted from the bulk and a region of 15 × 8 μm 2 was thinned to ~0.
45 μm, in excellent agreement with the thickness expected from SEM. 3D reconstruction of the sample image. To go further in the sample structure analysis, the whole dataset is inverted to retrieve the 3D sample crystalline electron density. This requires a detailed modelling of the scattering process: Under the kinematic scattering approximation, the Bragg diffraction intensity distribution, I j (q), at the j th probe position r j is given by: I j ðqÞ ¼ Z 1 0 Pðr À r j ÞρðrÞe iQ hkl ÁuðrÞ e iqÁr dr 2 ; ð1Þ where q represents the 3D reciprocal space coordinates, and P is the probe function. For the numerical implementation, the direct and reciprocal spaces are introduced. To preserve the data information, the reciprocal frame follows the measurement scanning space (q 1 , q 2 , q 3 ). Using a recently developed formalism  40  , this sampling corresponds to a direct space frame (r 1 , r 2 , r 3 ).
These features must be considered when defining the rocking curve angular steps. Indeed the numerical analysis of the dataset, which is based on the use of the fast Fourier transform, connects reciprocal and direct space through Fourier conjugation relations. Specifically, the sampling angle must be chosen such that the illuminated volume (green line) is fully contained in a cuboid defined in the (r 1 , r 2 , r 3 ) reconstruction space (orange line) as shown in Fig. 2a. Depending on the probe structure and on the criterion used to define the probe size, the angular sampling Δθ required along the rocking curve varies substantially, as illustrated in Fig. 2d , for verticalplane diffraction geometry. This plot presents the sampling condition as a function of the considered (i. e. vertical) probe width W and the sample thickness T, for a Bragg angle θ B of 43.