lichengunc / refer-parser2

Referring Expression Parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

refer-parser2

Referring Expression Parser

Introduction

Our parser provides functions of

  • parse sentences in multithread mode using StanfordNLP and SENNA
  • find the head noun word of a sentence
  • find the 7 attribute words as ReferitGame paper
  • chunk sentences
  • write htmls

Requirements

This code is written in python and requires several libraries.

practnlptools
nltk
corenlp
unidecode

We prune the core part of corenlp-python in this repository, whose original git can be downloaded here. Note this (our) corenlp is able to read v3.5.1 and v3.5.2, but not able to load V3.6.0. Also note Stanford NLP group switches to Universal Dependencies standard since v3.5.2. We also use SENNA's python wrapper, practnlptools to chunk each sentence into phrase structures.

How to use

1a) Parse expressions using Stanford Parser:

python parse_sents.py --dataset refcoco --splitBy unc --num_workers 4

1b) Parse expressions using Vicente's R1-R7 attributes:

python parse_atts.py --dataset refcoco --splitBy unc

1c) Visualize decomposed attributes:

python write_att_html.py --dataset refcoco --splitBy unc

2a) Parse expression using SENNA parser:

python senna_sents.py --dataset refcoco --splitBy unc --num_workers 4

2b) Chunk expressions into phrase structures:

python chunk_sents.py --dataset refcoco --splitBy unc

2c) Analyze the phrase structures from the chunking results:

python analyze_chunk.py --dataset refcoco --splitBy unc

2d) Visualize the phrase structures:

python write_chunk_html.py --dataset refcoco --splitBy unc

Download

License

BSD License.

About

Referring Expression Parser


Languages

Language:Python 100.0%