RE: negation/uncertainty: pipeline runs very slowly [EXTERNAL]
Hi Dima, Have you had a chance to play with the proposed solutions? If not then let us know and somebody will eventually get to it. Meanwhile, would you mind submitting a tar on jira? Thanks, Sean -Original Message- From: Dligach, Dmitriy [mailto:ddlig...@luc.edu] Sent: Wednesday, June 21, 2017 3:18 PM To: dev@ctakes.apache.org Cc: Miller, Timothy Subject: Re: negation/uncertainty: pipeline runs very slowly [EXTERNAL] Sean, thanks for your comments. You are right. The slowdown doesn’t have anything to do with documentID. I am now convinced that the slowdown has to do with the Polarity annotator. The reason you and others haven’t seen this in other pipelines is that you’ve probably been processing relatively small files. I am processing MIMIC patient files, which typically have thousands of words. I just tried to process 300 files from the THYME corpus (where the files have hundreds of words) and the slowdown was barely noticeable. When running the same pipeline on the MIMIC files, the slowdown becomes very noticeable. Dima > On Jun 5, 2017, at 10:42, Finan, Sean > wrote: > > Hi Dima, > > It looks like the UriCollectionReader that you are using never sets a > document id (type DocumentID) in the cas. However, this shouldn't be a > problem as each document will be assigned a unique id "UnknownDocument"{###} > where {###} is a number incremented per new document with an unknown id. The > message that you are seeing is just a warning. The code fetching the > documentID and creating a default are very simple and should not take any > real processing time. > > The call to get document id is the very first line in > AssertionCleartkAnalysisEngine: > @Override > public void process(JCas jCas) throws AnalysisEngineProcessException > { >String documentId = DocumentIDAnnotationUtil.getDocumentID(jCas); > > So, the slowdown occurring after the warning message leads me to believe that > the problem lies later in the process ... > > My suggestion is that you put a breakpoint there and run your pipeline > through a debugger. Optionally, there are a couple of log.debug messages in > that class, so you could change the granularity of your log4j and see if you > can narrow down the problem. Add more debug statements if it helps. > > At any rate, I have not seen this problem in other pipelines. > > Sean > > -Original Message- > From: Dligach, Dmitriy [mailto:ddlig...@luc.edu] > Sent: Wednesday, May 24, 2017 10:34 AM > To: cTAKES Developer list > Subject: negation/uncertainty: pipeline runs very slowly > > Dear cTAKES developers, > > I am observing something strange. As soon as I add at the end of my pipeline > the uncertainty/negation AEs: > > aggregateBuilder.add( > PolarityCleartkAnalysisEngine.createAnnotatorDescription() ); > aggregateBuilder.add( > UncertaintyCleartkAnalysisEngine.createAnnotatorDescription() ); > > the pipeline becomes 10-20 times slower. I just confirmed this again. As soon > as I remove these two AEs at the end of my pipeline, it runs very fast again. > > It seems to get stuck often right after it outputs this warning: > WARN DocumentIDAnnotationUtil - Unable to find DocumentIDAnnotation > > If I remove the two AEs, this warning disappears. > > The full pipeline is here: > https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dmitri > ydligach_ctakes-2Dmisc_blob_master_src_main_java_org_apache_ctakes_pip > elines_UmlsLookupPipeline.java&d=DwIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14 > JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=cQRgT9 > lMipJUOQCu86lnRETbYFVC0C5yfMl2r5u0lNs&s=fnshTyx1ruwH-8ktFPX4JeX-7PVWpl > biPO2RYdGSI9E&e= > > Any clues? > > Thank you very much, > > Dima > > >
Re: negation/uncertainty: pipeline runs very slowly [EXTERNAL]
Hi Sean, First of all, thank you Sean, Steve, and Tim for giving this a thought. I definitely agree that the problem lies in this line: List sents = new ArrayList<>(JCasUtil.selectCovering(jCas, Sentence.class, entityOrEventMention.getBegin(), entityOrEventMention.getEnd())); The negation AE runs fine on shorter documents but as soon as I try to run it on large documents, which have LOTS of sentences, it becomes extremely slow. I am sorry I haven’t been able to try the proposed solutions. I may have a little time after the long weekend. In the meantime, I created a JIRA issue: https://issues.apache.org/jira/browse/CTAKES-449 Thanks again for your help. Dima > On Jun 30, 2017, at 07:26, Finan, Sean > wrote: > > Hi Dima, > Have you had a chance to play with the proposed solutions? If not then let > us know and somebody will eventually get to it. > Meanwhile, would you mind submitting a tar on jira? > Thanks, > Sean > > -Original Message- > From: Dligach, Dmitriy [mailto:ddlig...@luc.edu] > Sent: Wednesday, June 21, 2017 3:18 PM > To: dev@ctakes.apache.org > Cc: Miller, Timothy > Subject: Re: negation/uncertainty: pipeline runs very slowly [EXTERNAL] > > Sean, thanks for your comments. You are right. The slowdown doesn’t have > anything to do with documentID. > > I am now convinced that the slowdown has to do with the Polarity annotator. > The reason you and others haven’t seen this in other pipelines is that you’ve > probably been processing relatively small files. > > I am processing MIMIC patient files, which typically have thousands of words. > I just tried to process 300 files from the THYME corpus (where the files have > hundreds of words) and the slowdown was barely noticeable. When running the > same pipeline on the MIMIC files, the slowdown becomes very noticeable. > > > Dima > > > >> On Jun 5, 2017, at 10:42, Finan, Sean >> wrote: >> >> Hi Dima, >> >> It looks like the UriCollectionReader that you are using never sets a >> document id (type DocumentID) in the cas. However, this shouldn't be a >> problem as each document will be assigned a unique id "UnknownDocument"{###} >> where {###} is a number incremented per new document with an unknown id. >> The message that you are seeing is just a warning. The code fetching the >> documentID and creating a default are very simple and should not take any >> real processing time. >> >> The call to get document id is the very first line in >> AssertionCleartkAnalysisEngine: >> @Override >> public void process(JCas jCas) throws AnalysisEngineProcessException >> { >> String documentId = DocumentIDAnnotationUtil.getDocumentID(jCas); >> >> So, the slowdown occurring after the warning message leads me to believe >> that the problem lies later in the process ... >> >> My suggestion is that you put a breakpoint there and run your pipeline >> through a debugger. Optionally, there are a couple of log.debug messages in >> that class, so you could change the granularity of your log4j and see if you >> can narrow down the problem. Add more debug statements if it helps. >> >> At any rate, I have not seen this problem in other pipelines. >> >> Sean >> >> -Original Message- >> From: Dligach, Dmitriy [mailto:ddlig...@luc.edu] >> Sent: Wednesday, May 24, 2017 10:34 AM >> To: cTAKES Developer list >> Subject: negation/uncertainty: pipeline runs very slowly >> >> Dear cTAKES developers, >> >> I am observing something strange. As soon as I add at the end of my pipeline >> the uncertainty/negation AEs: >> >> aggregateBuilder.add( >> PolarityCleartkAnalysisEngine.createAnnotatorDescription() ); >> aggregateBuilder.add( >> UncertaintyCleartkAnalysisEngine.createAnnotatorDescription() ); >> >> the pipeline becomes 10-20 times slower. I just confirmed this again. As >> soon as I remove these two AEs at the end of my pipeline, it runs very fast >> again. >> >> It seems to get stuck often right after it outputs this warning: >> WARN DocumentIDAnnotationUtil - Unable to find DocumentIDAnnotation >> >> If I remove the two AEs, this warning disappears. >> >> The full pipeline is here: >> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dmitri >> ydligach_ctakes-2Dmisc_blob_master_src_main_java_org_apache_ctakes_pip >> elines_UmlsLookupPipeline.java&d=DwIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14 >> JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=cQRgT9 >> lMipJUOQCu86lnRETbYFVC0C5yfMl2r5u0lNs&s=fnshTyx1ruwH-8ktFPX4JeX-7PVWpl >> biPO2RYdGSI9E&e= >> >> Any clues? >> >> Thank you very much, >> >> Dima >> >> >> >
Re: negation/uncertainty: pipeline runs very slowly [EXTERNAL]
Hi Tim, Good point, but I happen to be using the ctakes-core sentence detector. Dima > On Jun 23, 2017, at 06:31, Miller, Timothy > wrote: > > Something I just thought of is that if you are using the new (beta) sentence > detector trained on Mimic, it is a bit of a "lumper" rather than a > "splitter," meaning it is more likely to miss a sentence break and make > longer sentences, sometimes absurdly long if there are no clear cues. I know > that will slow down the constituency parser and dependency parser, but not > sure why it would only slow down when negation processing is added. So, not a > solution but something to keep in mind while debugging, especially if it > interacts with Steve and Sean's feedback. > Tim > > > > From: Dligach, Dmitriy > Sent: Wednesday, June 21, 2017 9:18 PM > To: dev@ctakes.apache.org > Cc: Miller, Timothy > Subject: Re: negation/uncertainty: pipeline runs very slowly [EXTERNAL] > > Sean, thanks for your comments. You are right. The slowdown doesn’t have > anything to do with documentID. > > I am now convinced that the slowdown has to do with the Polarity annotator. > The reason you and others haven’t seen this in other pipelines is that you’ve > probably been processing relatively small files. > > I am processing MIMIC patient files, which typically have thousands of words. > I just tried to process 300 files from the THYME corpus (where the files have > hundreds of words) and the slowdown was barely noticeable. When running the > same pipeline on the MIMIC files, the slowdown becomes very noticeable. > > > Dima > > > >> On Jun 5, 2017, at 10:42, Finan, Sean >> wrote: >> >> Hi Dima, >> >> It looks like the UriCollectionReader that you are using never sets a >> document id (type DocumentID) in the cas. However, this shouldn't be a >> problem as each document will be assigned a unique id "UnknownDocument"{###} >> where {###} is a number incremented per new document with an unknown id. >> The message that you are seeing is just a warning. The code fetching the >> documentID and creating a default are very simple and should not take any >> real processing time. >> >> The call to get document id is the very first line in >> AssertionCleartkAnalysisEngine: >> @Override >> public void process(JCas jCas) throws AnalysisEngineProcessException >> { >> String documentId = DocumentIDAnnotationUtil.getDocumentID(jCas); >> >> So, the slowdown occurring after the warning message leads me to believe >> that the problem lies later in the process ... >> >> My suggestion is that you put a breakpoint there and run your pipeline >> through a debugger. Optionally, there are a couple of log.debug messages in >> that class, so you could change the granularity of your log4j and see if you >> can narrow down the problem. Add more debug statements if it helps. >> >> At any rate, I have not seen this problem in other pipelines. >> >> Sean >> >> -Original Message- >> From: Dligach, Dmitriy [mailto:ddlig...@luc.edu] >> Sent: Wednesday, May 24, 2017 10:34 AM >> To: cTAKES Developer list >> Subject: negation/uncertainty: pipeline runs very slowly >> >> Dear cTAKES developers, >> >> I am observing something strange. As soon as I add at the end of my pipeline >> the uncertainty/negation AEs: >> >> aggregateBuilder.add( >> PolarityCleartkAnalysisEngine.createAnnotatorDescription() ); >> aggregateBuilder.add( >> UncertaintyCleartkAnalysisEngine.createAnnotatorDescription() ); >> >> the pipeline becomes 10-20 times slower. I just confirmed this again. As >> soon as I remove these two AEs at the end of my pipeline, it runs very fast >> again. >> >> It seems to get stuck often right after it outputs this warning: >> WARN DocumentIDAnnotationUtil - Unable to find DocumentIDAnnotation >> >> If I remove the two AEs, this warning disappears. >> >> The full pipeline is here: >> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dmitriydligach_ctakes-2Dmisc_blob_master_src_main_java_org_apache_ctakes_pipelines_UmlsLookupPipeline.java&d=DwIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=cQRgT9lMipJUOQCu86lnRETbYFVC0C5yfMl2r5u0lNs&s=fnshTyx1ruwH-8ktFPX4JeX-7PVWplbiPO2RYdGSI9E&e= >> >> Any clues? >> >> Thank you very much, >> >> Dima >> >> >> >
Inquiry about using cTakes with sql
Good morning, I am attempting to use cTakes for some NLP analysis on a corpus of clinical nursing progress notes. Currently I am only looking to use the core NLP pipeline. My data is in a MySQL database, do you have any documentation on using cTakes with MySQL or similar databases? Thank you Best, Raga [cid:image001.jpg@01D2F191.949684D0]
RE: negation/uncertainty: pipeline runs very slowly [EXTERNAL]
Hey Tim, I have recently been testing with the "smoker" notes in ctakes-examples-res, and using your new sentence detector (Lumpy) has definitely been the way to go for those notes. They have the random cr/lf within sentences. It is great that we have some example notes in ctakes that can show off your work. Cheers, Sean -Original Message- From: Dligach, Dmitriy [mailto:ddlig...@luc.edu] Sent: Friday, June 30, 2017 11:03 AM To: dev@ctakes.apache.org Subject: Re: negation/uncertainty: pipeline runs very slowly [EXTERNAL] Hi Tim, Good point, but I happen to be using the ctakes-core sentence detector. Dima > On Jun 23, 2017, at 06:31, Miller, Timothy > wrote: > > Something I just thought of is that if you are using the new (beta) sentence > detector trained on Mimic, it is a bit of a "lumper" rather than a > "splitter," meaning it is more likely to miss a sentence break and make > longer sentences, sometimes absurdly long if there are no clear cues. I know > that will slow down the constituency parser and dependency parser, but not > sure why it would only slow down when negation processing is added. So, not a > solution but something to keep in mind while debugging, especially if it > interacts with Steve and Sean's feedback. > Tim > > > > From: Dligach, Dmitriy > Sent: Wednesday, June 21, 2017 9:18 PM > To: dev@ctakes.apache.org > Cc: Miller, Timothy > Subject: Re: negation/uncertainty: pipeline runs very slowly > [EXTERNAL] > > Sean, thanks for your comments. You are right. The slowdown doesn't have > anything to do with documentID. > > I am now convinced that the slowdown has to do with the Polarity annotator. > The reason you and others haven't seen this in other pipelines is that you've > probably been processing relatively small files. > > I am processing MIMIC patient files, which typically have thousands of words. > I just tried to process 300 files from the THYME corpus (where the files have > hundreds of words) and the slowdown was barely noticeable. When running the > same pipeline on the MIMIC files, the slowdown becomes very noticeable. > > > Dima > > > >> On Jun 5, 2017, at 10:42, Finan, Sean >> wrote: >> >> Hi Dima, >> >> It looks like the UriCollectionReader that you are using never sets a >> document id (type DocumentID) in the cas. However, this shouldn't be a >> problem as each document will be assigned a unique id "UnknownDocument"{###} >> where {###} is a number incremented per new document with an unknown id. >> The message that you are seeing is just a warning. The code fetching the >> documentID and creating a default are very simple and should not take any >> real processing time. >> >> The call to get document id is the very first line in >> AssertionCleartkAnalysisEngine: >> @Override >> public void process(JCas jCas) throws AnalysisEngineProcessException >> { >> String documentId = DocumentIDAnnotationUtil.getDocumentID(jCas); >> >> So, the slowdown occurring after the warning message leads me to believe >> that the problem lies later in the process ... >> >> My suggestion is that you put a breakpoint there and run your pipeline >> through a debugger. Optionally, there are a couple of log.debug messages in >> that class, so you could change the granularity of your log4j and see if you >> can narrow down the problem. Add more debug statements if it helps. >> >> At any rate, I have not seen this problem in other pipelines. >> >> Sean >> >> -Original Message- >> From: Dligach, Dmitriy [mailto:ddlig...@luc.edu] >> Sent: Wednesday, May 24, 2017 10:34 AM >> To: cTAKES Developer list >> Subject: negation/uncertainty: pipeline runs very slowly >> >> Dear cTAKES developers, >> >> I am observing something strange. As soon as I add at the end of my pipeline >> the uncertainty/negation AEs: >> >> aggregateBuilder.add( >> PolarityCleartkAnalysisEngine.createAnnotatorDescription() ); >> aggregateBuilder.add( >> UncertaintyCleartkAnalysisEngine.createAnnotatorDescription() ); >> >> the pipeline becomes 10-20 times slower. I just confirmed this again. As >> soon as I remove these two AEs at the end of my pipeline, it runs very fast >> again. >> >> It seems to get stuck often right after it outputs this warning: >> WARN DocumentIDAnnotationUtil - Unable to find DocumentIDAnnotation >> >> If I remove the two AEs, this warning disappears. >> >> The full pipeline is here: >> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dmitr >> iydligach_ctakes-2Dmisc_blob_master_src_main_java_org_apache_ctakes_p >> ipelines_UmlsLookupPipeline.java&d=DwIFAg&c=qS4goWBT7poplM69zy_3xhKwE >> W14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=cQ >> RgT9lMipJUOQCu86lnRETbYFVC0C5yfMl2r5u0lNs&s=fnshTyx1ruwH-8ktFPX4JeX-7 >> PVWplbiPO2RYdGSI9E&e= >> >> Any clues? >> >> Thank you very much, >> >> Dima >> >> >> >
RE: Inquiry about using cTakes with sql [EXTERNAL]
Hi Raga, The topic of grabbing data from a db has come up several times within the last six months or so. There are some classes in ctakes-core cr/ that deal with databases, but they are not documented and do require configuration for site-specific schema. Is anybody out there familiar with them enough to write up a wiki page? Thanks, Sean From: Bjarnadottir,Ragnhildur I [mailto:r...@ufl.edu] Sent: Friday, June 30, 2017 11:11 AM To: dev@ctakes.apache.org Subject: Inquiry about using cTakes with sql [EXTERNAL] Good morning, I am attempting to use cTakes for some NLP analysis on a corpus of clinical nursing progress notes. Currently I am only looking to use the core NLP pipeline. My data is in a MySQL database, do you have any documentation on using cTakes with MySQL or similar databases? Thank you Best, Raga [cid:image002.jpg@01D2F1AE.27609410]
Re: Building a Custom cTAKES Dictionary [EXTERNAL]
Hi Sean, It took a while to figure out how to setup everything and run tests, but I have now successfully generated CUI files containing the terms that were missing before. Thanks for your help. Andrew *Andrew Phillips* GitHub: github.com/skeledrew LinkedIn: www.linkedin.com/in/aphillipstech On 28 June 2017 at 19:31, Finan, Sean wrote: > Hi Andrew, > > You will need to download the umls data from the nlm. Go to their website > https://www.nlm.nih.gov/research/umls/ > and use the "Downloads" button in the "Access" panel. > > I will put some more instructions on the wiki page when I get a chance. > > After you download and build a local copy of the umls, run the gui. In > your ctakes resources/ directory, go to > org/apache/ctakes/dictionary/lookup/fast/ > and you will see an xml file and a directory named after your custom > dictionary. Copy those to the headless server in that ctakes' > resources/org/apache/../fast/ directory. > > See the (info) panel at the bottom of https://cwiki.apache.org/ > confluence/display/CTAKES/Dictionary+Creator+GUI > To see how to point ctakes to your custom gui. > > By the way, if you have a small number of terms and don't need the umls > you can manually create a bar separated value (bsv) file. I am guessing > that you have more than a few terms. > > Sean > > -Original Message- > From: Andrew Phillips [mailto:skeled...@gmail.com] > Sent: Wednesday, June 28, 2017 6:28 PM > To: dev@ctakes.apache.org > Subject: Re: Building a Custom cTAKES Dictionary [EXTERNAL] > > Hi Sean, > > I haven't found a good way to launch GUIs remotely (BTW I'm also using > Linux on my machine). However I also have a local cTAKES install and I'm > trying to do the modification there. However I'm not sure what to enter > into the UMLS installation field, as I cannot find a META directory or RRF > files. Also what file(s) woud I transfer to the server once I have built > the new dictionary? > > Thanks, > Andrew > > *Andrew Phillips* > Computer Technician / Programmer and Mobile Experience Consultant > Phone: (678) 753-5313 > Email: skeled...@gmail.com > LinkedIn: www.linkedin.com/in/aphillipstech > > "A man may imagine things that are false, but he can only understand > things that are true, for if the things be false, the apprehension of them > is not understanding." - Isaac Newton > > On 28 June 2017 at 12:35, Finan, Sean > wrote: > > > Hi Andrew, > > > > Can you xWin (or other) to the server to launch gui applications? > > If so, try the dictionary creator gui: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_ > > &d=DwIBaQ&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstT > > pyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=375tbajCm8PjEi_45ahKX7bDghJ_w3fOBIh9 > > vAMpylU&s=0JwVENy0eLeCkfQVSfkUBwhF_xAzBzXGYCWVX9_e65U&e= > > confluence/display/CTAKES/Dictionary+Creator+GUI > > > > > > Sean > > > > -Original Message- > > From: Andrew Phillips [mailto:aphilli...@luc.edu] > > Sent: Wednesday, June 28, 2017 1:14 PM > > To: dev@ctakes.apache.org > > Subject: Building a Custom cTAKES Dictionary [EXTERNAL] > > > > Hello, > > > > I am new to cTAKES and I'm trying to create a custom dictionary of > > additional terms related to alcohol. How can I go about adding > > semantic types such as food (T168), etc that aren't available by > > default to the dictionary? The cTAKES install is located on a headless > > Linux server that I access via SSH. > > > > Thank you, > > Andrew > > > > *Andrew Phillips* > > GitHub: github.com/skeledrew > > LinkedIn: www.linkedin.com/in/aphillipstech > > >