GithubHelp home page GithubHelp logo

viraltexts / vt-passim Goto Github PK

View Code? Open in Web Editor NEW
6.0 8.0 0.0 677 KB

Helper scripts for munging reprint data for the Viral Texts Project

License: Apache License 2.0

Shell 1.47% Python 54.69% Scala 34.17% Java 3.30% Makefile 6.36%

vt-passim's Introduction

vt-passim

This repository contains helper scripts developed by the Viral Texts Project to import data and process results.

Installation

These scripts rely on Apache Spark to manage parallel computations, either on a single machine or a cluster. If you don't already have access to Spark, we recommend downloading a precompiled, binary distribution of Spark, unpacking it, and adding the bin subdirectory to your PATH.

To compile the code in this repository, we use sbt. Run the following command in the top level:

$ sbt package

This should produce a runnable .jar in target/scala_*/vtpassim*.jar. (The exact filename will depend on the version of Scala and passim that you have.)

The bin subdirectory of the vt-passim distribution contains executable shell scripts such as vtrun. We recommend adding this subdirectory to your PATH.

Format Conversions with vtrun

The vt-passim repository contains several Spark applications to convert data from various format into the record structure required by passim. These conversion scripts are mostly invoked with the vtrun executable script.

The passim software for text reuse analysis takes as input a series of records representing individual documents. Minimally, each record requires a unique identifier (id) and textual content (text). In JSON format this looks like:

{"id": "d1", "text": "This is text."}

You may change the names of these fields when invoking passim.

To convert, for instance, a directory of .hocr files to passim's record format using the HOCR class, do:

$ vtrun HOCR <input> <output>

By default, this will convert the data into records in the binary parquet format used by Apache Spark. To request that Spark output data in the JSON format, append the following option to the SPARK_SUBMIT_ARGS environment variable:

$ SPARK_SUBMIT_ARGS='--conf spark.sql.sources.default=json' vtrun HOCR <input> <output>

Some useful format conversion classes are:

Class Description
AltoPages ALTO format output by many OCR systems
ChronAm .tar file containing multiple .xml files in ALTO format as used by Chronicling America
DjVu Deja Vu format as used by the Internet Archive
HOCR hOCR format output by many OCR systems
TCPPages TEI XML as used by the Text Creation Partnership

Many of these formats allow multiple pages per file. These conversion classes output one record per page.

vt-passim's People

Contributors

dasmiq avatar

Stargazers

Valdis Saulespurens avatar  avatar Zoe LeBlanc avatar  avatar Alex Gil avatar Shaobin (Alan) Xu avatar

Watchers

Shaobin (Alan) Xu avatar Ryan Cordell avatar James Cloos avatar  avatar  avatar Asko Nivala avatar Jonathan D. Fitzgerald avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.