aphp / edsnlp

Modular, fast NLP framework, compatible with Pytorch and spaCy, offering tailored support for French clinical notes.
https://aphp.github.io/edsnlp/
BSD 3-Clause "New" or "Revised" License
115 stars 29 forks source link

eds.ner_crf pipeline needs argument `window = 1` to remove CRF instead of the argument `mode = "independent"` #264

Open Aremaki opened 9 months ago

Aremaki commented 9 months ago

eds.ner_crf pipeline needs argument window = 1 to remove CRF instead of the argument mode = "independent"

Description

The mode "independent" is supposed to remove the CRF in the architecture model.

Possible solution

When "mode = independent" assigns window = 1

How to reproduce the bug

import edsnlp

nlp = edsnlp.blank("eds")
nlp.add_pipe(
    "eds.ner_crf"
    name="ner",
    config={
        "mode": "independent", 
        "embedding": {
                "@factory": "eds.transformer",
                "model": "prajjwal1/bert-tiny",
        },
    },
)

Your Environment

percevalw commented 9 months ago

Hi Adam, it's true that the current options are a bit confusing!

Everything else is incorrect:

Looking at it this way, I wonder if we could remove the independent mode and replace it with window=1.

percevalw commented 9 months ago

btw, the bug we were discussing the other day was fixed in #259

Aremaki commented 9 months ago

Yes I agree, it seems that "independent" mode is not necessary, as we can remove CRF with the window argument (window = 1)