from sklearn.feature_extraction.text import CountVectorizer corpus = ["The quick brown fox", "jumps over the lazy dog"] vectorizer = CountVectorizer() X = vectorizer.fit_transform(corpus) # Get feature names feature_names = vectorizer.get_feature_names_out() print(feature_names)
['brown', 'dog', 'jumps', 'lazy', 'over', 'quick', 'the', 'fox']In this example, the package library used is scikit-learn (sklearn).