def preprocessor(text, pipeline):
    """
        preprocess the text as per the given pipeline
        pipeline is a list of functions that process an input text and outputs text 
        (e.g., lemmatizing, removing punctuations etc.),
    """
    if len(pipeline)==0:
        return text
    else:
        return preprocessor(pipeline[0](text), pipeline[1:])