C1M2 Programming Assignment: Failed test case: output has wrong type

I seem to be getting the following error when running cell 22 after completing cell 20. How do I find out what is sending out a NoneType, presumably for the top_k_indices?

Failed test case: output has wrong type. Expected: <class 'list'> Got: <class 'NoneType'>

is this the complete error or you only failed the unittest?

check every place where you must have use call function to determine a list.

can’t say it’s top k indices only as you didn’t mention if you got failed test for a particular exercise or in grader feedback

That is the complete error. I just did a “restart kernel and run up to here”, and it seems that I should have said cell 10 (the unit test). Cell 9 (the list of indices) returned nothing at all.

the place where you write code, you don’t get any output but when you run unit test cell, it check the previous cell where you wrote codes runs the code recalls you wrote, if there is an issue like in your case, they wanted you to recall a variable as a list but you have recalled it by function type that has none type values.

hi @0rb

This is where you have used incorrect function type to list the results :backhand_index_pointing_down:t2:

Convert the retrieved documents into their corresponding indices in the results list
top_k_indices = instead of using the BM25_RETRIEVER you were suppose to index the corpus to get the result as you already have the result list.

please refer the image below, notice print statement for. results for query just before the Exercise 1 header?
to check the results for query
for doc in results[0] this gives result from the first element
but you are told! here to convert documents into indices and as per hints it should! be corpus.index