```python def preprocess_text(input_text): # 去除特殊字符和标点符号 text = re.sub('[^a-zA-Z0-9\s]', '', input_text)
# 将文本转换为小写 text = text.lower()
# 去除停用词 stopwords = set(['a', 'an', 'the', 'is', 'are', 'of', 'in', 'on', 'and', 'or']) text = ' '.join(word for word in text.split() if word not in stopwords)