annotated-nyt

Utilities for working with the Annotated NYT corpus.

License

License

GroupId

GroupId

edu.jhu.hlt
ArtifactId

ArtifactId

annotated-nyt
Last Version

Last Version

1.1.4
Release Date

Release Date

Type

Type

jar
Description

Description

annotated-nyt
Utilities for working with the Annotated NYT corpus.
Project URL

Project URL

http://github.com/hltcoe/annotated-nyt
Project Organization

Project Organization

Johns Hopkins University HLTCOE
Source Code Management

Source Code Management

https://github.com/hltcoe/annotated-nyt

Download annotated-nyt

How to add to project

<!-- https://jarcasting.com/artifacts/edu.jhu.hlt/annotated-nyt/ -->
<dependency>
    <groupId>edu.jhu.hlt</groupId>
    <artifactId>annotated-nyt</artifactId>
    <version>1.1.4</version>
</dependency>
// https://jarcasting.com/artifacts/edu.jhu.hlt/annotated-nyt/
implementation 'edu.jhu.hlt:annotated-nyt:1.1.4'
// https://jarcasting.com/artifacts/edu.jhu.hlt/annotated-nyt/
implementation ("edu.jhu.hlt:annotated-nyt:1.1.4")
'edu.jhu.hlt:annotated-nyt:jar:1.1.4'
<dependency org="edu.jhu.hlt" name="annotated-nyt" rev="1.1.4">
  <artifact name="annotated-nyt" type="jar" />
</dependency>
@Grapes(
@Grab(group='edu.jhu.hlt', module='annotated-nyt', version='1.1.4')
)
libraryDependencies += "edu.jhu.hlt" % "annotated-nyt" % "1.1.4"
[edu.jhu.hlt/annotated-nyt "1.1.4"]

Dependencies

compile (2)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.12
edu.jhu.hlt : acute jar 2.0.4

test (6)

Group / Artifact Type Version
junit : junit jar 4.11
org.apache.logging.log4j : log4j-slf4j-impl jar 2.2
org.apache.logging.log4j : log4j-core jar 2.2
com.fasterxml.jackson.core : jackson-core jar 2.5.1
com.fasterxml.jackson.core : jackson-annotations jar 2.5.1
com.fasterxml.jackson.core : jackson-databind jar 2.5.1

Project Modules

There are no modules declared in this project.

annotated-nyt

Utilities for reading the Annotated NYT corpus.

Maven Badges javadoc.io

Latest Maven dependency

<dependency>
  <groupId>edu.jhu.hlt</groupId>
  <artifactId>annotated-nyt</artifactId>
  <version>1.1.5</version>
</dependency>

Quick start

Create a NYTCorpusDocumentParser object:

NYTCorpusDocumentParser parser = new NYTCorpusDocumentParser();

Read a single .xml document from the annotated NYT corpus:

Path p = Paths.get("/your/path/.xml");
byte[] bytes = Files.readAllBytes(p);
NYTCorpusDocument ncd = parser.fromByteArray(bytes, false);
AnnotatedNYTDocument and = new AnnotatedNYTDocument(ncd);

API

All fields in the AnnotatedNYTDocument objects are guaranteed to be non-null.

Many of the fields in the corpus can be empty or null in the documents themselves. These fields are represented in the wrapper object, AnnotatedNYTDocument, as Optional fields.

Many convenience methods exist to convert naturally list-based items (e.g., the body as a List of paragraphs). Many of these sections, however, can also be null. In these cases, the API will return an empty List object. These lists will never be null.

Running the integration test

The integration test can be executed with the following command:

mvn clean verify -Pitest -DanytDataPath=/path/to/your/LDC/corpus/data/dir

The anyDataPath property should point to your data directory from the extracted ANYT corpus. This directory contains many folders with numbers as names, representing years of annotated NYT data.

edu.jhu.hlt

JHU Human Language Technology Center of Excellence

Versions

Version
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0