CoreNLP
CoreNLP copied to clipboard
CoreNLP client restarts even after shutting down
Hello,
I am using stanza corenlp to detect NER's in the text by starting a corenlp server using CoreNLPClient .Once the entities are found and I try to shutdown/stop the server using the stop(also tried to shut down using the "with" statement) function on the object created using CoreNLPClient ,I get a message "CoreNLP Server is shutting down.". But corenlp server restarts automatically when I try to use multiprocessing on the rest of the code.
I have kept the starting and stopping of the server in the main function and only when these are executed the multiprocessing code is executed .
Can anyone help me out with an efficient way of stopping the server ?
Can you confirm which versions of both software you are running, then try to put together a minimal example showing the problem? I have never observed this, which is not to say the problem doesn't exist, but rather we have no idea how to approach fixing it.
On Tue, Aug 24, 2021 at 2:26 AM samanthvishwas @.***> wrote:
Hello,
I am using stanza corenlp to detect NER's in the text by starting a corenlp server using CoreNLPClient .Once the entities are found and I try to shutdown/stop the server using the stop(also tried to shut down using the "with" statement) function on the object created using CoreNLPClient ,I get a message "CoreNLP Server is shutting down.". But corenlp server restarts automatically when I try to use multiprocessing on the rest of the code.
I have kept the starting and stopping of the server in the main function and only when these are executed the multiprocessing code is executed .
Can anyone help me out with an efficient way of stopping the server ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stanfordnlp/CoreNLP/issues/1174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2AYWJTEYNPVFTWKP7PJHTT6NQUDANCNFSM5CWNML2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
Hi AngledLuffa.. I am using Stanza version 1.2.3 and Dask(for multiprocessing ) version '2021.02.0'
Snippet of the code: In the main function I am starting a CoreNLP server and stopping it on completion of its code ,later creating a dask dataframe to execute the rest of the code ,but when the Dask code is getting executed ,corenlp servers are restarted again.
if name == 'main': client = CoreNLPClient(be_quiet=False, annotators=['ner'], memory='4G', endpoint='http://localhost:9000') for i in input_text_cols: df[sentence_fields[i]] = df[i].apply(get_all_text_fields_sentences) df["model_results"] = df[allcols].apply(get_all_text_fields_models,axis=1) client.stop() #stop coreNLP server time.sleep(20) ##code for DASK starts### dmaster = dd.from_pandas(df, npartitions=4) dmaster["dict_results"] = dmaster[allcols].apply(get_all_text_fields_dictionaries,axis=1,meta=('x','str')) df_dict=dmaster.compute(scheduler='processes')
I would be very suspicious about the way the multiprocessing is being called. Is it possible that each new process is creating its own CoreNLPClient?
I've literally never used pandas or dask for anything, so I have no idea what's going on behind the scenes. Does this snippet recreate the problem? (Please reply directly on github and remember to use ``` so that we get proper formatting)
On Sun, Aug 29, 2021 at 11:14 PM samanthvishwas @.***> wrote:
Hi AngledLuffa.. I am using Stanza version 1.2.3 and Dask(for multiprocessing ) version '2021.02.0'
Snippet of the code: In the main function I am starting a CoreNLP server and stopping it on completion of its code ,later creating a dask dataframe to execute the rest of the code ,but when the Dask code is getting executed ,corenlp servers are restarted again.
if name == 'main': client = CoreNLPClient(be_quiet=False, annotators=['ner'], memory='4G', endpoint='http://localhost:9000') for i in input_text_cols: df[sentence_fields[i]] = df[i].apply(get_all_text_fields_sentences) df["model_results"] = df[allcols].apply(get_all_text_fields_models,axis=1) client.stop() #stop coreNLP server time.sleep(20) ##code for DASK starts### dmaster = dd.from_pandas(df, npartitions=4) dmaster["dict_results"] = dmaster[allcols].apply(get_all_text_fields_dictionaries,axis=1,meta=('x','str')) df_dict=dmaster.compute(scheduler='processes')
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stanfordnlp/CoreNLP/issues/1174#issuecomment-908061341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2AYWMXZC66MFFC3PU2GETT7MOWBANCNFSM5CWNML2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.