from sklearn.feature_extraction.text import CountVectorizer

def tokenize(text):
    return [text.split('#', 1)[0].strip()]
text = ['first ques # on stackoverflow', 'please help']
vec = CountVectorizer(tokenizer=tokenize)
data = vec.fit_transform(text).toarray()
vocab = vec.get_feature_names()
required_list = []
for word in vocab:
    required_list.extend(word.split())
print(required_list)
Scikit Learn - Extract word tokens from a string delimiter using CountVectorizer