Giter VIP home page Giter VIP logo

nn4nlp-code's People

Contributors

danishpruthi avatar dbc148 avatar huitingliu avatar hunterhector avatar mysteryvaibhav avatar neubig avatar xuezhemax 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  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

nn4nlp-code's Issues

Unnecessary parameter() calls in dynet examples

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.

Errors while executing

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.

add generation to 06-rnn lm examples.

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.

MST decoder in biaffine parser

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.

I've got question about the code in nn4nlp-code/16-reinforce/bilstm-tagger.py

I've got a few questions about the code, so I will just list them out. And hope some of you can help.

  1. In line 166, what is "XENT"? this variable only appears once in the code.
  2. In line 106, I don't understand why the probability distribution is calculated in that way?(By the ay my
    compiler said the as_array() part is not right.)
  3. In line 109, "len(x)" is not right. It kept showing this up "TypeError: object of type '_dynet.Expression' has no len()". And I don't really know why the samples are picked this way?

Doubt regarding the code

I've got a few questions about the code "16-reinforce" , so I will just list them out. And hope you can help.

  1. 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.

Computing the number of words

Most files share similar data reading code, like

train = list(read_dataset("../data/classes/train.txt"))
w2i = defaultdict(lambda: UNK, w2i)
dev = list(read_dataset("../data/classes/test.txt"))
nwords = len(w2i)
ntags = len(t2i)

In most of the examples, the variable nwords is used as the effective vocabulary size, for instance, when we allocate parameters for embedding matrix.

W_emb = model.add_lookup_parameters((nwords, EMB_SIZE)) # Word embeddings

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.

about input file

Thank you for your work. Can you share the original data file with us? Thanks a lot!

Updating Pytorch code

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?

question regarding bilstm-tagger.py

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)]```

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.