Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Covers computational methods for humanities research, including text mining, network analysis, spatial humanities, and digital archives.
76% 88%+12 ptsof test cases passed
Passed 22 of 25 test cases with the skill, and 19 of 25 without it.
3 of 3 safety checks passed
Not used yet
A skill for applying computational and quantitative methods to humanities research. Covers text mining, network analysis, spatial humanities, and digital archival methods. Designed for researchers bridging traditional humanities with data-driven approaches.
import re
from collections import Counter
def prepare_corpus(texts: list[str], stopwords: set = None) -> list[list[str]]:
"""
Tokenize and clean a corpus of texts for analysis.
Args:
texts: List of raw text strings
stopwords: Set of words to remove
Returns:
List of tokenized, cleaned documents
"""
if stopwords is None:
stopwords = {'the', 'a', 'an', 'and', 'or', 'but', 'in', 'on',
'at', 'to', 'for', 'of', 'with', 'is', 'was', 'are'}
processed = []
for text in texts:
# Lowercase and remove punctuation
tokens = re.findall(r'\b[a-z]+\b', text.lower())
# Remove stopwords and short tokens
tokens = [t for t in tokens if t not in stopwords and len(t) > 2]
processed.append(tokens)
return processed
def compute_tfidf(corpus: list[list[str]]) -> dict:
"""Compute TF-IDF scores for term importance analysis."""
import math
n_docs = len(corpus)
# Document frequency
Next to this one in the catalogue, plus more from the same author.