Last active
September 21, 2023 11:24
-
-
Save rafaljanwojcik/f00dfae9843dadc0220eba3d36694e27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unidecode import unidecode | |
def text_to_word_list(text, remove_polish_letters): | |
''' Pre process and convert texts to a list of words | |
method inspired by method from eliorc github repo: https://github.com/eliorc/Medium/blob/master/MaLSTM.ipynb''' | |
text = remove_polish_letters(text) | |
text = str(text) | |
text = text.lower() | |
# Clean the text | |
text = sub(r"[^A-Za-z0-9^,!?.\/'+]", " ", text) | |
text = sub(r"\+", " plus ", text) | |
text = sub(r",", " ", text) | |
text = sub(r"\.", " ", text) | |
text = sub(r"!", " ! ", text) | |
text = sub(r"\?", " ? ", text) | |
text = sub(r"'", " ", text) | |
text = sub(r":", " : ", text) | |
text = sub(r"\s{2,}", " ", text) | |
text = text.split() | |
return text | |
file_cleaned.title = file_cleaned.title.apply(lambda x: text_to_word_list(x, unidecode)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When it comes to maintaining a clean and hygienic environment, adhering to a cleaning code is paramount, and in a city like Vancouver, where cleanliness is highly valued, services like carpet shampooing Vancouver play a crucial role. Vancouver's cleaning code emphasizes the importance of regular and thorough cleaning, especially for items like carpets, which can trap dust, allergens, and dirt over time. Carpet shampooing services in Vancouver are known for their professionalism and commitment to ensuring that carpets not only look clean but are also free from harmful contaminants. By incorporating these services into your cleaning code, you can contribute to a healthier and more inviting living or working space in this beautiful city.