CogComp / saul

Saul : Declarative Learning-Based Programming
Other
64 stars 18 forks source link

testing SRL on plain text #486

Open sarschu opened 6 years ago

sarschu commented 6 years ago

Hi, I wondered how I can use the pretrained SRL model on unlabeled text. Is there a specific format I have to convert my test files to?

Cheers Sarah

kordjamshidi commented 6 years ago

Hi Sarah, though this should be easily doable currently this is not supported. However, why don't you use the cogcomp demo http://cogcomp.org/page/demo_view/srl if you want to test a small piece of text?

sarschu commented 6 years ago

Hi, thanks for the link to the demo page. I didn't find a way to export the results from there. Also, in case the SRL works reasonably well for my data, I would like to integrate it into a workflow. Do you have any pointer on how to implement a data reader for plain text files?

kordjamshidi commented 6 years ago

Sarah, below link is the code that is used to read the data. you can read your plain text into List<TextAnnotation>. Each sentence which is simply a string is read into a TextAnnotation object and then this list is formed and passed to the learning models. https://github.com/CogComp/saul/blob/master/saul-examples/src/main/java/edu/illinois/cs/cogcomp/saulexamples/data/SRLDataReader.java