This is a repository of code examples for the 2017 edition of CMU CS 11-747 Neural Networks for NLP.
By Graham Neubig, Daniel Clothiaux, Zhengzhong Liu, and Xuezhe Ma
Code Samples from Neural Networks for NLP
License: Other
This is a repository of code examples for the 2017 edition of CMU CS 11-747 Neural Networks for NLP.
By Graham Neubig, Daniel Clothiaux, Zhengzhong Liu, and Xuezhe Ma
I would like to know if there are any plans for completing the Pytorch code, and would you accept merge requests from non-class members?
I've got a few questions about the code "16-reinforce" , so I will just list them out. And hope you can help.
line 106 throws an error '_dynet.Expression' object has no attribute 'as_array'
2)line 109 throws an error '_dynet.Expression' object has no attribute 'len(x)'
Can you please help me the solution for this.
There are some error in function generate(sent)
Most files share similar data reading code, like
Lines 18 to 22 in a9e8be5
In most of the examples, the variable nwords
is used as the effective vocabulary size, for instance, when we allocate parameters for embedding matrix.
Line 30 in a9e8be5
However, there are likely many new words in dev/test set that might be added in w2i
... their values are mapped to UNK
, but they are still counted in len(w2i)
which is likely not intended. Often this overcounting does not change the results, but it can be problematic in some cases.
I've got a few questions about the code, so I will just list them out. And hope some of you can help.
Has anyone run those scripts? the performances are really bad... before uploaded to the repo, is there anyone verify those code?
Both language model examples in 06-rnn are lacking generation capability and usage examples. I think those should be added, and the output format changed to be closer to that of the 02-lm examples.
Hi, Thanks for sharing the source code. I learned a lot. But, I have a quick question regarding "Reinforce score", my question is why the Reinforce score is "Score*reward" as calculated here :
line 126 of bilstm-tagger.py
#then calculate the reinforce scores using reinforce
reinforce_scores = [r_s*score for r_s, score in zip(rewards_over_baseline, scores)]```
Shouldn't a softmax be added to the model output?
I find the comments in the MST decoder confusing. The MST decoder is not running a full Chu-Liu-Edmonds MST. It is based on the heuristics that Stanford CoNLL 2017 parser used. Moreover, the scores in Stanford's code are assumed to be normalized by softmax (therefore multiplicative scoring) whereas here, the code passes unnormalized scores , which are basically log-probabilities (ignoring the denominator of softmax, which of course is okay because it affects uniformly whichever node you pick as the parent). I think all division operations in MST decoder should be replaced by subtraction, and 0s should be replaced by -inf.
In pretty much all of the dynet examples, there are unnecessary parameter(parameter_name) calls to convert parameters to expressions. This is no longer necessary, as the newest version of python dynet automatically does the conversion.
Model() should also be renamed to Parameter collection.
This is a bug and should be removed:
https://github.com/neubig/nn4nlp-code/blob/master/02-lm/loglin-lm.py#L97
Other files should be checked as well.
I've got a few questions about the code "16-reinforce" , so I will just list them out. And hope you can help.
Can you please help me the solution for this.
Thank you for your work. Can you share the original data file with us? Thanks a lot!
What's version of the Python that the course uses?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.