Git Product home page Git Product logo

Comments (3)

lanwuwei avatar lanwuwei commented on August 10, 2024
  1. Please check this link:
    def readSTSdata(dir):
  2. For different tasks, I set different value for num_class.
  3. For STS, we should use nn.KLDivLoss(), since it is a regression task. There is label conversion for STS, which you may spend some time understanding it.
    for line in open(dir + 'sim.txt'): sim = float(line.strip()) ceil = int(math.ceil(sim)) floor = int(math.floor(sim)) tmp = [0, 0, 0, 0, 0, 0] if floor != ceil: tmp[ceil] = sim - floor tmp[floor] = ceil - sim else: tmp[floor] = 1 labels.append(tmp)

from spm_toolkit.

BruceLee66 avatar BruceLee66 commented on August 10, 2024

image
The code in the image is from the model.py file in the PWIM model.I don't understand why in the STS task, the final dimension of the output is [1, 2].

from spm_toolkit.

lanwuwei avatar lanwuwei commented on August 10, 2024

Ok, I got your point. Actually the PWIM repo is for my NAACL 18 paper, which I tried character embedding for MSRP, URL and PIT. All these tasks have only two classes.
Sorry about the confusing part, you can remove this line and change the num_class accordingly.

from spm_toolkit.

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.