dmis-lab / BERN2

BERN2: an advanced neural biomedical namedentity recognition and normalization tool
http://bern2.korea.ac.kr
BSD 2-Clause "Simplified" License
175 stars 42 forks source link

Syntax Error in server.py Causes BERN2 Local Installation to Not Work #34

Closed compbiolover closed 2 years ago

compbiolover commented 2 years ago

Hi @minstar & @mjeensung , I have attempted to install BERN2 locally, but I get the following error when I launch it:

Traceback (most recent call last):
  File "server.py", line 1, in <module>
    from app import create_app
  File "/Users/[myuser]/BERN2/app/__init__.py", line 129
    return render_template('result_text.html', result_items=res_items, latency = f'{latency*1000:9.2f}', result_str=json.dumps(result_dict, sort_keys=True, indent=4))

I have also seen that this error appears to keep server.py from running as it is not running when I run bash stop_bern2.sh. I get the following output

No ner_server.py found to stop.
Stopped GNormPlusServer.main.jar
Stopped tmVar2Server.main.jar
Stopped disease_normalizer_21.jar
Stopped gnormplus-normalization_21.jar
No server.py found to stop.

Finally, I still tried to submit the plain text and PMID examples listed under the local instillation instructions and I simply get no output even after waiting for several minutes. My thought process leads me to believe that the error in server.py is causing BERN2 to simply terminate and hence no outputs from the tutorial text and PMIDS.

Thanks for your help! Let me know if I can help with any additional files or insight.

Andrew

mjeensung commented 2 years ago

Hi @compbiolover

Yes, it doesn't seem that ner_server.py started correctly. Could you check the log of ner_server.py? It is written on logs/nohup_multi_ner.out.

compbiolover commented 2 years ago

Sure @mjeensung, logs/nohup_multi_ner.out has the following error message:


    f'{dict_path[2:]}.PubTator')
                              ^
SyntaxError: invalid syntax
  File "multi_ner/ner_server.py", line 23
    f'{dict_path[2:]}.PubTator')
                              ^
SyntaxError: invalid syntax
mjeensung commented 2 years ago

Thanks @compbiolover

What's the Python version you are using? BERN2 runs well on Python 3.7 and it may cause unexpected problems on different versions of Python.

compbiolover commented 2 years ago

No problem @mjeensung, I am using Python 3.7.13 when I do condo list inside my BERN2 miniconda environment. I can try re-installing BERN2 with Python 3.7 and see if that fixes the issue

mjeensung commented 2 years ago

If you still have a problem, please feel free to open a new issue. Thank you.