Coder Social home page Coder Social logo

shawnwun / nndial Goto Github PK

View Code? Open in Web Editor NEW
348.0 348.0 105.0 72.24 MB

NNDial is an open source toolkit for building end-to-end trainable task-oriented dialogue models. It is released by Tsung-Hsien (Shawn) Wen from Cambridge Dialogue Systems Group under Apache License 2.0.

License: Other

Python 99.06% Shell 0.94%
dialogue dialogue-agents dialogue-generation dialogue-manager dialogue-systems dialogues machine-learning machine-learning-library natural-language-generation natural-language-processing

nndial'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  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

nndial's Issues

Possible bug in DataReader.py when loading vocab from dialogues

Hi, I would like to clarify if this is a bug.

NNDIAL/loader/DataReader.py

Lines 876 to 880 in 740f6d3

# user side
words = self.delexicalise(turn['usr']['transcript']).split()
mwords,words,_,_,_ = self.extractSeq(turn['sys']['sent'],\
type='source',index=False)
ivocab.extend(mwords)

Should the extractSeq method in line 878 be called on turn['usr']['transcript'] instead?

The words variable in line 877 is totally ignored, and replaced by the return values of extractSeq in line 878.

Small implementation detail

I was wondering why you chose Thanos to base your implementation on? Instead of a more generic platform like PyTorch or Tensor flow.

Were there hard blockers with these platforms?
Because I imagine you could have leveraged a lot of things from it? Like all the NN operators and optimizers. Without having to implement them from scratch?

deadcode in the DataReader.py file

I found two bugs:

1.in line 377,"if v=='dontcare' and s=='this':",where s=='this' ,in CamRest676.json it's not found that the slot equal 'this'
issue code location:

if v=='dontcare' and s=='this':

2.in line 380,"if sda['act']=='request':",where sda['act'] ,variable sda has no attribute 'act' ,because in CamRest676.json,items of DA is string type and similar to the following:
"sys": { "sent": "There are several restaurants in the south part of town that serve expensive food. Do you have a cuisine preference?", "DA": [ "food" ] }
issue code location:

if sda['act']=='request':

the process stoped

I have some problems:
when I use
python nndial.py -config config/tracker.cfg -mode train
it prompt me:
loading model settings from config file ...
prepare slot value templates ...
formatting DB ...
setting up vocab, finishing ... 99.85%
semi-supervised action examples: 0.00%
loading semi labels from file ... finishing 100.00%
Corpus VMC : 97.34%
Corpus Success : 91.57%

===============
Data statistics

Train : 405
Valid : 135
Test : 136

Voc : 598

Venue : 68

setting network structures using theano variables ...
init n2n SDS ...
init rnn requestable trackers ...
init OfferChange tracker ...
init rnn informable trackers ...
init normal policy network ...
loss function
/home/andysun100800/anaconda2/envs/nndial/lib/python2.7/site-packages/pygpu/init.py:7: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from . import gpuarray, elemwise, reduction
/home/andysun100800/anaconda2/envs/nndial/lib/python2.7/site-packages/pygpu/elemwise.py:5: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from ._elemwise import GpuElemwise, arg
/home/andysun100800/anaconda2/envs/nndial/lib/python2.7/site-packages/theano/gpuarray/blas.py:19: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pygpu import blas
/home/andysun100800/nndial/NNDIAL/nn/encoder.py:111: UserWarning: DEPRECATION: the 'ds' parameter is not going to exist anymore as it is going to be replaced by the parameter 'ws'.
ignore_border=False)
/home/andysun100800/nndial/NNDIAL/nn/tracker.py:98: UserWarning: DEPRECATION: If x is a vector, Softmax will not automatically pad x anymore in next releases. If you need it, pleasedo it manually. The vector case is gonna be supported soon and the output will be a vector.
b_j = T.nnet.softmax( g_j )[0,:]
including informable tracker loss ...
including informable tracker loss ...
including informable tracker loss ...
/home/andysun100800/nndial/NNDIAL/nn/tracker.py:222: UserWarning: DEPRECATION: If x is a vector, Softmax will not automatically pad x anymore in next releases. If you need it, please do it manually. The vector case is gonna be supported soon and the output will be a vector.
b_j = T.nnet.softmax( g_j )[0,:]
including requestable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including OfferChange tracker loss ...
gradient w.r.t inftrk
gradient w.r.t reqtrk

2018-11-24 1 45 29
how to solve this problem?

train the belief tracker

I use default config and run the tracker training on macOS:
python nndial.py -config config/tracker.cfg -mode train

logs below:

init net from scrach ...
loading model settings from config file ...
prepare slot value templates ...
formatting DB ...
semi-supervised action examples: 0.00%
Corpus VMC : 97.34%
Corpus Success : 91.57%
===============
Data statistics
===============
Train : 405
Valid : 135
Test : 136
===============
Voc : 598
===============
Venue : 68
===============
setting network structures using theano variables ...
init n2n SDS ...
init rnn requestable trackers ...
init OfferChange tracker ...
init rnn informable trackers ...
init normal policy network ...
loss function
including informable tracker loss ...
including informable tracker loss ...
including informable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including requestable tracker loss ...
including OfferChange tracker loss ...
gradient w.r.t inftrk
gradient w.r.t reqtrk

issue:
Program is blocked here,the log is no longer printed.
Apple Activity Monitor status:CPU is 98%,Memory is 15.56GB.

belief tracker

hi, I am reading your code .
I think you are using only one cnn kernel in each layer for belief tracking ,am I right?
can you explain for me ,thank you

Training the belief tracker:**NameError: name 'self' is not defined**

I am training the belief tracker. I am getting the error in the very last stage of training:

.
.
.
Finishing 202 dialog in epoch 1
Finishing 203 dialog in epoch 1
Epoch 1, Alpha 0.002000, TRAIN entropy:95.17, Time:14.06 mins,
VALID entropy:74.52
saving net to file ...
Traceback (most recent call last):
File "nndial.py", line 22, in
model.trainNet()
File "C:\Users\MY DELL\Desktop\Course\6th sem\UGP\data\NNDIAL-master\nn\NNDialogue.py", line 590, in trainNet
self.saveNet()
File "C:\Users\MY DELL\Desktop\Course\6th sem\UGP\data\NNDIAL-master\nn\NNDialogue.py", line 999, in saveNet
'file' :dict( [(name,eval(name)) for name in self.file_vars]),
File "C:\Users\MY DELL\Desktop\Course\6th sem\UGP\data\NNDIAL-master\nn\NNDialogue.py", line 999, in
'file' :dict( [(name,eval(name)) for name in self.file_vars]),
File "", line 1, in
NameError: name 'self' is not defined

I am not able to understand why this error is coming

Could anyone please help with this. I would be really grateful. Thanks

Test results are different from the paper.

LIDM_70
Venue Match Rate : 91.9%
Task Success Rate : 74.3%
BLEU : 0.2337
Semantic Match : 63.7%

LIDM-RL_70
Venue Match Rate : 92.6%
Task Success Rate : 75.7%
BLEU : 0.2459
Semantic Match : 63.4%

LIDM-RL_100 (just set I = 100)
Venue Match Rate : 89.7%
Task Success Rate : 70.6%
BLEU : 0.2541
Semantic Match : 60.3%

not like the paper's result:
LIDM Models
LIDM, I = 50 66.9 0.238
LIDM, I = 70 61.0 0.246
LIDM, I = 100 63.2 0.242
LIDM Models + RL
LIDM, I = 50, +RL 82.4 0.231
LIDM, I = 70, +RL 81.6 0.230
LIDM, I = 100, +RL 84.6 0.240

shawnwun, thanks.

ImportError: No module named hpc_submit

try run :
python scp/batch_script/train_LIDM.py

if comment out the line including hpc_submit, then
Traceback (most recent call last):
File "scp/batch_script/train_LIDM.py", line 58, in
fout.write( configN2N(arc['enc'],arc['dec'],arc['trk']) )
NameError: name 'arc' is not defined

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.