How to use senna to denote a semantic role.?

I need to compare the similarity of two sentences based on its semantic roles. I found that senna is good for the SRl problem. I did chunking using senna based on [this code] ( http://pydoc.net/Python/nltk/2.0.2/nltk.tag.senna/ ).

But can't use it for SRL. Can anyone please help?

thank

+3


source to share


1 answer


I tried to use these packages to run SRL using senna. finally developed

Download senna from https://ronan.collobert.com/senna/download.html

if you are using windows then:

python launches .exe application with argument



use senna-win32.exe directly

import subprocess
myinput = open('in.txt')
myoutput = open('out.txt', 'w')
p = subprocess.Popen('senna-win32.exe', stdin=myinput, stdout=myoutput)
p.wait()
myoutput.flush()

      

Now parse out.txt to get the results.

If you find a better approach please let me know :)

0


source







All Articles