lavis-nlp / spert

PyTorch code for SpERT: Span-based Entity and Relation Transformer
MIT License
692 stars 147 forks source link

SPERT in Inference mode + preprocessing code #19

Closed isaacmg closed 4 years ago

isaacmg commented 4 years ago

Hi. Thanks for the paper and code. I had a couple questions: Is there a simple way to do inference on a single sentence or a list of sentences? I looked over the evaluator code but it seems to only read in a full dataset at a time. Also do you have any advice on refactoring the model for realtime inference on sentences?

My second question is it seems that you already preprocessed that datasets. Do you have the code you used to originally put them in that format? I might have missed it but I didn't seem to see it your repository.

Thanks again.

markus-eberts commented 4 years ago

Hi, first of all, sorry for my (very) late reply. I had hoped to have the data conversion code ready for publication by now, but unfortunately I'm currently very busy with other projects. The conversion code is currently scattered over multiple jupyter notebooks and I would like to create usable scripts and clean up the code before publishing. However, the conversion is very straight forward for CoNLL04 and SciERC. We did not perform any preprocessing, just a conversion to our file format. ADE conversion however was a bit more complex.

Regarding the first question, currently this is not possible. This is also a feature that I want to implement (since you are not the first one asking) when I find time for it. Regarding 'realtime' inference, I do not have much experience and can't give you any advice.

markus-eberts commented 4 years ago

I added the dataset conversion scripts in commit 0032c8fc46d1fd6966ee32db37c56e2884bd0d78.