Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from keras.preprocessing.text import text_to_word_sequence
- # define
- text = """Founded in 2002, SpaceX’s mission is to enable humans to become a spacefaring civilization and a multi-planet
- species by building a self-sustaining city on Mars. In 2008, SpaceX’s Falcon 1 became the first privately developed
- liquid-fuel launch vehicle to orbit the Earth."""
- # tokenize
- result = text_to_word_sequence(text)
- #removing stopwords
- new_sent = [word for word in result if word not in stopwords.words("english")]
- result1 = ' '.join(new_sent)
- print(result1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement