Lesson 4 error: missing arguments

I keep getting the following error while trying to run these two lines in the lesson 4 notebook:

FILES = dict(train=TRN_PATH, validation=VAL_PATH, test=VAL_PATH)
md = LanguageModelData(PATH, TEXT, **FILES, bs=bs, bptt=bptt, min_freq=10)

TypeError Traceback (most recent call last)
in ()
----> 1 md = LanguageModelData(PATH, TEXT, **FILES, bs=bs, bptt=bptt, min_freq=10)

TypeError: init() missing 3 required positional arguments: ‘trn_ds’, ‘val_ds’, and ‘test_ds’

Anyone else have this? Any ideas on how to correct this? Thanks!

  1. Please confirm if all other cells in the notebook till that point worked correctly and you didn’t lose the jupyter kernel connection

  2. Please provide the full error message.

Yes all other cells until that point worked fine.

What I posted earlier is the full error message.

The API changed.

git pull the latest

I just tried that and it says already up to date. I also did a git pull a few hours ago just before running this notebook. Anything else I might need to do to update the api?

That isn’t the most current version of the notebook so not sure what to say.

See here for what I do whenever I start development and see if that resolves anything: These 4 lines will solve 80% of your problems

I’m getting the same error as well. However, this is from the lang_model notebook.

All lines above it ran successfully and the codes are the latest pull.

If you consult the documentation for the command (shift + tab on jupyter notebook with the cursor inside the function) you will see:

" This class provides the entry point for dealing with supported NLP tasks.

  1. Use one of the factory constructors (from_dataframes, from_text-files) to
    obtain an instance of the class. "

So to fix your error, use “from_text-files” like so:

md = LanguageModelData.from_text_files(PATH, TEXT, **FILES, bs=bs, bptt=bptt, min_freq=10)