I am wondering if there is a way to use tokenizer(s).to_array("LOWERCASE") in the form of string instead of format uint8.
from spacy.lang.en import English
from spacy.tokenizer import Tokenizer
s = "Lets pray for the people that can be the victim of the possible eruption of Taal Volcano keep safe everyone."
# Create nlp obj
nlp = English()
tokenizer = Tokenizer(nlp.vocab)
#Get a list of tokens through list comprehension
tokens = [word.text for word in tokenizer(s)]
#Out > ["Lets", "pray", "for", ... , "everyone"]
# But easier method where you can also can apply Lowercase to the tokens as well by using,
tokens = tokenizer(s).to_array("LOWER")
#Out > array([565864407007422797, 10267499103039061205, ... ,13330460590412905967],dtype=uint64)
#But the format you end with results is dtype Unit8
Is there a way within spacy to get this in string format?
It would make things like removing stopwords much easier
sp = spacy.load("en_core_web_sm")
all_stop_words = sp.Defaults.stop_words
token_without_stopwords = [word for word in tokenizer(s).to_array("LOWER") if word not in all_stopwords]
# This will ofcourse not work since they are two diffrent sata types from what I understand.