Skip to content

Training on Django #4

@jayavardhanr

Description

@jayavardhanr

I am just running the command given in the readme file to train the model on django dataset.

. train.sh django

I get the below error. I haven't able to able to fix this. Is the something you faced?
The code runs perfectly for the "hs" dataset.

Traceback (most recent call last):
  File "code_gen.py", line 163, in <module>
    learner.train()
  File "/users/PAS1351/osu9907/NL2code/learner.py", line 111, in train
    bleu, accuracy = evaluation.evaluate_decode_results(self.val_data, decode_results, verbose=False)
  File "/users/PAS1351/osu9907/NL2code/evaluation.py", line 170, in evaluate_decode_results
    bleu_score = sentence_bleu([refer_tokens_for_bleu], pred_tokens_for_bleu, weights=ngram_weights, smoothing_function=sm.method3)
  File "/users/PAS1351/osu9907/envs/nl2code/lib/python2.7/site-packages/nltk/translate/bleu_score.py", line 79, in sentence_bleu
    return corpus_bleu([references], [hypothesis], weights, smoothing_function)
  File "/users/PAS1351/osu9907/envs/nl2code/lib/python2.7/site-packages/nltk/translate/bleu_score.py", line 180, in corpus_bleu
    return bp * math.exp(math.fsum(s))
  File "/users/PAS1351/osu9907/envs/nl2code/lib/python2.7/site-packages/nltk/translate/bleu_score.py", line 178, in <genexpr>
    if p_i.numerator != 0)
AttributeError: 'float' object has no attribute 'numerator'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions