Giter Site home page Giter Site logo

xinnuoxu / mmi_anti_pytorch Goto Github PK

View Code? Open in Web Editor NEW
33.0 3.0 9.0 298 KB

A pytorch implementation for the MMI-anti model

Python 83.70% Shell 1.23% Perl 9.18% Smalltalk 0.48% Emacs Lisp 4.28% JavaScript 0.21% NewLisp 0.40% Ruby 0.41% Slash 0.07% SystemVerilog 0.05%
mmi dialogue-generation dialogue pytorch diversity language-model chatbot

mmi_anti_pytorch's People

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

Watchers

 avatar  avatar  avatar

mmi_anti_pytorch's Issues

hello

handsome boy, excuse me!
when I have been studing chatbot, I have a question that I don't understand . because of I thank you are enthusiastic,so I want to ask you for this question as follow:

eng_vocab_size = len(eng_tokenizer.word_index) + 1

this code means vocabulary size equals the length of word-index adding 1, I dont't understand why it need to add 1. I think it is necessary to add 1. please you help me , thank you !

Error in Training

Traceback (most recent call last):
File "translate.py", line 157, in
main()
File "translate.py", line 119, in main
batch_data = translator.translate_batch(batch, data)
File "/home/thea/cikm/mmi_anti_pytorch/onmt/translate/Translator.py", line 205, in translate_batch
ret = self._from_beam(beam)
File "/home/thea/cikm/mmi_anti_pytorch/onmt/translate/Translator.py", line 234, in _from_beam
best_scores, best_scores_id = self.tt.FloatTensor(b.ended_sentences_scores).topk(n_best, 0, True, True)
RuntimeError: invalid argument 3: dim not in range at /pytorch/aten/src/TH/generic/THTensorMath.c:3436

Hi XinnouXu, I caught an error in training 'python translate.py -model modelname' and really need some help here.
Thanks in advance!

version of pytorch, torchtext

Which version of pytorch and torchtext do you use ?
I got the following message when trying to perform translate.py.
(I use pytorch 0.3.0 and torchtext 0.2.1. )

TypeError: torch.index_select received an invalid combination of arguments - got (torch.cuda.FloatTensor, int, torch.LongTensor), but expected (torch.cuda.FloatTensor source, int dim, torch.cuda.LongTensor index)

where does the mmi loss function locate?

I just see two losscompute in train.py
`def make_loss_compute(model, tgt_vocab, opt):

if opt.copy_attn:
    compute = onmt.modules.CopyGeneratorLossCompute(
        model.generator, tgt_vocab, opt.copy_attn_force)
else:
    compute = onmt.Loss.NMTLossCompute(
        model.generator, tgt_vocab,
        label_smoothing=opt.label_smoothing)

if use_gpu(opt):
    compute.cuda()

return compute`

TypeError: __init__() got an unexpected keyword argument 'tensor_type'

I use pytorch-cpu 1.0.1, torchtext0.3.1, I am new for pytorch. How can i solve this problem?

`Traceback (most recent call last):
File "/home/yangjingying/PycharmProjects/mmi_anti_pytorch-master/train.py", line 403, in
Loading train dataset from data/dialogue.train.1.pt, number of examples: 100
main()
File "/home/yangjingying/PycharmProjects/mmi_anti_pytorch-master/train.py", line 385, in main
fields = load_fields(first_dataset, data_type, checkpoint)
File "/home/yangjingying/PycharmProjects/mmi_anti_pytorch-master/train.py", line 306, in load_fields
torch.load(opt.data + '.vocab.pt'), data_type)
File "/home/yangjingying/PycharmProjects/mmi_anti_pytorch-master/onmt/io/IO.py", line 57, in load_fields_from_vocab
fields = get_fields(data_type, n_src_features, n_tgt_features)
File "/home/yangjingying/PycharmProjects/mmi_anti_pytorch-master/onmt/io/IO.py", line 43, in get_fields
return TextDataset.get_fields(n_src_features, n_tgt_features)
File "/home/yangjingying/PycharmProjects/mmi_anti_pytorch-master/onmt/io/TextDataset.py", line 210, in get_fields
postprocessing=make_src, sequential=False)

TypeError: init() got an unexpected keyword argument 'tensor_type'
`

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.