Giter Club home page Giter Club logo

Comments (2)

markus-eberts avatar markus-eberts commented on July 28, 2024

Hi,

regarding the output interpretation:
entity_clf is a (B x S x E) tensor where B is the batch size (in sentences), S the count of all token spans up to a specified length (10 per default) and E the number of entity types (+1 for "None"). It contains the model's (softmax) confidences that a given span belongs to a certain type of E. In case the span is assigned to the "None" type (=no entity), it is disregarded in the relation extraction step.

rel_clf is a (B x P x R) tensor where B is again the batch size, P the count of all entity pairs (= spans not assigned to the None class) and R the number of relation types. For each entity pair, it contains the (sigmoid) scores for each relation type.

rels is a (B x P x 2) tensor that contains the corresponding entity indices (in entity_clf, entity_masks, entity_sizes etc.) for each entity pair. With this, you can for example access the corresponding entity scores (by indexing entity_clf with rels).

Regarding your second question: It is (span start, span end, entity type, score). Here 'span end' is exclusive. Also, it corresponds to BPE tokens (byte-pair encoded, as in BERT), not to raw tokens.

from spert.

valtheval avatar valtheval commented on July 28, 2024

Thank you Markus for your help

from spert.

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.