GithubHelp home page GithubHelp logo

jiangxinyang227 / nlp-project Goto Github PK

View Code? Open in Web Editor NEW
464.0 13.0 224.0 83.56 MB

including text classifier, language model, pre_trained model, multi_label classifier, text generator, dialogue. etc

Python 99.78% Shell 0.21% Jupyter Notebook 0.01%

nlp-project's Introduction

NLP中常见的应用(持续更新中)

将会包括通用的应用(如语言模型,文本分类,文本生成等等)和特定的应用(如闲聊系统,阅读理解等等)

  • language_model:语言模型,可以用诗歌生成,文本生成等等
  • multi_label_classifier:多标签分类
  • text_classifier:文本分类
  • dialogue_generator:基于seq2seq的对话生成
  • pre_trained_model:bert,xlnet等预训练模型的应用
  • fine_grained_sentiment_analysis:细粒度情感分析
  • retrieval_QA:检索式问答
  • few_shot_learning:小样本学习
  • model_compression: 模型压缩
  • reading_comprehension:阅读理解

nlp-project's People

Contributors

carlos9310 avatar jiangxinyang227 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

nlp-project's Issues

induction_network的loss降不下去

image
loss一直是0.24和0.25左右,acc差不多都是0.5,相当于五五开,是我哪里跑错了吗,直接用的提供的reviews目录下的数据跑的。

Bi-LSTM with attention tensor transformation

                    outputs, current_state = tf.nn.bidirectional_dynamic_rnn(lstm_fw_cell, lstm_bw_cell,embedded_words, dtype=tf.float32, scope="bi-lstm" + str(idx))
                   embedded_words = tf.concat(outputs, 2)

    # 将最后一层Bi-LSTM输出的结果分割成前向和后向的输出
    outputs = tf.split(embedded_words, 2, -1)

为什么先对最后一层进行concat后,又split拆开使用,都是针对axis=2拼接和拆开,直接使用bidirectional_dynamic_rnn, 返回的outputs元组不行么?

lstm_siamese 数据格式问题

非常抱歉提这个issue,您能把数据搞个一两条附上去吗?内容随意,是新手,想学习下您这个项目,但数据这块一直弄不成,非常感谢,您也可以发我邮箱,[email protected] 非常感谢

关于bert的长度问题

作者你好 。我用bert的时候,我看到他的官方代码最大的长度是512 用于大文本的时候 例如超过512 效果是不是马上就会变差的了?

数据缺失

在text_generator和text_generator_raw缺少了训练数据

漏了py文件

在fine_grained_sentiment_analysis
ModuleNotFoundError: No module named 'gate_conv'
漏了这个

cnn_b not found in checkpoint

NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Key conv-maxpool-3/cnn_b not found in checkpoint
[[node save/RestoreV2 (defined at /root/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/tensorflow/contrib/tpu/python/tpu/tpu_estimator.py:2418) = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_INT64, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

运行test.py出错

File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\training\saver.py", line 825, in init
self.build()
File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\training\saver.py", line 837, in build
self._build(self._filename, build_save=True, build_restore=True)
File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\training\saver.py", line 862, in _build
raise ValueError("No variables to save")
ValueError: No variables to save

想问一下这是什么原因呢?

词向量问题

你好!情感分析中,请问一下你用什么语料训练的词向量?
sentences = LineSentence("corpus.txt")

text_classfiter报错

初始化Predictor对象,调用predict方法,运行test.py文件后,报错:
InvalidArgumentError (see above for traceback): Inputs to operation transformer/transformer-1/multi_head_atten/Select of type Select must have the same size and shape. Input 0: [8,100,100] != input 1: [1024,100,100]

请问怎么解决呢?

transformer训练准确度低

你好。很感谢您提供的代码教程。目前发现transformer训练准确度低。只有不到60%,大大低于TextCNN的85%,请问您当时测试也是如此吗?若是提高,可以给点建议吗?谢谢
text_classifier/models/transformer.py

text_classifier\models\bilstmatten.py 中代码矩阵运算出错

利用求得的alpha的值对H进行加权求和,用矩阵运算直接操作

    r = tf.matmul(tf.transpose(H, [0, 2, 1]), tf.reshape(self.alpha, [-1, self.config["sequence_length"], 1]))

报错:
InvalidArgumentError (see above for traceback): In[0].dim(0) and In[1].dim(0) must be the same: [128,512,50] vs [256,50,1]
[[Node: Attention/MatMul_1 = BatchMatMul[T=DT_FLOAT, adj_x=false, adj_y=false, _device="/job:localhost/replica:0/task:0/cpu:0"](Attention/transpose, Attention/Reshape_3)]]

Bilstm中,数据流动形状有疑问

states, hidden = self.encoder(embeddings.permute([1, 0, 2]))#[75,64,50],[seq_len, batch, embed_dim]
encoding = torch.cat([states[0], states[-1]], dim=1)#张量拼接[32,512]
对这一段没看懂 能方便加您vx,仔细请教吗 愿意付费

无监督单文本关键词提取

你好,非常喜欢你在文本分类中所说的框架,整体非常清晰。
请教下楼主,无监督单文本关键词提取有没有研究过,
我所知道的只有一个textrank,貌似效果不太好,
如果有什么好的blog或者开源项目,求推荐,谢谢!

TypeError: only integer scalar arrays can be converted to a scalar index

File "train.py", line 125, in train
self.config["batch_size"]):
File "/home/rejae/PycharmProjects/NLP-Project-master/text_classifier/data_helpers/eval_data.py", line 155, in next_batch
y = y[perm]
TypeError: only integer scalar arrays can be converted to a scalar index
需要将eval_data中:
def next_batch(self, x, y, batch_size):

    perm = np.arange(len(x))
    #print(type(y)  is list)  list need transfer to array.
    #out_images = np.array(X_train)[indices.astype(int)]
    np.random.shuffle(perm)
    x = x[perm]
    #y = y[perm]  
    y = np.array(y)[perm] #后修改

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.