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

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

Open
Aremaki opened this issue Feb 19, 2024 · 3 comments
Assignees

Comments

@Aremaki
Copy link
Collaborator

Aremaki commented Feb 19, 2024

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

  • Operating System: Windows
  • Python Version Used: 3.10.13
  • spaCy Version Used: 3.7.2
  • EDS-NLP Version Used: 0.10.5
  • Environment Information:
@percevalw
Copy link
Member

percevalw commented Feb 20, 2024

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

  • mode = independent, window = 1 -> ok, it's softmax
  • mode = marginal/joint, window = 0 -> ok, it's the standard CRF
  • mode = marginal/joint, window = n -> ok, this is the windowed CRF

Everything else is incorrect:

  • mode = independent, window != 1 -> windows have no effect
  • mode = marginal/joint, window == 1 -> transitions have no effect

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

@percevalw
Copy link
Member

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

@Aremaki
Copy link
Collaborator Author

Aremaki commented Feb 20, 2024

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

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

No branches or pull requests

2 participants