Code Monkey home page Code Monkey logo

Comments (3)

wangxinyu0922 avatar wangxinyu0922 commented on June 19, 2024

Hi,

I have no experience for implementing text classificiation models. If you want to implement the code by yourself, I have following suggestions:

  • text_classification_model.py is the code for implementing text classification model from flair.
  • At line 82-84, the code extracts document embeddings instead of word embeddings for the model. Therefore, you may need to decide which part of embedding represents the text embedding. For example, the representation of [CLS] is used by BERT for text classification. Some of the embeddings like Flair embeddings is difficult to decide text embeddings. It could be easier using the pooled/mean embeddings over tokens. You can find the implementation at embeddings.py. But personally I suggest you just implement the function at the forward function at text_classification_model.py.
  • In general, I suggest you may follow the embedding selection function at sequence_tagger_model.py to implement ACE attext_classification_model.py. Then just calculate pooled/mean embeddings over the selected embedding candidates as the text representation for the sentence_tensor.

Best.

from ace.

patelrajnath avatar patelrajnath commented on June 19, 2024

Thanks @wangxinyu0922

I'll have a look at it and see how it goes.

Regards
Raj

from ace.

nguyenbh avatar nguyenbh commented on June 19, 2024

Close this issue since Xinyu's comment seems to resolve the OP question.

from ace.

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.