Setting for using ACE 0. If you are using a 64-bit machine, you can directly use the ready-to-run version of ACE. If you're using a 32-bit machine, you have to compile the source codes on your machine, which requires several 3rd party modules. 1. Download the latest version of ACE from the following website. The latest one on 05-15-2013 is ace-0.9.14-x86-64.tar.gz for 64-bit users. http://sweaglesw.org/linguistics/ace/download/ 2. Untar the downloaded file where you want. $ tar -C PATH_OF_ACE -zxvf ace-0.9.14-x86-64.tar.gz For example, if you want to place the binary file of ACE on a folder named [nlp] under your home directory, $ tar -C ~/nlp -zxvf ace-0.9.14-x86-64.tar.gz 3. You have to edit your ~/.bashrc $ gedit ~/.bashrc At the end of the file, add the following lines, in which PATH_OF_ACE should be the same as what you did in (2). export ACEROOT=PATH_OF_ACE export PATH=$PATH:$ACEROOT 4. After saving ~/.bashrc, log out and in again, or just do the following command. $ source ~/.bashrc 5. Test your setting using the following command. $ which ace $ ace --help Parsing and Generation using ACE 0. If the version of your choices is more than 26, all settings to run ACE are included in your customized grammar. 1. Move into your grammar folder. $ cd PATH_OF_YOUR_GRAMMMAR 2. Compile your grammar. $ ace -G YOUR_ISO_CODE.dat -g ace/config.tdl For instance, if your language is English, $ ace -G eng.dat -g ace/config.tdl If compilation was successful, you can see msgs like the followings. loaded grammar in 1.71242s types: 7.2M rules: 976K lex-info: 2548 miscellaneous: 7864 lex-dgs: 14K miscellaneous: 145K sem-index: 13K stochastic-model: 0 latmap rules: 48 ... freezing 8.9M to file map 0x6000000000 Whenever you edit something in tdl files, you have to compile again. 3. Parse a sentence. $ echo "A SENTENCE" | ace -g YOUR_ISO_CODE.dat -1Tf 2>/dev/null For instance, $ echo "The dog barks" | ace -g eng.dat -1Tf 2>/dev/null SENT: The dog barks [ LTOP: h0 INDEX: e1 [ e SORT: semsort SF: prop-or-ques E.TENSE: present ] RELS: < [ "exist_q_rel"<-1:-1> LBL: h3 ARG0: x2 [ x PNG.NUM: sg SORT: semsort ] RSTR: h4 BODY: h5 ] [ "_dog_n_rel"<-1:-1> LBL: h6 ARG0: x2 ] [ "_bark_v_rel"<-1:-1> LBL: h7 ARG0: e1 ARG1: x2 ] > HCONS: < h4 qeq h6 > ICONS: < e1 info-str x2 e1 info-str e1 > ] -1Tf is a set of options, which you can change. ACE options are provided below. http://moin.delph-in.net/AceOptions For example, if you want to see all MRSs and all parse trees, you can use just -f instead of -1Tf. 4. Generate sentence(s) from the input MRS(s) (paraphrasing). $ echo "A SENTENCE" | ace -g YOUR_ISO_CODE.dat -1Tf 2>/dev/null | ace -g YOUR_ISO_CODE.dat -e 2>/dev/null For instance, $ echo "The dog barks" | ace -g eng.dat -1Tf 2>/dev/null | ace -g eng.dat -e 2>/dev/null The dog barks The dog-b barks The dog-a barks-a The dog-a barks The dog-b barks-a The dog barks-a 5. Batch processing: ACE uses stdin and stdout. $ cat INPUT_FILE_NAME | ace -g YOUR_ISO_CODE.dat -1Tf 2>/dev/null | ace -g YOUR_ISO_CODE.dat -e 1> OUTPUT_FILE_NAME 2>/dev/null 6. Troubleshooting: If you want to see error msgs, do not use 2>/dev/null. If you find a problem in generation, save the input MRS into a file, and edit something suspicious in the intermediate file. In this way, you can find out where the mismatch comes from. $ echo "A SENTENCE" | ace -g YOUR_ISO_CODE.dat -1Tf 1> TEMP_OUTPUT 2>/dev/null $ gedit TEMP_OUTPUT $ cat TEMP_OUTPUT | ace -g eng.dat -e 2>/dev/null Translation with ACE (transfer rules) 1. Create a folder for transfer rules. $ mkdir -p PATH_OF_TRANSFER_FILES 2. Download sample-tm.tar.gz and untar it into PATH_OF_TRANSFER_FILES. 3. The sample transfer rules only convert _dog_n_rel into _cat_n_rel. You can add something into test.mtr / in.vpm / ... 4. Compile the transfer rules. $ ace -G PATH_OF_TRANSFER_FILES/TRANFER_DAT_FILE_NAME.dat -g PATH_OF_TRANSFER_FILES/ace/config.tdl For example, if the path is ~/nlp/tm and your transfer is from English to Italian, $ ace -G ~/nlp/tm/eng-ita.dat -g ~/nlp/tm/ace/config.tdl 5. Parsing, Transfer, and Generation $ cd PATH_OF_SOURCE_GRAMMAR $ ace -G ISO_CODE_OF_SOURCE.dat -g ace/config.tdl $ cd PATH_OF_TARGET_GRAMMAR $ ace -G ISO_CODE_OF_TARGET.dat -g ace/config.tdl $ echo "A SENTENCE" | ace -g PATH_OF_SOURCE_GRAMMAR/ISO_CODE_OF_SOURCE.dat -1Tf 2>/dev/null | ace -g PATH_OF_TRANSFER_FILES/TRANFER_DAT_FILE_NAME.dat 2>/dev/null | ace -g PATH_OF_TARGET_GRAMMAR/ISO_CODE_OF_TARGET.dat -e 2>/dev/null For instance, $ cd ~/ling567/eng $ ace -G eng.dat -g ace/config.tdl $ cd ~/ling567/ita $ ace -G ita.dat -g ace/config.tdl $ ace ~ $ echo "The dog barks" | ace -g ~/ling567/eng/eng.dat -1Tf 2>/dev/null | ace -g ~/ling567/tm/eng-ita/eng-ita.dat 2>/dev/null | ace -g ~/ling567/ita/ita.dat -e 2>/dev/null 6. Troubleshooting: You can use the same technique above, if you see some mismatches in the input MRS and/or the output MRS.