File size: 2,329 Bytes
c705f71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
====================================================

CoNLL-2014 Shared Task: Grammatical Error Correction

Description of Data Preprocessing Scripts

4 Aug 2014 Version 3.2
====================================================


Table of Contents
=================

  1. General
  2. Pre-requisites
  3. Usage

1. General
==========

This README file describes the usage of scripts for preprocessing the NUCLE version 3.2 corpus.

Quickstart:

  a. Regenerate the preprocessed files with full syntactic information:
     % python preprocess.py -o nucle.sgml conllFileName annFileName m2FileName

  b. Get tokenized annotations without syntactic information:
     % python preprocess.py -l nucle.sgml conllFileName annFileName m2FileName

where
       nucle.sgml  -  input SGML file
    conllFileName  -  output file that contains pre-processed sentences in CoNLL format.
      annFileName  -  output file that contains standoff error annotations.
       m2FileName  -  output file that contains error annotations in the M2 scorer format.

2. Pre-requisites
=================

+ Python (2.6.4, other versions >= 2.6.4, < 3.0 might work but are not tested)
+ nltk (http://www.nltk.org, version 2.0b7, needed for sentence splitting and word tokenization)
+ Stanford parser (version 2.0.1, http://nlp.stanford.edu/software/stanford-parser-2012-03-09.tgz)

If you only use the scripts to generate error annotations needed by the M2 scorer, Stanford parser is not required.
Otherwise, "stanford-parser-2012-03-09" need to be in the same directory as "scripts".

3. Usage
========

Preprocessing the data from single annotation

Usage: python preprocess.py OPTIONS sgmlFileName conllFileName annotationFileName m2FileName

Where
  sgmlFileName       -     NUCLE SGML file
  conllFileName      -     output file name for pre-processed sentences in CoNLL format (e.g., conll14st-preprocessed.conll).
  annotationFileName -     output file name for error annotations (e.g., conll14st-preprocessed.conll.ann).
  m2FileName         -     output file name in the M2 scorer format (e.g., conll14st-preprocessed.conll.m2).

OPTIONS
  -o      -   output will contain POS tags and parse tree info (i.e., the same as the released preprocessed file, runs slowly).
  -l      -   output will NOT contain POS tags and parse tree info (runs quickly).