Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Covers NLP and text mining for research text: preprocessing, topic modeling, sentiment analysis, and named entity recognition.
Use this skill ↓75% 75%0 ptsof test cases passed
Passed 18 of 24 test cases with the skill, and 18 of 24 without it.
3 of 3 safety checks passed
Not used yet
A skill for applying natural language processing (NLP) and text mining techniques to research data. Covers text preprocessing, feature extraction, topic modeling, sentiment analysis, and named entity recognition for analyzing surveys, abstracts, social media, and document corpora.
import re
from collections import Counter
def preprocess_text(text: str, lowercase: bool = True,
remove_numbers: bool = False,
min_word_length: int = 2) -> list[str]:
"""
Preprocess text for NLP analysis.
Args:
text: Raw input text
lowercase: Convert to lowercase
remove_numbers: Remove numeric tokens
min_word_length: Minimum token length to keep
"""
if lowercase:
text = text.lower()
# Remove URLs
text = re.sub(r"http\S+|www\.\S+", "", text)
# Remove HTML tags
text = re.sub(r"<[^>]+>", "", text)
# Remove special characters (keep apostrophes for contractions)
text = re.sub(r"[^a-zA-Z0-9\s']", " ", text)
# Tokenize
tokens = text.split()
Next to this one in the catalogue, plus more from the same author.