MCQ Practice Single Best Answer Topic: Unstructured Data Classification

Q

 a) Download the dataset from https://hrcdn.net/s3_pub/istreet-assets/H4_TQkbOj39HUNoBukluIQ/training.txt  and load it to the variable 'sentiment_analysis_data'.
 b) Give the column names as 'label' and 'message'.
 c) Try out the code snippets and answer the questions.
What command should be given to tokenize a sentence into words?

Question ID
#5571
Subchapter
Unstructured Data Classification
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A from nltk import sentence_tokenize, Word_tokens =sentence_tokenize(sentence)
  • B from nltk.tokenizer import word_tokenizer, Word_tokens =word_tokenizer(sentence)
  • C from nltk import tokenize_words, Word_tokens =tokenize_words(sentence)
  • D from nltk.tokenize import word_tokenize, Word_tokens =word_tokenize(sentence)
Correct Answer: D

Explanation

from nltk.tokenize import word_tokenize, Word_tokens =word_tokenize(sentence)

Share This Question

Share this MCQ with your friends or study group.