Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for relation extraction #7

Open
plison opened this issue Apr 30, 2021 · 4 comments
Open

Support for relation extraction #7

plison opened this issue Apr 30, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@plison
Copy link
Collaborator

plison commented Apr 30, 2021

Right now, skweak supports two main types of NLP tasks: (token-level) sequence labelling and text classification. Both rests on the idea that labelling functions associate labels to text spans, and the role of the aggregation model is then to merge the outputs of those labelling functions such as to get unified predictions.

However, some NLP tasks cannot be easily associated to text spans. For instance, relation extraction necessitates a prediction on pairs of spans.

The question is then how to provide support for such type of tasks, for instance by implementing a RelationAnnotator that could be used to associate pairs of spans to a label.

Technically speaking, we could still encode the annotations internally as SpanGroup objects. One solution would be to only add one span of the pair in the SpanGroup, but then specify that this span is connected to a second span (SpanGroup objects allows the inclusion of JSON-serialised attributes). The method get_observation_df in the BaseAggregator class could then be extended to detect whether a span is a normal one, or is connected to a second span. If that is the case, the aggregation would then be done on pairs of spans instead of single spans.

Do get in touch if this functionality is something you need, so that we know whether we should prioritise this in our next release :-)

@plison plison added the enhancement New feature or request label Apr 30, 2021
@wjbmattingly
Copy link

This is precisely what I need for multiple projects. I'm not sure what I can do to assist, but please do reach out if you need/want help.

@fernandonjardim
Copy link

This is totally what I need and a lot more people!
I can even send you examples on what I am trying to do, with several corpus to be tagged haha

@rjurney
Copy link

rjurney commented Sep 7, 2022

This is something I'm very interested in. A lot of people need this.

@plison this would be great if it could integrate with flair. How much work would be involved? How hard would the implementation be that you describe?

I would love to pull this into https://github.com/Graphlet-AI/graphlet and use it for building knowledge graphs along with flair and BLINK.

@Kael-DWT
Copy link

Kael-DWT commented Sep 9, 2022

I want this functionality. This is great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants