How to use senna for semantic role labelling.?

1.5k Views Asked by At

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

But not able to use it for SRL. Can anyone please help?

Thanks

1

There are 1 best solutions below

0
On

Edited: https://github.com/saurabhzuve/practNLPTools this package works just fine in Python

Old: I tried using these packages to run SRL using senna. finally the following worked out

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

if you are using windows then:

python run .exe app 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 your results.

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