flair icon indicating copy to clipboard operation
flair copied to clipboard

biaffine_model

Open 87302380 opened this issue 3 years ago • 5 comments

Using the biaffine model as decoder to solve the NER problem. The code based on the SequenceTagger model. But the accuracy and precision of the model is very bad, the cause of the problem has not been found yet.

The code about biaffine model is referenced :https://github.com/juntaoy/biaffine-ner

87302380 avatar Feb 04 '22 11:02 87302380

Hi @87302380 ,

thanks for adding this! I can have a look at it :)

One question: have you already implemented the context functionality? For a given t the context for generating the embedding for t will be calculated from the x left (and right?) tokens, and x == 64 tokens? But I have to look at the paper again.

stefan-it avatar Feb 04 '22 13:02 stefan-it

Hi @87302380 ,

thanks for adding this! I can have a look at it :)

One question: have you already implemented the context functionality? For a given t the context for generating the embedding for t will be calculated from the x left (and right?) tokens, and x == 64 tokens? But I have to look at the paper again.

I didn't implement that function. Because I thought that was already integrated in flair's embedding layer. (I refer to the training in the FLERT paper)

embeddings = TransformerWordEmbeddings(
    model='xlm-roberta-large',
    layers="-1",
    subtoken_pooling="first",
    fine_tune=True,
    use_context=True,
)

I always thought that just setting use_context to True would do the trick:cold_sweat:. I will start working on code related to embedding.

87302380 avatar Feb 08 '22 20:02 87302380

Yes, setting use_context to True should do it!

alanakbik avatar Feb 09 '22 08:02 alanakbik

@87302380 , any chance of this merging with flair? I got great results with Biaffine for NER and would be a great addition to Flair 😄

bratao avatar Apr 04 '22 16:04 bratao

Thank you for your attention!I am working towards this, but it will take some time. :wink:

87302380 avatar Apr 04 '22 20:04 87302380

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 22 '22 19:10 stale[bot]