class sciwing.preprocessing.instance_preprocessing.InstancePreprocessing

Bases: object

This class implements some common pre-processing that may be applied on instances which are List[str]. For example, you can remove stop words, convert the word into lower case and others. Most of the methods here accept an instance and return an instance

static indicate_capitalization(instance: List[str]) → List[str]

Indicates whether every word is all small, all caps or captialized

Parameters:instance (List[str]) – A list of tokens
Returns:Strings indicating capitalization
Return type:List[str]
static lowercase(instance: List[str]) → List[str]
remove_stop_words(instance: List[str]) → List[str]

Remove stop words if they are present We will use stop-words package from pip

Parameters:instance (List[str]) – The list of tokens
Returns:The instance with stop words removed
Return type:List[str]