0

We have successfully installed syntaxnet and we are able to get the parsed output by calling the command echo 'open Book, which I have written with laboratory writer, with libreoffice writer.' | syntaxnet/demo.sh.

Ideally what we want is calling syntaxnet from python file (more specifically from flask) and expose syntaxnet service as api for internal team.

Selva Saravana Er
  • 199
  • 1
  • 1
  • 6
  • Here's an answer on [how to call a shell script from python](http://stackoverflow.com/questions/3777301/how-to-call-a-shell-script-from-python-code) – Shan Carter Jul 22 '16 at 17:24

2 Answers2

0

Apperently it is exactly like the example I have used in my answer. using subprocess module can help you to do call this command in your python file and see the result. I have explained how to use this module in my answer

Community
  • 1
  • 1
Nazanin Tajik
  • 412
  • 2
  • 15
0

Yes, You can call syntaxnet from python. You can use subprocess module or simply os.system command.

os.system('syntaxnet/demo.sh')

or

subprocess.call('syntaxnet/demo.sh')

Both works for me. Make sure to give the full path of demo.sh file.

Kurt Van den Branden
  • 11,995
  • 10
  • 76
  • 85
H414
  • 71
  • 8