louismullie / stanford-core-nlp

Ruby bindings to the Stanford Core NLP tools (English, French, German).
Other
432 stars 70 forks source link

How to circulate among phrases in sentence? #28

Closed yijisoo closed 10 years ago

yijisoo commented 10 years ago

I like the feature of the treat gem that help me traverse all the entities in a single sentence as follows:

s.parse s.each_entity(:phrase).do |e|

do something for each phrase

end

However, I don't want to install the treat gem and all the necessary gems, which may make my web application too heavy. I think that the stanford_nlp_core gem might already have the feature that I want to have.

Can I do it with the stanford_nlp_core gem? Or, should I need to install the treat gem?

yijisoo commented 10 years ago

In stanford_nlp_core gem, sentence.get(:basic_dependencies) shows some dependencies, but I don't know how to pull out all the possible phrases?

louismullie commented 10 years ago

No, this is not possible with stanford-core-nlp alone. Treat does a fair amount of postprocessing to offer this syntactic sugar. However, bear in mind that you shouldn't have to add anything else than stanford-core-nlp to your gem file when using treat in a web app - this should be very lightweight to use. Remember that all treat dependencies are optional by default.

On Aug 4, 2014, at 12:16 AM, Ji Soo Yi notifications@github.com wrote:

In stanford_nlp_core gem, sentence.get(:basic_dependencies) shows some dependencies, but I don't know how to pull out all the possible phrases?

— Reply to this email directly or view it on GitHub.

yijisoo commented 10 years ago

Thanks for your response. I will close this issue.