Live survey315 models · 14 providers · 23,592 auditsAudited implement · SAFE →What changedHow we verifyllms.txt

Agent skill · Audited from source

Nlp Toolkit Guide

skill · brycewang-stanford/Auto-Empirical-Research-SkillsNOASSERTION licenceAudited 8 Oct 2026 · source e1ba289846fd

★ 4,537pushed 3 days ago
✓SAFEGrade B · 89/100 · 8 Oct 2026 · e1ba289
4,537repo stars · whole brycewang-stanford/Auto-Empirical-Research-Skills

Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit e1ba289846fd and found no filesystem, network or shell access and no hard-coded secrets. What it does: NLP analysis with perplexity scoring, burstiness, and entropy metrics

Ask an AI about this pageGChatGPTCClaudePPerplexityGeGeminiXGrok
More
Cite

Cite this page

ModelsAtlas. “Nlp Toolkit Guide (brycewang-stanford/Auto-Empirical-Research-Skills)”. Retrieved 8 Oct 2026. https://modelsatlas.com/skills/brycewang-stanford/nlp-toolkit-guide

Trust audit

Audit 0.4.1 · source read 8 Oct 2026

Trust score89/100✓SAFE B
0 critical0 high0 medium0 low0 info

SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.

What the source does

  • FilesystemNone observedNo reads or writes in the source
  • NetworkNone observedNo outbound calls in the source
  • ShellNone observedNo commands run in the source
  • DependenciesPinnedNothing floats
  • SecretsNone foundNo keys in source

Five audit layers

LayerWhat we checkResultFindings
L0 ProvenanceRepo owner, licence, archive status, activityPASS0
L1 Static sourceSecrets, path traversal, supply chain, hidden codeNA0
L2 InstructionsPrompt injection, authority framing, hidden directivesPASS0
L3 InventoryThe files and declarations match the sourcePASS0
L4 SandboxRun in isolation and watch behaviourSKIPPED why0

Gates applied: no behavioural pass.

Findings (0)

No findings at any severity. We re-audit when the source changes.

Audit 0.4.1 · source sha e1ba289846fd · 8 Oct 2026Report an issue or request a re-scan

Provenance

Who published it, and what the verdict is pinned to

What it tells the agent

Full source on GitHub ↗

Its description: NLP analysis with perplexity scoring, burstiness, and entropy metrics

---
name: nlp-toolkit-guide
description: "NLP analysis with perplexity scoring, burstiness, and entropy metrics"
metadata:
  openclaw:
    emoji: "💬"
    category: "domains"
    subcategory: "ai-ml"
    keywords: ["NLP", "perplexity", "burstiness", "entropy", "tokenization", "text analysis"]
    source: "https://github.com/huggingface/transformers"
---

# NLP Toolkit Guide

## Overview

Natural Language Processing research requires a diverse set of analytical tools beyond standard model training. Text quality assessment, AI-generated text detection, linguistic feature extraction, and corpus analysis all depend on well-understood metrics: perplexity, burstiness, entropy, and their variants.

This guide provides practical implementations of these core NLP metrics alongside patterns for tokenization, embedding analysis, and text feature engineering. The focus is on metrics used in active research areas -- AI text detection (perplexity + burstiness classifiers), information-theoretic analysis of corpora, and linguistic diversity measurement.

These tools are framework-agnostic where possible, but leverage Hugging Face Transformers for language model operations and standard Python scientific computing libraries for statistical analysis.

## Perplexity Scoring

Perplexity measures how well a language model predicts a text. Lower perplexity means the text is more predictable to the model -- a key signal in AI text detection, model evaluation, and domain adaptation.

```python
import torch
import numpy as np
from transformers import AutoModelForCausalLM, AutoTokenizer

def compute_perplexity(text: str, model_name: str = "gpt2") -> dict:
    """
    Compute token-level and text-level perplexity using a causal LM.

    Returns:
        dict with 'perplexity', 'log_likelihood', 'token_perplexities'
    """
    tokenizer = AutoTokenizer.from_pretrained(model_name)
    model = AutoModelForCausalLM.from_pretrained(model_name)
    model.eval()

    encodings = tokenizer(text, return_tensors="pt", truncation=True, max_length=1024)
    input_ids = encodings.input_ids

    with torch.no_grad():
        outputs = model(input_ids, labels=input_ids)
        neg_log_likelihood = outputs.loss.item()

    # Token-level perplexities for analysis
    with torch.no_grad():
        logits = outputs.logits[:, :-1, :]  # Shift for next-token prediction
        targets = input_ids[:, 1:]
        log_probs = torch.log_softmax(logits, dim=-1)
        token_log_probs = log_probs.gather(2, targets.unsqueeze(-1)).squeeze(-1)
        token_perplexities = torch.exp(-token_log_probs).squeeze().tolist()

    perplexity = np.exp(neg_log_likelihood)

    return {
        "perplexity": perplexity,
        "log_likelihood": -neg_log_likelihood,
        "token_perplexities": token_perplexities,
        "num_tokens": input_ids.size(1),
    }
```

## Burstiness Analysis

Burstiness measures the tendency of words to appear in clusters rather than uniformly across a text. Human writing tends to be "burstier" -- once a topic is introduced, related terms cluster together, then disappear.

```python
from collections import Counter
import numpy as np

def compute_burstiness(text: str, min_freq: int = 2) -> dict:
    """
    Compute burstiness score for a text.

    Burstiness B = (sigma - mu) / (sigma + mu)
    where sigma and mu are the std dev and mean of inter-arrival times.
    B ranges from -1 (periodic) to 1 (bursty). Human text typically B > 0.
    """
    words = text.lower().split()
    word_positions = {}
    for i, word in enumerate(words):
        word_positions.setdefault(word, []).append(i)

    burstiness_scores = {}
    for word, positions in word_positions.items():
        if len(positions) < min_freq:
            continue
        inter_arrivals = np.diff(positions)
        mu = np.mean(inter_arrivals)
        sigma = np.std(inter_arrivals)
        if mu + sigma == 0:
            burstiness_scores[word] = 0.0
        else:
            burstiness_scores[word] = (sigma - mu) / (sigma + mu)

    # Aggregate burstiness
    if burstiness_scores:
        avg_burstiness = np.mean(list(burstiness_scores.values()))
    else:
        avg_burstiness = 0.0

    return {
        "average_burstiness": avg_burstiness,
        "word_burstiness": burstiness_scores,
        "num_words_analyzed": len(burstiness_scores),
    }
```

## Entropy and Information-Theoretic Metrics

```python
from collections import Counter
import numpy as np

def compute_entropy(text: str, level: str = "word") -> dict:
    """
    Compute Shannon entropy at word or character level.

    Higher entropy indicates more diverse, less predictable text.
    AI-generated text often has lower entropy than human text.
    """
    if level == "word":
        tokens = text.lower().split()
    elif level == "character":
        tokens = list(text.lower())
    else:
        raise ValueError("level must be 'word' or 'character'")

    counts = Counter(tokens)
    total = sum(counts.values())
    probabilities = np.array([c / total for c in counts.values()])

    entropy = -np.sum(probabilities * np.log2(probabilities + 1e-12))
    max_entropy = np.log2(len(counts)) if len(counts) > 1 else 1.0
    normalized_entropy = entropy / max_entropy

    return {
        "entropy": entropy,
        "normalized_entropy": normalized_entropy,
        "vocabulary_size": len(counts),
        "total_tokens": total,
        "type_token_ratio": len(counts) / total,
    }

def compute_conditional_entropy(text: str, n: int = 2) -> float:
    """Compute conditional entropy H(X_n | X_{n-1}) for n-gram analysis."""
    words = text.lower().split()
    if len(words) < n:
        return 0.0

    ngrams = [tuple(words[i:i+n]) for i in range(len(words) - n + 1)]
    contexts = [ng[:-1] for ng in ngrams]

    context_counts = Counter(contexts)
    ngram_counts = Counter(ngrams)

    h = 0.0
    total = len(ngrams)
    for ngram, count in ngram_counts.items():
        context = ngram[:-1]
        p_ngram = 

Excerpt, first 6,001 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.

Install

Pinned to the audited commit e1ba289

Download folder ↗
git clone https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills
git -C Auto-Empirical-Research-Skills checkout e1ba289846fd

The author documents no install command, so this uses the repository directly. Our verdict covers commit e1ba289846fd only.

Works in which agents?

What its own text says, not a test

AgentStatusMore
OpenClawMentioned in its text, not testedSkills for OpenClaw · About OpenClaw
“Mentioned” means the skill’s text names the agent. We have not run it there.

Audit history

Every audit, every source change

  1. ✓SAFE B 89 / 100

    first audit · source e1ba289846fd

README badge

For maintainers · shows the latest audit

ModelsAtlas: SAFE BMODELSATLASSAFE · B
[![ModelsAtlas: SAFE B](https://modelsatlas.com/skills/brycewang-stanford/nlp-toolkit-guide/badge.svg)](https://modelsatlas.com/skills/brycewang-stanford/nlp-toolkit-guide/)

The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.

Similar skills

Add this badge to your README

[![ModelsAtlas: SAFE B](https://modelsatlas.com/skills/brycewang-stanford/nlp-toolkit-guide/badge.svg)](https://modelsatlas.com/skills/brycewang-stanford/nlp-toolkit-guide/)

Questions about Nlp Toolkit Guide

What does the Nlp Toolkit Guide skill do?
🔬 A curated collection of 23,000+ agent skills for empirical research across 8 social science disciplines. | 精选 23,000+ AI Agent 技能库,覆盖8大社会科学学科的实证研究。CoPaper.AI 20分钟完成一篇可复现的规范实证论文,并支持用户上传 Skills。-- Maintained by CoPaper.AI from Stanford REAP.
Is Nlp Toolkit Guide safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Nlp Toolkit Guide access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
Which assistants does Nlp Toolkit Guide work with?
Its documentation mentions openclaw. That is what the text claims, not a compatibility test we ran.
How current is this page?
The grade is for one exact copy of the source (e1ba289846fd), read on 2026-10-08. The repository is watched, and a new audit runs when it changes — this is the first audit.

Sources

Spotted something wrong? Report a correction · Methodology

Keep going in your AI

Opens with this page as the source. We add nothing else to the prompt.