1

Word Stemming

Unsolved
NLP

Difficulty: 3 | Problem written by zeyad_omar
Problem reported in interviews at

Amazon
Facebook
Google

Stemming words is a very important preprocessing technique use in NLP to obtain words and then feed those words to a model.

Examples of stemming:

"Plays", "playing", and "Played" are all stemmed to "play"

In this problem, you are given a word and you are asked to return the stem of the word.

You can use NLTK library . 

Sample Input:
<class 'list'>
x: ['playing']

Expected Output:
<class 'str'>
play

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Sequi quibusdam consequuntur delectus itaque laboriosam dolore, sint quasi debitis quis fuga assumenda, doloremque eos veritatis, aliquam tempore quam delectus.

Omnis facilis temporibus assumenda vitae non reiciendis cum dignissimos, sequi fugiat ipsam ut minus tenetur sapiente neque aliquid repellat dolorem molestias, harum aut quam, nobis unde itaque labore cumque?

Eligendi incidunt temporibus doloribus facere eaque perferendis alias et, libero id voluptates vero in velit quaerat dignissimos maiores nostrum doloremque, illo optio fuga unde nulla a placeat, earum minima aperiam fuga recusandae ipsa in unde?

This is a premium feature.
To access this and other such features, click on upgrade below.

Ready.

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)