Stanford POS tagger with GATE twitter model is slow

瘦欲@ 提交于 2019-12-12 04:54:01

问题


I am using the Stanford POS tagger with the GATE Twitter model and the tagger takes around 3 seconds to initialize, is this normal or am I loading it incorrectly?

Small sample code:

package tweet.nlp.test;

import edu.stanford.nlp.tagger.maxent.MaxentTagger;

public class TweetNLPTest {

    public static void main(String[] args) {
        String text = "My sister won't tell me where she hid my food. She's fueling my anorexia. #bestsisteraward #not 😭💀";

        MaxentTagger tagger = new MaxentTagger("models/gate-EN-twitter.model");

        String taggedText = tagger.tagString(text);
    }
}

Output:

Reading POS tagger model from models/gate-EN-twitter.model ... warning: no language set, no open-class tags specified, and no closed-class tags specified; assuming ALL tags are open class tags done [3.1 sec].

My_PRP$ sister_NN won't_MD tell_VB me_PRP where_WRB she_PRP hid_VBD my_PRP$ food._NN She's_VBZ fueling_VBG my_PRP$ anorexia._NN #bestsisteraward_HT #not_HT 😭💀_HT BUILD SUCCESSFUL (total time: 3 seconds)


回答1:


For me it looks normal, it takes around 2 or 3 seconds to init. The .tagger is the same as the .model.

You can see it in the sample models provided by the Stanford Tagger :

model = wsj-0-18-bidirectional-nodistsim.tagger


来源:https://stackoverflow.com/questions/26689133/stanford-pos-tagger-with-gate-twitter-model-is-slow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!