Uploaded image for project: 'cTAKES'
  1. cTAKES
  2. CTAKES-143

dictionary lookup iterates inefficiently

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      I noticed quadratic performance on large notes (in length of file) mainly due to dictionary annotator. Inside DictionaryLookupAnnotator, it iterates over "Lookup windows." Inside this iteration, it calls getLookupTokenIterator() in the LookupInitializer. As implemented in FirstTokenPermLookupInitializerImpl, this method will create a iterator over all BaseTokens, pruning out certain subtypes. This is then passed back to the DictionaryLookupAnnotator, which will only then constrain the list to those tokens which overlap the lookup window. This iterating over every token in the document for each lookup window is extremely inefficient. This could be fixed by, e.g., doing the constraining first and then doing the pruning by sub-types.

      Attachments

        1. dict_fix.svg
          107 kB
          Tim Miller
        2. dict.diff
          3 kB
          Tim Miller
        3. dict2.diff
          6 kB
          Tim Miller

        Activity

          People

            Unassigned Unassigned
            tmill Tim Miller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: