Code Monkey home page Code Monkey logo

Comments (2)

scofield7419 avatar scofield7419 commented on September 12, 2024

@SlashChven 您好,请教下:
1.这条:transitions = tf.reshape(tf.concat(0, [transitions] * self.batch_size), [self.batch_size, 6, 6])
6 x 6 指的是label的维度吗?

2.你处理的是char level类型的还是word level类型的?
语料是否有空行呢?
我在forward()中的
(line 118) transitions = tf.reshape(tf.concat(0, [transitions] * self.batch_size), [self.batch_size, 6, 6])
报错:
ValueError: Cannot reshape a tensor with 28800 elements to shape [128, 6, 6] (4608 elements)
请教下这是什么原因呢?

from sequence-labeling.

chilynn avatar chilynn commented on September 12, 2024

你好,类目的话,需要修改num_classes以及transition相关的地方

这里的6指的是,原始的4个label(分别是BMEO),1个特殊标识的label(,可以理解为末尾部分的填充label),1个开头的标识label(在代码中没有明显体现,计算转移时需要用到,helper.py中的getTransition函数中的下标为5的地方可以看出)

from sequence-labeling.

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.