Permalink
Browse files

First commit to Github repository

  • Loading branch information...
yoavartzi committed Oct 10, 2016
0 parents commit 07b581e7d160fa2625eeefa86ae5e9fe5c589be2
Showing 686 changed files with 127,214 additions and 0 deletions.
@@ -0,0 +1,5 @@
bin/
dist/
build/
build.src/
MANIFEST.MF
339 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,58 @@
# Cornell AMR Semantic Parser
[TOC]
## Quick Start
You can get started and parse a few simple sentences in under five minutes using our AMI image (`ami-bdc8d8d7`). Launch an EC2 instance (recommended `r3.2xlarge` at least) with our AMI image. The code in the image is fully complied and ready to run. The `~/amr/do.sh` command will quickly parse a few example sentences. The AMI is based on Ubuntu and the user name is `ubuntu`. The code repository is available [here](http://yoavartzi.com/amr).
## Requirements
Java 8.
## Preparing the Repository
- Get all required resources: `./getres.sh` (form the root of the repository)
- Compile: `ant dist`
## Pre-trained Models
A pre-trained model is available to download [here](https://bitbucket.org/yoavartzi/amr-resources/downloads/amr.sp).
## Parsing
Given a file `sentences.txt`, which contains a sentence on each line, and a model file `amr.sp`, both located in the root of the repository:
```
java -Xmx8g -jar dist/amr-1.0.jar parse rootDir=`pwd` modelFile=`pwd`/amr.sp sentences=`pwd`/sentences.txt
```
The output files will be in `experiments/parse/logs`. To see the full set of options (including increasing the logging level), run:
`java -jar dist/amr-1.0.jar`
## Preparing the data (required only for training and testing)
To re-create our experiments, obtain the AMR Bank release 1.0 ([LDC2014T12](https://catalog.ldc.upenn.edu/LDC2014T12)) form LDC. Extract the corpus to the directory `corpus/amr_anno_1.0`.
Then run the following:
- Compile the code: `ant dist`
- Prepare the environment: `utils/config.sh`
- Prepare the data: `utils/prepdata-ldc.sh`
## Attribution
```
@InProceedings{artzi-lee-zettlemoyer:2015:EMNLP,
author = {Artzi, Yoav and Lee, Kenton and Zettlemoyer, Luke},
title = {Broad-coverage CCG Semantic Parsing with AMR},
booktitle = {Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing},
month = {September},
year = {2015},
address = {Lisbon, Portugal},
publisher = {Association for Computational Linguistics},
pages = {1699--1710},
url = {http://aclweb.org/anthology/D15-1198}
}
```
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-test"/>
<classpathentry combineaccessrules="false" kind="src" path="/spfproxy"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/lemma-0.1.jar" sourcepath="/AMR_DEV_REPO/lib/lemma-0.1.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/stanford-postagger-3.4.jar" sourcepath="/AMR_DEV_REPO/lib/stanford-postagger-3.4-src.jar"/>
<classpathentry exported="true" kind="var" path="AMR_DEV_REPO/lib/easyccg.jar" sourcepath="/AMR_DEV_REPO/lib/easyccg.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/IllinoisNerExtended-2.8-SNAPSHOT.jar" sourcepath="/AMR_DEV_REPO/lib/IllinoisNerExtended-2.8-SNAPSHOT-sources.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-beanutils-1.7.0.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-beanutils-core-1.8.0.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-cli-1.2.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-codec-1.8.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-collections-3.2.1.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-configuration-1.6.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-digester-1.8.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-io-1.3.2.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-lang-2.3.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-lang3-3.1.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/commons-logging-1.1.3.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/coreUtilities-0.2.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/curator-archive-0.0.2.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/curator-interfaces-0.7.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/curator-utils-0.0.4-SNAPSHOT.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/gurobi-5.0.1.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/hamcrest-core-1.3.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/httpclient-4.1.2.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/httpcore-4.1.3.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/illinois-abstract-server-0.1.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/illinois-common-resources-1.1.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/java-cup-0.11a.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/junit-4.11.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/LBJava-1.0.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/liblinear-1.94.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/libthrift-0.8.0.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/log4j-1.2.14.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/logback-core-1.1.2.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/slf4j-api-1.5.8.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/slf4j-log4j12-1.5.8.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/trove4j-3.0.3.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/nerdep/weka-stable-3.6.10.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/edu.mit.jwi_2.3.0.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/jewelcli-0.7.6.jar"/>
<classpathentry kind="var" path="AMR_DEV_REPO/lib/mtj-1.0-snapshot.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>amr</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,73 @@
/*******************************************************************************
* UW SPF - The University of Washington Semantic Parsing Framework
* <p>
* Copyright (C) 2013 Yoav Artzi
* <p>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or any later version.
* <p>
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* <p>
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
******************************************************************************/
package edu.uw.cs.lil.amr;
import java.io.File;
import java.io.IOException;
import edu.cornell.cs.nlp.spf.mr.lambda.ccg.LogicalExpressionCategoryServices;
import edu.cornell.cs.nlp.utils.log.LogLevel;
import edu.cornell.cs.nlp.utils.log.Logger;
public class TestServices {
private static final LogicalExpressionCategoryServices CATEGORY_SERVICES;
private static final File DEFAULT_TYPES_FILE;
private TestServices() {
// Private ctor. Nothing to init. Service class.
}
static {
LogLevel.DEBUG.set();
Logger.setSkipPrefix(true);
DEFAULT_TYPES_FILE = new File("../resources/amr.types");
try {
Init.init(
DEFAULT_TYPES_FILE,
new File("../resources/amr.specmap"),
new File(
"../resources/stanford-models/english-bidirectional-distsim.tagger"),
false, null, null, null, false);
} catch (final IOException e) {
throw new RuntimeException(e);
}
// //////////////////////////////////////////////////
// Category services for logical expressions.
// //////////////////////////////////////////////////
// CCG LogicalExpression category services for handling categories
// with LogicalExpression as semantics
CATEGORY_SERVICES = new LogicalExpressionCategoryServices(true);
}
public static LogicalExpressionCategoryServices getCategoryServices() {
init();
return CATEGORY_SERVICES;
}
public static void init() {
// Nothing to do.
}
}
Oops, something went wrong.

0 comments on commit 07b581e

Please sign in to comment.