huggingface / transfer-learning-conv-ai

🦄 State-of-the-Art Conversational AI with Transfer Learning
MIT License
1.73k stars 431 forks source link

why num_candidates set to min(args.num_candidates, len(dataset[0]["utterances"][0]["candidates"])? #38

Open rash19 opened 5 years ago

rash19 commented 5 years ago

In train.py, starting from line number 81- for dataset_name, dataset in personachat.items(): num_candidates = len(dataset[0]["utterances"][0]["candidates"]) if args.num_candidates > 0 and dataset_name == 'train': num_candidates = min(args.num_candidates, num_candidates)

Please explain me the significance of setting num_candidates to len(dataset[0]["utterances"][0]["candidates"])?

martinritchie commented 5 years ago

To protect against the case where args.num_candidates is greater than len(dataset[0]["utterances"][0]["candidates"])?