Git Product home page Git Product logo

Comments (4)

glample avatar glample commented on May 27, 2024

The LSTM-CRF model predicts a sequence of tags for the entire sequence. As a result, there is not a real notion of entity score, but only sequence score (and the model returns the sequence with the best score). However, you can do something like taking the average of the LSTM probability scores in your entity, and this should give you a good proxy for a confidence score. For instance, if you have
"Barack Obama" in your sentence, and that the model tags these two words as "B_PER" and "E_PER" then you can report the average (or the product) of P(B_PER|Barack) and P(E_PER|Obama) given by the model.

from tagger.

ishita1995 avatar ishita1995 commented on May 27, 2024

I understand what you are saying above,
I am quite new to Theano. I am sorry if I am wrong
While calling the forward function in the f_eval alpha variable would return the probability, but when I make return_best_sequence as False, the code breaks and gives the following error-

File "tagger.py", line 49, in classify_ner
    y_preds = np.array(f_eval(*input))[1:-1]
IndexError: too many indices for array

from tagger.

glample avatar glample commented on May 27, 2024

What you want to look at is probably the tag probability scores:

tagger/model.py

Line 278 in c735605

tags_scores = final_layer.link(final_output)

from tagger.

ishita1995 avatar ishita1995 commented on May 27, 2024

Thanks a lot , it worked ..

from tagger.

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.