Git Product home page Git Product logo

Comments (9)

swfarnsworth avatar swfarnsworth commented on June 9, 2024

Hello, are you referring to the CRF learner itself, or either of the CRF layers in the BiLSTM and BERT?

If the former, we are using the sklearn's CRF implementation (see here), so it may be up to what functionality their implementation supports.

from medacy.

lkqnaruto avatar lkqnaruto commented on June 9, 2024

I'm referring to the CRF layer in the BiLSTM and BERT

from medacy.

swfarnsworth avatar swfarnsworth commented on June 9, 2024

They both use the CRF implemented in pytorch-crf. Does it appear to natively support what you are trying to do?

from medacy.

lkqnaruto avatar lkqnaruto commented on June 9, 2024

They both use the CRF implemented in pytorch-crf. Does it appear to natively support what you are trying to do?

I don't think it is support what I want to do, in pytorch-crf package, the author initialized the transition matrix without any constraint (I think)

from medacy.

lkqnaruto avatar lkqnaruto commented on June 9, 2024

They both use the CRF implemented in pytorch-crf. Does it appear to natively support what you are trying to do?

I wonder in pytorch-crf, the row index represents the current state and column index represents the next state in CRF transition matrix? or the other way around? I'm actually very confused about that.

from medacy.

swfarnsworth avatar swfarnsworth commented on June 9, 2024

I am not sure. If you create or obtain a torch-compatible CRF implementation that does what you need, I may be able to discuss with you how to use it in medaCy, or at least point out where in the code base things would need to be changed.

from medacy.

lkqnaruto avatar lkqnaruto commented on June 9, 2024

I am not sure. If you create or obtain a torch-compatible CRF implementation that does what you need, I may be able to discuss with you how to use it in medaCy, or at least point out where in the code base things would need to be changed.

Thank you, but in the medaCy crf layer, there is no constraint on the transition matrix, right? But If I want to enforce such constraint, where should I modify the code?

from medacy.

swfarnsworth avatar swfarnsworth commented on June 9, 2024

None of the CRFs used in medaCy are implemented within medaCy, so the only changes one would make to medaCy code would be replacing the CRF implementations imported from its dependencies with one that does what is wanted.

In other words, you would probably have to modify the pytorch-crf code.

If you are able to get that far, please let me know and we can discuss how to switch that alternative CRF with those used in medaCy.

from medacy.

lkqnaruto avatar lkqnaruto commented on June 9, 2024

None of the CRFs used in medaCy are implemented within medaCy, so the only changes one would make to medaCy code would be replacing the CRF implementations imported from its dependencies with one that does what is wanted.

In other words, you would probably have to modify the pytorch-crf code.

If you are able to get that far, please let me know and we can discuss how to switch that alternative CRF with those used in medaCy.

Yea, I'm currently trying to use medaCy to do NER task on my dataset, but results not quite good. And I saw some cases like O -> I in the prediction. So I wanna use CRF with some constraint so that I can further improve the performance. I think I'm going to modify the pytorch-crf code, but I just not quite sure how to do it and confused about the index. Hope you can help, thank you in advance.

from medacy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.