props icon indicating copy to clipboard operation
props copied to clipboard

Refactor to support other parsers

Open saraswat opened this issue 8 years ago • 5 comments

The Stanford parser, like other parsers, makes errors. e.g.

Although the UK has long had an ambivalent attitude towards Europe, the hostility of the UK Independence Party towards the EU is mirrored by other European "insurgent" parties, such as the Freedom Party in the Netherlands and Front national (FN) in France.

( (S (SBAR (IN Although)
	   (S (NP (DT the) (NNP UK))
	      (VP (VBZ has) (ADVP (RB long))
		  (VP (VBN had) (NP (DT an) (JJ ambivalent) (NN attitude))
		      (PP (IN towards) (NP (NNP Europe)))))))
     (, ,) (NP (NP (DT the) (NN hostility))
	       (PP (IN of) (NP (NP (DT the) (NNP UK) (NNP Independence)
				   (NNP Party))
			       (PP (IN towards) (NP (DT the) (NNP EU))))))
     (VP (VBZ is) (VP (VBN mirrored)
		      (PP (IN by)
			  (NP (NP (NP (JJ other) (JJ European) (`` ``)
				      (NN insurgent) ('' '') (NNS parties))
				  (, ,) (PP (JJ such) (IN as)
					    (NP (NP (DT the) (NNP Freedom) (NNP Party))
						(PP (IN in) (NP (NP (DT the) (NNPS Netherlands))
								(CC and) (NP (NNP Front) (JJ national))))))
				  (PRN (-LRB- -LRB-) (NP (NNP FN)) (-RRB- -RRB-)))
			      (PP (IN in) (NP (NNP France)))))))
     (. .))
  )

(Incorrect scope for (PP (IN in)....) For downstream applications it would be much easier if parsers can be added in a plug and play fashion (maybe even multiple of them).

So refactoring to make propS be "just" a converter from an input dependency graph to its output form would be nice.

saraswat avatar Jun 23 '17 13:06 saraswat

Hey @saraswat, thanks for the issues you're raising!

Decoupling PropS from the Stanford parser (and from any other syntactic parser, for that matter) is definitely on my to-do list, I hope to get to this soon. I'll keep you updated!

gabrielStanovsky avatar Jun 26 '17 06:06 gabrielStanovsky

UDepLambda (a project with similar goals to this project) handles this by running a pipeline at the shell level and piping JSON files through. Simple and convenient. Adding another parser is simply changing some lines in a shell file.

https://github.com/sivareddyg/UDepLambda

saraswat avatar Jul 06 '17 15:07 saraswat

Any thoughts on this? A more narrow and urgent task is just to get props running with the Stanford parser -- other collaborators who are keen to work on this are having trouble with the Java/Python interface. My thought is to just focus on using the UDepLambda pipeline. The Stanford parser already works with this pipeline, so its just a question of getting props to accept the stanford parser input from a json file piped into it.

saraswat avatar Sep 14 '17 21:09 saraswat

Hi @saraswat, this sounds feasible and worthwhile to me. I'll work on that in the next few days, and open a pull request when I'm ready so you can review the new usage.

Thanks!

gabrielStanovsky avatar Sep 15 '17 09:09 gabrielStanovsky

@saraswat, addressed in #17, please let me know if this looks good, and I'll merge. Thanks!

gabrielStanovsky avatar Sep 18 '17 09:09 gabrielStanovsky