Giter VIP home page Giter VIP logo

textclassification-keras's People

Contributors

dependabot[bot] avatar shawnyxiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

textclassification-keras's Issues

TypeError: add_weight() got multiple values for argument 'name'

Attention类实现感觉有问题,本人使用TextBiRNN模型来跑,出现以下错误:

Traceback (most recent call last):
  File "train.py", line 86, in <module>
    last_activation='softmax').get_model()
  File "/media/gaoya/disk/Applications/keras/短文本分类/model.py", line 282, in get_model
    x_word = Attention(self.maxlen_word)(x_word)
  File "/media/gaoya/disk/Applications/anaconda3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 75, in symbolic_fn_wrapper
    return func(*args, **kwargs)
  File "/media/gaoya/disk/Applications/anaconda3/lib/python3.7/site-packages/keras/engine/base_layer.py", line 463, in __call__
    self.build(unpack_singleton(input_shapes))
  File "/media/gaoya/disk/Applications/keras/短文本分类/model.py", line 231, in build
    constraint=self.b_constraint)
TypeError: add_weight() got multiple values for argument 'name'

请问怎么解决呢

HAN报错

不知道有没有人调通HAN,我在最后fit的时候报了一个维度不不匹配的错误,错误显示:Input输入时需要三维,但是实际获取的是二维(句子数目,句长)

About RCNN

Hi Shawny,

I run your code RCNN, and I found the accuracy was 0.5. Do you know why this happened? Looking forward to your reply. Thanks!

HAN中的Document编码形式似乎不妥?

x_train = sequence.pad_sequences(x_train, maxlen=maxlen_sentence * maxlen_word)

如上line22-25这4行代码,所示编码过程好像如下:
Step1: 强行在document(所有句子)后面padding一次,而不是在每个句子后面都padding一次,形如:(---表示句子)
-----------,------,--- ------------,-------- --,000000000000000000 00000000000000000000

Step2: 强行把document按maxlen_sentence(假设为20)划分看,而非原本句子的自然划分,形如:(|表示向量划分)
-----------,------,---|------------,--------|--,000000000000000000|00000000000000000000

我认为,应该是每个句子内先进行Word Level的编码,然后再进行句子间的Sentence Level编码?形如:
----------- 000000 000|------000000 00000000|-- -------------00000|----------0000000000

大家如何看待?

请问在TextAttBiRNN如何可以输出a的具体值呢,谢谢!

您好,在基于您的代码进行学习的过程中,想查看一下注意力机制为我的文本数据分配的权重,即TextAttBiRNN中attention计算中的a。
但是我在成功输出a后发现,我每句话的每个词都被分配了同样的权重,例如一句话23个单词,每个单词的权重都是1/23。
百思不得其解,在这里想向您请教一下有可能是什么原因造成的呢?数据集按理说不应该有问题的,直接基于RNN做效果也不错。非常抱歉问题这么基础,希望您能解答,感谢!!

How to get attention weights vector in Han?

Hi,
Thank you for these codes.
I wonder if it is possible to get attention weights vector on word-level and also sentence-level attention in Han model?
I want to plot these weights vector after predicting its category.

tested on my own data

Hello!

Could you tell me, please, how can I use your code on my own data? For example I have a vectors of words organised by tf-idf scheme. What should I do if I wanna test it instead of imdb data?

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.