Skip to content

Commit

Permalink
movie_script persona maker
Browse files Browse the repository at this point in the history
  • Loading branch information
gorkemgoknar committed Dec 18, 2020
1 parent 2a27286 commit f957af0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/moviepersonafile.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_data_loaders(args, tokenizer):

logger.info("Build inputs and labels")
datasets = {"train": defaultdict(list), "valid": defaultdict(list)}
print(personachat)
print(personachat.keys())
for dataset_name, dataset in personachat.items():
num_candidates = len(dataset[0]["utterances"][0]["candidates"])
if args.num_candidates > 0 and dataset_name == 'train':
Expand All @@ -88,6 +88,8 @@ def get_data_loaders(args, tokenizer):
lm_labels = bool(j == num_candidates-1)
instance = build_input_from_segments(persona, history, candidate, tokenizer, lm_labels)
for input_name, input_array in instance.items():
print(input_name)
print(dataset_name)
datasets[dataset_name][input_name].append(input_array)
datasets[dataset_name]["mc_labels"].append(num_candidates - 1)
datasets[dataset_name]["n_candidates"] = num_candidates
Expand Down

0 comments on commit f957af0

Please sign in to comment.