When treat is loaded in my Gemfile, stanford-core-nlp runs substantially slower.
Here's the code that runs quite slow. I don't think it's anything very complex.
text.get(:sentences).each do |sentence|
sentence.get(:tokens).each do |token|
value = token.get(:original_text).to_s
pos = token.get(:part_of_speech).to_s
et = token.get(:named_entity_tag).to_s
ner_list << [et,value]
insert_unique(pos_hash, pos, value)
end
end
I've enclosed a couple of profile trace images that shows the same code before and after loading treat.
Hope this helps and apologies if it's down to my ignorance.
When treat is loaded in my Gemfile, stanford-core-nlp runs substantially slower.
Here's the code that runs quite slow. I don't think it's anything very complex.
I've enclosed a couple of profile trace images that shows the same code before and after loading treat.
Hope this helps and apologies if it's down to my ignorance.
Regards,
Neil
With treat:![before](https://f.cloud.github.com/assets/1284001/658723/bb0b63ea-d608-11e2-807a-f5ff395805c5.gif)
Without treat:![after](https://f.cloud.github.com/assets/1284001/658722/baf5a528-d608-11e2-8609-dcc4363586c4.gif)