Code Monkey home page Code Monkey logo

active-nlp's People

Contributors

asiddhant 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

active-nlp's Issues

Request for README file

@asiddhant Thanks for sharing the code. I wanted to ask if you can add a README file to the repo as it will help in understanding what each file does and the overall workflow as well.

Regards,
Saket

Requirement Versions

Hi - Can you list the required versions for the packages used (torch, scipy, etc)?
Thank you

Scores from model.decode while running it on an unlabeled dataset

Hi,

I was able to get the code working, but I am not able to get the scores from the decoder when I run the model on an unlabeled dataset (I get the scores during training stage). Can you please suggest if there is anything that I am missing.

Thanks,
Prateek

Error in CNN_CNN_LSTM

Hi,

When I run CNN_CNN_LSTM I get matrix mismatch error. Was wondering if you could have any pointers?

Traceback (most recent call last):
File "/home/prateek.verma/remote_ner/active_ner.py", line 318, in
eval_test_train=False, plot_every = acq_plot_every, lr_decay = 0.05)
File "/home/prateek.verma/remote_ner/neural_ner/util/trainer.py", line 76, in train_model
score = self.model(words, tags, chars, caps, wordslen, charslen, mask, n_batches)
File "/opt/conda/envs/py27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/prateek.verma/remote_ner/neural_ner/models/cnn_cnn_lstm.py", line 72, in forward
loss = self.decoder(new_word_features, tags, tagsmask, usecuda=usecuda)
File "/opt/conda/envs/py27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/prateek.verma/remote_ner/neural_ner/modules/DecoderRNN.py", line 66, in forward
usecuda=usecuda)
File "/home/prateek.verma/remote_ner/neural_ner/modules/DecoderRNN.py", line 41, in forward_step
output = self.linear(output.squeeze(0))
File "/opt/conda/envs/py27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/opt/conda/envs/py27/lib/python2.7/site-packages/torch/nn/modules/linear.py", line 87, in forward
return F.linear(input, self.weight, self.bias)
File "/opt/conda/envs/py27/lib/python2.7/site-packages/torch/nn/functional.py", line 1370, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: size mismatch, m1: [2 x 50], m2: [350 x 19] at /opt/conda/conda-bld/pytorch_1579022021485/work/aten/src/THC/generic/THCTensorMathBlas.cu:290

Fatal Error in active acquisition functions

The sort_info you got from create_batches is the indexes of the current postions after sorted from original order which means that origin_data[sort_info] equals to sorted_data. However, after you doing some operations of prediction, you wanna recovering to the original order, you did sorted_data[sort_info], it is totally wrong and makes the acquisition functions not work. The true operation is to sort the sort_info to get the inverse index, for example, sort_info = [2, 0, 1], you shoud make a list of tuples like [(0,2), (1, 0), (2, 1)], the second value in each tuple is your sort_info, and the first value is the index of sort_info. And then, you sort the list of tuples by the second value, you would get [(1, 0), (2, 1) ,(0, 2)]. Finally, [1, 2, 0] would be the inverse index that can recover the sorted_data to origin_data by "sorted_data[inv_sort_info]".

builtins.RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)

this line have error ,how to fix it, thanks! packed_rnn_input = torch.nn.utils.rnn.pack_padded_sequence(rnn_input, input_lengths,batch_first=False)

builtins.RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)
decoder_output, last_hidden, decoder_attention = decoder(di,decoder_input, last_hidden, encoder_outputs,input_lengths=lengths_sorted)
File "D:\ProgramData\Anaconda3\Lib\site-packages\torch\nn\modules\module.py", line 491, in call
result = self.forward(*input, **kwargs)
 File "D:\change\chunking\models\seq2seq\scripts\model.py", line 205, in forward
packed_rnn_input = torch.nn.utils.rnn.pack_padded_sequence(rnn_input, input_lengths,batch_first=False)
File "D:\ProgramData\Anaconda3\Lib\site-packages\torch\onnx_init_.py", line 57, in wrapper
return fn(*args, **kwargs)
File "D:\ProgramData\Anaconda3\Lib\site-packages\torch\nn\utils\rnn.py", line 124, in pack_padded_sequence
data, batch_sizes = PackPadded.apply(input, lengths, batch_first)
File "D:\ProgramData\Anaconda3\Lib\site-packages\torch\nn_functions\packing.py", line 31, in forward
steps.append(input[prev_l:l, :c_batch_size].contiguous().view(-1, *input.size()[2:]))

builtins.RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)

TypeError: forward() got multiple values for argument 'usecuda'

Traceback (most recent call last):
File "active_ner.py", line 313, in
eval_test_train=False, plot_every = acq_plot_every, lr_decay = 0.05)
File "F:\git\Active-NLP\neural_ner\util\trainer.py", line 77, in train_model
score = self.model(words, tags, chars, caps, wordslen, charslen, mask, n_batches, usecuda=True)
File "E:\Program Files\Python3.6\lib\site-packages\torch\nn\modules\module.py", line 491, in call
result = self.forward(*input, **kwargs)
TypeError: forward() got multiple values for argument 'usecuda'

why this error?when i run it

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.