Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format and extend README #9

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Format and extend README
- Format README to make it more readable
- Add some explanations to usage scenarios to make it easier for new
users to get started
  • Loading branch information
weibeld committed Nov 24, 2017
commit 58c3bf74717ed69ec89966e0d34fd754a44bb3ad
74 changes: 64 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,76 @@ easyccg

EasyCCG is a CCG parser created by Mike Lewis.

If you use EasyCCG in your research, please cite the following paper: A* CCG Parsing with a Supertag-factored Model, Mike Lewis and Mark Steedman, EMNLP 2014
If you use EasyCCG in your research, please cite the following paper:

Pre-trained models are available from: https://drive.google.com/#folders/0B7AY6PGZ8lc-NGVOcUFXNU5VWXc
To train new models, follow the instructions in training/README
> _A* CCG Parsing with a Supertag-factored Model_, Mike Lewis and Mark Steedman, EMNLP 2014.

Basic usage:
java -jar easyccg.jar --model model
## Models

Pre-trained models are available from [here](https://drive.google.com/#folders/0B7AY6PGZ8lc-NGVOcUFXNU5VWXc). Unpack the `.tar.gz` file after downloading.

To train new models, follow the instructions in [training/README](training/README).

## Usage

### Basic Usage

~~~bash
java -jar easyccg.jar --model model
~~~

**Notes:**

- The `--model` option is mandatory
- You can use the short form `-m` instead of `--model`
- The value for `--model` must be the directory of a model downloaded and unpacked in [Models](#models)
- After the model has been loaded, you can enter sentences in standard input
- When you're finished, hit *Ctrl-D*

### File Input

Read sentences from a file rather than from standard input.

~~~bash
java -jar easyccg.jar -m model -f input
~~~

**Notes:**

- The value for the `-f` option must be a text file with sentences separated by newlines
- The long form of `-f` is `--inputFile`


### Help

List all command line options.

~~~bash
java -jar easyccg.jar --help
~~~

### Advanced Usage

For N-best parsing:
java -jar easyccg.jar --model model --nbest 10

~~~bash
java -jar easyccg.jar --model model --nbest 10
~~~

To parse questions, use:
java -jar easyccg.jar --model model_questions -s -r S[q] S[qem] S[wq]

If you want POS/NER tags in the output, you'll need to supply them in the input, using the format word|POS|NER. To get this format from the C&C tools, use the following:
echo "parse me" | candc/bin/pos --model candc_models/pos | candc/bin/ner -model candc_models/ner -ofmt "%w|%p|%n \n" | java -jar easyccg.jar -model model_questions -i POSandNERtagged -o extended
~~~bash
java -jar easyccg.jar --model model_questions -s -r S[q] S[qem] S[wq]
~~~

If you want POS/NER tags in the output, you'll need to supply them in the input, using the format `word|POS|NER`. To get this format from the C&C tools, use the following:

~~~bash
echo "parse me" | candc/bin/pos --model candc_models/pos | candc/bin/ner -model candc_models/ner -ofmt "%w|%p|%n \n" | java -jar easyccg.jar --model model_questions -i POSandNERtagged -o extended
~~~

To get Boxer-compatible Prolog output, use:
echo "parse me" | candc/bin/pos --model candc_models/pos | candc/bin/ner -model candc_models/ner -ofmt "%w|%p|%n \n" | java -jar easyccg.jar -model model -i POSandNERtagged -o prolog -r S[dcl]

~~~bash
echo "parse me" | candc/bin/pos --model candc_models/pos | candc/bin/ner -model candc_models/ner -ofmt "%w|%p|%n \n" | java -jar easyccg.jar --model model -i POSandNERtagged -o prolog -r S[dcl]
~~~