When I run the cell that tests the “parse_data_from_file” function the cell is stuck. What could be the problem? I am adding relevant codes below:
[code removed by mentor]
When I run the cell that tests the “parse_data_from_file” function the cell is stuck. What could be the problem? I am adding relevant codes below:
[code removed by mentor]
Hello @Mohammad_Raziuddin ,
As per the community guidelines, learners are not supposed to post code snippet solutions/notebook here. Learners can only share notebooks with mentors privately via dm.
You can post your errors and discuss solutions of the error with learners and mentors here.
So, could you kindly send me your notebook via dm such that I can check where it went wrong. By clicking on the profile picture, you will see an option to message. There you can attach your notebook. Then we can discuss the issues here, under the topic you created.
With regards,
Nilosree Sengupta
Hello @Mohammad_Raziuddin ,
I have went through your notebook. I am explaining the issues as well as how to fix below :
For # GRADED FUNCTION: remove_stopwords,
Though it gives output , there are issues.
In Your code, You have used a for loop, that iterates over each word and makes a list removes stopwords. But the thing is, it creates a new list for each word, which leads to low efficiency indeed.
To fix this issue :
For # GRADED FUNCTION: parse_data_from_file
,
What your code does :
The remove_stopwords() method is within the nested loop.The sentence variable is only a copy that has no effect on the original list. Stopwords are removed within the loop but are not returned to the list. Hence the initial sentence list is returned.
Therefore it’s not working properly.
To fix this issue :
Hope this helps.
With regards,
Nilosree Sengupta
Thank you very much for you help. I was able to solve the problem with the help from your reply. Please ignore my last DM.
Hello @Mohammad_Raziuddin ,
That’s great!! You are welcome!!
Happy Learning!!
With regards,
Nilosree Sengupta