Punctuation being removed regardless of CountVectorizer regex captures.
Basically, I am trying to keep punctuation, specifically apostrophes and dashes, in the bertopic model. I have tried numerous instances of CountVectorizor token_patten regex expressions including: # vectorizer_model = CountVectorizer(token_pattern=r"(?u)\b[\w'-]+\b", ngram_range=(3,3)) # vectorizer_model = CountVectorizer(token_pattern=r"(?u)\S+", ngram_range=(3,3)) # vectorizer_model = CountVectorizer(token_pattern=r"(?u)\b\w\w+\b|!|'|?|"|'", ngram_range=(3,3)) vectorizer_model = CountVectorizer(token_pattern=r"[^\s]+", ngram_range=(3,3)) Is there another parameter I can modify to remove this punctuation? It seems like something internal might be removing apostrophes and such from the tokens.
Could you share your full code? I believe if you are using the default embedding model, it will do some slight preprocessing for you whilst if you use a custom model this should not happen. I think it would be solved with embedding_model="all-MiniLM-L6-v2".
Closing this due to inactivity. Let me know if I need to re-open the issue!