import re


def clean_text(text):
    """
    Applies some pre-processing on the given text.
    Steps :
    - Removing HTML tags
    - Removing special characters
    - Lowering text
    """
    try:
        text = str(text)        
        # remove HTML tags
        text = re.sub(r'<.*?>', '', text)
        
        # remove the characters [\], ['] and ["]
        text = re.sub(r"\\", "", text)      
        text = re.sub(r"\"", "", text)    
        text = re.sub('[^A-Za-z0-9]+', ' ', text)
        text = re.sub(" \d+", " ", text)
        # convert text to lowercase
        text = text.strip().lower()
        return text
    except Exception as e:
        print(str(e))