Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Project Milestone 2 — Hierarchical Parsing and Standardization

Objectives

In this milestone, students will transition from simple data collection to advanced data processing and analysis. The focus is to transform the unstructured raw data, the LaTeX sources crawled in Milestone 1, into a structured hierarchical format with cleaned, normalized, and deduplicated content. This practice mimics the real-world data science workflow of unstructured text processing and standardization. The machine learning part of this workflow, the reference matching pipeline, follows in Milestone 3 and consumes the outputs produced here.

Description

Students are required to implement an automatic parser that processes the scraped LaTeX source files from the previous Milestone. The processing pipeline consists of the following components:

Multi-file Gathering

The content of a LaTeX source is often spread across multiple .tex files, for example through the \input or \include commands. Students must programmatically identify the main compilation path and parse only those files that are actually included in the final PDF rendering. Unused or redundant files found in the source directory must be ignored. Concretely, the publication root is the .tex file containing the \documentclass declaration. Follow \input and \include commands transitively, treating commands that are commented out as plain text rather than includes, so the files reachable from the root form the compilation path and everything else in the source directory is a redundant auxiliary file. Following this path reproduces what LaTeX itself would compile, and the parse therefore covers what a reader of the final PDF sees.

Hierarchy Construction

Hierarchy Structure

The goal is to convert the raw LaTeX code into a hierarchical tree structure for each version of each publication.

Parsing Notes

To ensure consistency, the parser must adhere to specific rules regarding element granularity and exclusion:

Standardization and Deduplication

Cleanup and Normalization

Students must clean and normalize the data within the hierarchy:

Reference Extraction

For citations defined using \bibitem within the .tex files, students must convert them into standard BibTeX entries using programmatic tools such as regular expressions.

Deduplication

Deduplication is required at two levels, and both levels operate across versions of a publication:

Requirement

Process every publication produced in Milestone 1. For each publication, parse every version’s LaTeX source, following the compilation path, build the hierarchical structure, standardize and deduplicate the content, and extract the references into a unified set of BibTeX entries. A version without TeX sources, kept as an empty record by Milestone 1, yields no parsed elements: record the version as empty rather than skipping it, so coverage statistics and the tables below reflect reality.

There is no data submission in this milestone: the processed corpus stays with the group as the working input of Milestone 3, just as the crawled corpus does in Milestone 1.

Suggested data organization. As in Milestone 1, groups organize their working data themselves. This suggestion adapts the same spirit to the parsed and standardized data, so follow it as-is or adapt it for convenience. For each publication, keep the parsed content and structure of all versions together: the parsed elements, the per-version parent relations between them, and the unified, deduplicated BibTeX entries. This replaces the raw TeX folder from Milestone 1 as the downstream material, so keep enough to assemble the final tables without re-parsing.

At the final submission in Milestone 3 this data turns into the tables of the published dataset. This milestone already specifies three of them:

TableColumns (types) and contents
elementsone row per distinct element across all versions of the publication: element_id (string, non-null), arxiv_id (string, non-null), kind (string, dictionary), content (string). Content that matches exactly across versions, a full-text match after cleanup, occupies a single row
hierarchyarxiv_id (string, non-null), version (int), element_id (string, non-null), parent_id (string, non-null), with one row per node-parent edge of each version
bibtexarxiv_id (string, non-null), citation_key (string, non-null), entry_type (string, dictionary), title (string), authors (list of strings), year (int, nullable), doi (string), journal (string), url (string), holding the unified BibTeX entries after deduplication and merging
Dataset tables specified in this milestone

How the elements and the hierarchy store across versions. The elements of different versions share one store: when a leaf or component appears in two versions with identical cleaned content, it is recorded once, so a single element_id serves both versions, which is exactly the deduplication required above. The hierarchy rows then hold only the node-parent edges of each version, and an element contributed by an earlier version may act as a node in a later version’s edges, attached to a parent that exists only in that later version. Element IDs begin with the publication key followed by a discriminant that is unique inside the publication. The miniature example below, one publication with two versions and one sentence unchanged across both, shows the resulting rows:

element_idkindcontent
2310-12345#root1documentVersion 1 root
2310-12345#root2documentVersion 2 root
2310-12345#h1headingIntroduction
2310-12345#h2headingBackground and model
2310-12345#s1sentenceWe study the citation matching problem
Example elements rows, one shared store where s1 serves both versions
versionelement_idparent_id
12310-12345#h12310-12345#root1
12310-12345#s12310-12345#h1
22310-12345#h22310-12345#root2
22310-12345#s12310-12345#h2
Example hierarchy rows: the shared sentence s1 is a node in both versions, attached to h1 in version 1 and to h2 in version 2

Submission Format

Source Code

This milestone’s code is committed to the same single public GitHub repository used in Milestone 1, continuing the cumulative history that documents the group’s progress. The repository contains only source files such as Python files with the .py or .ipynb extensions and excludes data files, compiled executables, and other non-source materials, together with:

<group-repo>/
|-- src # folder containing the source code
|   |-- *.{py/ipynb}
|   |-- requirements.txt # To re-produce the environment
|-- README.md # Instructions on environment setup and code execution

This milestone is submitted via Moodle as a group by pasting the public links to the shared code repository and to the milestone report described below. All the submissions above should be in the official language of your program. NO late submission is permitted.

Report Requirements (Jupyter Book)

Students must prepare a milestone report compiled as a Jupyter Book, the same book repository introduced in Milestone 1 and hosted on its GitHub Pages, adding a parsing-and-standardization section to that book rather than creating a new one. The book must present the statistics and analysis of the processed data, and its figures and tables must be generated during book compilation, not pasted as static screenshots, for quality and interactivity. The report should specifically cover:

The parser’s performance should also be illustrated through two main points, running time and memory footprint: running time counts the end-to-end wall time of the parser and the average time to process one publication, while memory footprint counts the maximum RAM used and the final output’s storage size. The testbed for the final benchmarking is a Google Colab instance running on CPU-only mode. No upper limit on the running time is enforced, while the upper limit on maximum disk usage is given by the Colab instance.

The README.md of the repository stays separate: it provides clear instructions on setting up the necessary environment, such as the Python version and the packages to install through pip or conda, and running the code with specific configurations.

Grading Criteria

Your grade is determined upon five main criteria as listed below: