Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging text is slow #25

Closed
rockt opened this issue Mar 6, 2013 · 1 comment
Closed

Tagging text is slow #25

rockt opened this issue Mar 6, 2013 · 1 comment
Assignees

Comments

@rockt
Copy link
Owner

rockt commented Mar 6, 2013

934a481

    public List<Mention> tag(String text) throws UIMAException {
        JCas jcas = JCasFactory.createJCas(typeSystem);
        jcas.setDocumentText(text);
        PubmedDocument pd = new PubmedDocument(jcas);
        pd.setBegin(0);
        pd.setEnd(text.length());
        pd.setPmid("");
        pd.addToIndexes(jcas);
        return tag(jcas);
    }

This is slow since a jcas is initialized each time we want to tag a string. Instead, hold back one pre-intitialized jcas and reset it each time this method gets called.

@ghost ghost assigned thuber Mar 6, 2013
@thuber
Copy link
Collaborator

thuber commented Mar 6, 2013

Not quite that easy if we want to allow threading for this method (which seems sensible to me). Several threads cannot work on the same JCas, so we must either make it thread-safe or synchronized and thereby preventing any multithreading.

@thuber thuber closed this as completed May 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants